Skip to content

Commit

Permalink
Update study_forms JSONs
Browse files Browse the repository at this point in the history
  • Loading branch information
jthompson-arcus committed Dec 6, 2024
1 parent 31346b6 commit 52c5d42
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 20 deletions.
98 changes: 88 additions & 10 deletions tests/testthat/_snaps/mod_study_forms/study_forms-001.json
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,91 @@
"Scroller",
"ColReorder"
],
"data": [
[
{
"reviewed": null,
"ids": [
78,
79,
80,
81,
82,
83,
84,
440
]
},
{
"reviewed": null,
"ids": [
85,
86,
87,
88,
89,
90,
91,
441
]
},
{
"reviewed": false,
"ids": [
92,
93,
94,
95,
96
]
}
],
[
"Screening",
"Visit 1",
"Visit 2"
],
[
"<b>121*<\/b> mmHg",
"<b>120*<\/b> mmHg",
"<b>149*<\/b> mmHg"
],
[
"68 mmHg",
"68 mmHg",
"<b>77*<\/b> mmHg"
],
[
"82 beats/min",
"82 beats/min",
"<b>63*<\/b> beats/min"
],
[
"<b>18*<\/b> breaths/min",
"18 breaths/min",
"<b>19*<\/b> breaths/min"
],
[
"<b>36.7*<\/b> °C",
"36.7 °C",
"<b>37*<\/b> °C"
],
[
"<b>6.3*<\/b> %",
"0.01 %",
null
],
[
"20.96 kg/m2",
"21.87 kg/m2",
null
],
[
"<b>77.2*<\/b> kg",
"<b>61*<\/b> kg",
null
]
],
"container": "<table class=\"table table-striped table-hover row-border order-column display\">\n <thead>\n <tr>\n <th>Review Status<\/th>\n <th>event_name<\/th>\n <th>Systolic blood pressure<\/th>\n <th>Diastolic blood pressure<\/th>\n <th>Pulse<\/th>\n <th>Resp<\/th>\n <th>Temperature<\/th>\n <th>Weight change since screening<\/th>\n <th>BMI<\/th>\n <th>Weight<\/th>\n <\/tr>\n <\/thead>\n<\/table>",
"options": {
"scrollY": 400,
Expand All @@ -1256,7 +1341,7 @@
"columnDefs": [
{
"targets": 0,
"render": "function(data, type, row, meta) {\nvar reviewed = data.reviewed;\nreturn `<input type='checkbox' \nclass='${reviewed == null ? 'indeterminate' : reviewed ? 'checked' : 'unchecked'}' \n${reviewed ? 'checked' : ''} \n${reviewed == null ? 'onclick=\"ts(this)\"' : ''}/>`;\n}"
"render": "function(data, type, row, meta) {\nvar reviewed = data.reviewed;\nvar updated = data.updated;\nreturn `<input type='checkbox' \nclass='${reviewed == null ? 'indeterminate' : reviewed ? 'checked' : 'unchecked'}' \n${updated == null ? (reviewed ? 'checked' : '') : (updated ? 'checked' : '')} \n${reviewed == null ? 'onclick=\"ts(this)\"' : ''}/>`;\n}"
},
{
"name": "Review Status",
Expand Down Expand Up @@ -1313,15 +1398,9 @@

],
"autoWidth": false,
"orderClasses": false,
"ajax": {
"type": "POST",
"data": "function(d) {\nd.search.caseInsensitive = true;\nd.search.smart = true;\nd.escape = false;\nvar encodeAmp = function(x) { x.value = x.value.replace(/&/g, \"%26\"); }\nencodeAmp(d.search);\n$.each(d.columns, function(i, v) {encodeAmp(v.search);});\n}"
},
"serverSide": true,
"processing": true
"orderClasses": false
},
"callback": "function(table) {\ntable.on('click', 'input[type=\"checkbox\"]', function(){\nvar tblId = $(this).closest('.datatables').attr('id');\nvar cell = table.cell($(this).closest('td'));\nvar rowIdx = table.row($(this).closest('tr')).index();\nvar ids = cell.data().ids;\nvar review = $(this).is(':indeterminate') ? null : $(this).is(':checked');\nvar info = {review: review, ids: ids, row: tblId + '_row_' + rowIdx};\nShiny.setInputValue(tblId + '_review_selection:CS.reviewInfo', info);\n})\n}",
"callback": "function(table) {\ntable.on('click', 'input[type=\"checkbox\"]', function(){\nvar tblId = $(this).closest('.datatables').attr('id');\nvar cell = table.cell($(this).closest('td'));\nvar rowIdx = table.row($(this).closest('tr')).index();\nvar ids = cell.data().ids;\nvar review = $(this).is(':indeterminate') ? null : $(this).is(':checked');\ncell.data().updated = review;\nvar info = {review: review, ids: ids, row: tblId + '_row_' + rowIdx};\nShiny.setInputValue(tblId + '_review_selection:CS.reviewInfo', info);\n})\n}",
"selection": {
"mode": "none",
"selected": null,
Expand All @@ -1333,7 +1412,6 @@
"options.columnDefs.0.render",
"options.createdRow",
"options.initComplete",
"options.ajax.data",
"callback"
],
"jsHooks": [
Expand Down
98 changes: 88 additions & 10 deletions tests/testthat/_snaps/mod_study_forms/study_forms-002.json
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,91 @@
"Scroller",
"ColReorder"
],
"data": [
[
{
"reviewed": null,
"ids": [
78,
79,
80,
81,
82,
83,
84,
440
]
},
{
"reviewed": null,
"ids": [
85,
86,
87,
88,
89,
90,
91,
441
]
},
{
"reviewed": false,
"ids": [
92,
93,
94,
95,
96
]
}
],
[
"Screening",
"Visit 1",
"Visit 2"
],
[
"<b>121*<\/b> mmHg",
"<b>120*<\/b> mmHg",
"<b>149*<\/b> mmHg"
],
[
"68 mmHg",
"68 mmHg",
"<b>77*<\/b> mmHg"
],
[
"82 beats/min",
"82 beats/min",
"<b>63*<\/b> beats/min"
],
[
"<b>18*<\/b> breaths/min",
"18 breaths/min",
"<b>19*<\/b> breaths/min"
],
[
"<b>36.7*<\/b> °C",
"36.7 °C",
"<b>37*<\/b> °C"
],
[
"<b>6.3*<\/b> %",
"0.01 %",
null
],
[
"20.96 kg/m2",
"21.87 kg/m2",
null
],
[
"<b>77.2*<\/b> kg",
"<b>61*<\/b> kg",
null
]
],
"container": "<table class=\"table table-striped table-hover row-border order-column display\">\n <thead>\n <tr>\n <th>Review Status<\/th>\n <th>event_name<\/th>\n <th>Systolic blood pressure<\/th>\n <th>Diastolic blood pressure<\/th>\n <th>Pulse<\/th>\n <th>Resp<\/th>\n <th>Temperature<\/th>\n <th>Weight change since screening<\/th>\n <th>BMI<\/th>\n <th>Weight<\/th>\n <\/tr>\n <\/thead>\n<\/table>",
"options": {
"scrollY": 400,
Expand All @@ -1256,7 +1341,7 @@
"columnDefs": [
{
"targets": 0,
"render": "function(data, type, row, meta) {\nvar reviewed = data.reviewed;\nreturn `<input type='checkbox' \nclass='${reviewed == null ? 'indeterminate' : reviewed ? 'checked' : 'unchecked'}' \n${reviewed ? 'checked' : ''} \n${reviewed == null ? 'onclick=\"ts(this)\"' : ''}/>`;\n}"
"render": "function(data, type, row, meta) {\nvar reviewed = data.reviewed;\nvar updated = data.updated;\nreturn `<input type='checkbox' \nclass='${reviewed == null ? 'indeterminate' : reviewed ? 'checked' : 'unchecked'}' \n${updated == null ? (reviewed ? 'checked' : '') : (updated ? 'checked' : '')} \n${reviewed == null ? 'onclick=\"ts(this)\"' : ''}/>`;\n}"
},
{
"name": "Review Status",
Expand Down Expand Up @@ -1313,15 +1398,9 @@

],
"autoWidth": false,
"orderClasses": false,
"ajax": {
"type": "POST",
"data": "function(d) {\nd.search.caseInsensitive = true;\nd.search.smart = true;\nd.escape = false;\nvar encodeAmp = function(x) { x.value = x.value.replace(/&/g, \"%26\"); }\nencodeAmp(d.search);\n$.each(d.columns, function(i, v) {encodeAmp(v.search);});\n}"
},
"serverSide": true,
"processing": true
"orderClasses": false
},
"callback": "function(table) {\ntable.on('click', 'input[type=\"checkbox\"]', function(){\nvar tblId = $(this).closest('.datatables').attr('id');\nvar cell = table.cell($(this).closest('td'));\nvar rowIdx = table.row($(this).closest('tr')).index();\nvar ids = cell.data().ids;\nvar review = $(this).is(':indeterminate') ? null : $(this).is(':checked');\nvar info = {review: review, ids: ids, row: tblId + '_row_' + rowIdx};\nShiny.setInputValue(tblId + '_review_selection:CS.reviewInfo', info);\n})\n}",
"callback": "function(table) {\ntable.on('click', 'input[type=\"checkbox\"]', function(){\nvar tblId = $(this).closest('.datatables').attr('id');\nvar cell = table.cell($(this).closest('td'));\nvar rowIdx = table.row($(this).closest('tr')).index();\nvar ids = cell.data().ids;\nvar review = $(this).is(':indeterminate') ? null : $(this).is(':checked');\ncell.data().updated = review;\nvar info = {review: review, ids: ids, row: tblId + '_row_' + rowIdx};\nShiny.setInputValue(tblId + '_review_selection:CS.reviewInfo', info);\n})\n}",
"selection": {
"mode": "none",
"selected": null,
Expand All @@ -1333,7 +1412,6 @@
"options.columnDefs.0.render",
"options.createdRow",
"options.initComplete",
"options.ajax.data",
"callback"
],
"jsHooks": [
Expand Down

0 comments on commit 52c5d42

Please sign in to comment.