Skip to content

Commit

Permalink
Merge pull request #406 from icgc-argo/develop
Browse files Browse the repository at this point in the history
Dictionary 1.17 merge to master
  • Loading branch information
hknahal authored May 10, 2023
2 parents 7c3bc92 + a714723 commit d586d5b
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,25 @@ const validation = () =>
let result = {valid: true, message: "Ok"};

const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];
const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();

/* checks for a string just consisting of whitespace */
const checkforEmpty = (entry) => {return /^\s+$/g.test(decodeURI(entry).replace(/^"(.*)"$/, '$1'))};


if (!$field || $field === null || checkforEmpty($field)) {
if (lymphNodesExaminedStatus === 'yes') {
result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};
}
if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {
result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};
}
else {
if (notExamined.includes(lymphNodesExaminedStatus)) {
result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};
}
const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();

if (!$field || $field === null || checkforEmpty($field)) {
if (lymphNodesExaminedStatus === 'yes') {
result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};
}
}
else {
if (notExamined.includes(lymphNodesExaminedStatus)) {
result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};
}
}
}
return result;
});
Expand Down
7 changes: 4 additions & 3 deletions schemas/follow_up.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@
}
},
{
"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.",
"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": "#/script/follow_up/anatomic_site_progression_or_recurrence",
"regex": "^[C][0-9]{2}(.[0-9]{1})?$"
Expand All @@ -219,8 +220,8 @@
"core": true,
"dependsOn": "follow_up.disease_status_at_followup",
"displayName": "Anatomic Site Progression or Recurrences",
"examples": "C50.1,C18",
"notes": "#/notes/disease_status_requirement"
"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."
}
},
{
Expand Down
1 change: 1 addition & 0 deletions schemas/sample_registration.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"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"
],
Expand Down
18 changes: 18 additions & 0 deletions schemas/specimen.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,24 @@
}
}
},
{
"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": "#/notes/if_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.",
Expand Down
18 changes: 18 additions & 0 deletions tests/primary_diagnosis/lymphNodesExaminedMethod.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,25 @@ const myUnitTests = {
"lymph_nodes_examined_status": "Not applicable"
}
)
],
[
'lymph_nodes_examined_method is missing',
false,
loadObjects(primary_diagnosis,
{
"lymph_nodes_examined_method": null
}
)
],
[
'lymph_nodes_examined_status is missing and lymph_nodes_examined_method not submitted',
false,
loadObjects(primary_diagnosis,
{
}
)
]

]
}

Expand Down

0 comments on commit d586d5b

Please sign in to comment.