Skip to content

Commit

Permalink
tweak data guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
samussiah committed Dec 11, 2018
1 parent 97b6a60 commit b65a6d1
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 61 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 15 additions & 14 deletions scripts/build-data-guidelines-wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,35 @@ const variables = settings
variables.forEach(variable => {
if (['string', 'number'].indexOf(variable.type) > -1)
markdown.push(
`|**${
variable.setting}**|${
variable.default}|${
variable.type}|${
`|\`${
variable.setting}\`|${
variable.default ? `_${variable.default}_` : ''
}|**${
variable['data-type']}**|${
variable.description.replace(/name of variable that (captures )?/, '')}|${
variable.required ? '**Y**' : ''
variable.required ? '**Yes**' : ''
}|`
);
else if (variable.type === 'array') {
if (variable.defaults)
variable.defaults.forEach((item,i) => {
markdown.push(
`|**${
variable.setting}[${i}]**|${
item}|${
variable.type}|${
`|\`${
variable.setting}[${i}]\`|_${
item}_|**${
variable['data-type']}**|${
variable.descriptions[item]}|${
variable.required ? '**Y**' : ''
variable.required ? '**Yes**' : ''
}|`
)
});
else
markdown.push(
`|**${
variable.setting}[]**|_user-defined_|${
variable.type}|${
`|\`${
variable.setting}[]\`||**${
variable['data-type']}**|${
variable.description}|${
variable.required ? '**Y**' : ''
variable.required ? '**Yes**' : ''
}|`
);
} else
Expand Down
4 changes: 2 additions & 2 deletions scripts/configuration-wiki.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ field variable name

field description variable name

**default:** `"fieldname"`
**default:** `"null"`



Expand Down Expand Up @@ -71,7 +71,7 @@ visit/folder variable name
## settings.color_by_col
`string`

coloring variable name of query categorization: query age, query status, or any custom categorication
coloring variable name of query categorization: query age, query status, or any custom categorization; note that _queryage_ is derived by the renderer

**default:** `"queryage"`

Expand Down
31 changes: 15 additions & 16 deletions scripts/data-guidelines-wiki.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ required and optional variables:

| Setting | Default | Data Type | Description | Required? |
|:--------|:--------|:----------|:------------|:---------:|
|**form_col**|formoid|string|form variable name|**Y**|
|**formDescription_col**|ecrfpagename|string|form description variable name|**Y**|
|**field_col**|fieldname|string|field variable name|**Y**|
|**fieldDescription_col**|fieldname|string|field description variable name||
|**site_col**|sitename|string|site variable name|**Y**|
|**marking_group_col**|markinggroup|string|query origin variable name|**Y**|
|**visit_col**|folderoid|string|visit/folder variable name|**Y**|
|**color_by_col**|queryage|string|coloring variable name of query categorization: query age, query status, or any custom categorication|**Y**|
|**age_col**|qdays|string|query age variable measured in days between query open date and data snapshot date, query response date, or query resolution date for open, answered, and resolved queries, respectively|**Y**|
|**status_col**|querystatus|string|query status variable name|**Y**|
|**recency_category_col**|open_time|string|query recency category variable name; overrides `recency_col`||
|**recency_col**|odays|string|query recency variable measured in days between query open date and data snapshot date, regardless of query status||
|**groups[]**|_user-defined_|array|an array of variables by which to count queries; each value of the variable is plotted on the y-axis||
|**status_groups[]**|_user-defined_|array|an array of variables with which to stratify each group-by value, each value of which plots as a component of a stacked bar when Bar Arrangement is set to _Stacked_ or as individual bars when Bar Arrangement is set to _grouped_||
|**filters[]**|_user-defined_|array|an array of variables with which to filter the data||
|**details[]**|_user-defined_|array|an array of variables which will print in the listing; if unspecified all variables in data will appear in listing||
|`form_col`|_formoid_|**character**|form variable name|**Yes**|
|`formDescription_col`|_ecrfpagename_|**character**|form description variable name|**Yes**|
|`field_col`|_fieldname_|**character**|field variable name|**Yes**|
|`fieldDescription_col`||**character**|field description variable name||
|`site_col`|_sitename_|**character**|site variable name|**Yes**|
|`marking_group_col`|_markinggroup_|**character**|query origin variable name|**Yes**|
|`visit_col`|_folderoid_|**character**|visit/folder variable name|**Yes**|
|`age_col`|_qdays_|**numeric**|query age variable measured in days between query open date and data snapshot date, query response date, or query resolution date for open, answered, and resolved queries, respectively|**Yes**|
|`status_col`|_querystatus_|**character**|query status variable name|**Yes**|
|`recency_category_col`|_open_time_|**character**|query recency category variable name; overrides `recency_col`||
|`recency_col`|_odays_|**numeric**|query recency variable measured in days between query open date and data snapshot date, regardless of query status||
|`groups[]`||**either**|an array of variables by which to count queries; each value of the variable is plotted on the y-axis||
|`status_groups[]`||**either**|an array of variables with which to stratify each group-by value, each value of which plots as a component of a stacked bar when Bar Arrangement is set to _Stacked_ or as individual bars when Bar Arrangement is set to _grouped_||
|`filters[]`||**either**|an array of variables with which to filter the data||
|`details[]`||**either**|an array of variables which will print in the listing; if unspecified all variables in data will appear in listing||
39 changes: 18 additions & 21 deletions settings-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "string",
"default": "formoid",
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": true
},
"formDescription_col": {
Expand All @@ -22,7 +22,7 @@
"type": "string",
"default": "ecrfpagename",
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": true
},
"field_col": {
Expand All @@ -31,16 +31,16 @@
"type": "string",
"default": "fieldname",
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": true
},
"fieldDescription_col": {
"title": "Field Description Variable",
"description": "field description variable name",
"type": "string",
"default": "fieldname",
"default": null,
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": false
},
"site_col": {
Expand All @@ -49,7 +49,7 @@
"type": "string",
"default": "sitename",
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": true
},
"marking_group_col": {
Expand All @@ -58,7 +58,7 @@
"type": "string",
"default": "markinggroup",
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": true
},
"visit_col": {
Expand All @@ -67,21 +67,18 @@
"type": "string",
"default": "folderoid",
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": true
},
"color_by_col": {
"title": "Status Group Variable",
"description": "coloring variable name of query categorization: query age, query status, or any custom categorication",
"description": "coloring variable name of query categorization: query age, query status, or any custom categorization; note that _queryage_ is derived by the renderer",
"type": "string",
"default": "queryage",
"enum": [
"queryage",
"querystatus"
],
"data-mapping": true,
"data-type": "string",
"required": true
]
},
"age_statuses": {
"title": "Query Statuses Applicable to Query Age",
Expand All @@ -102,7 +99,7 @@
"type": "string",
"default": "qdays",
"data-mapping": true,
"data-type": "number",
"data-type": "numeric",
"required": true
},
"age_cutoffs": {
Expand Down Expand Up @@ -148,7 +145,7 @@
"type": "string",
"default": "querystatus",
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": true
},
"status_order": {
Expand Down Expand Up @@ -189,7 +186,7 @@
"type": "string",
"default": "open_time",
"data-mapping": true,
"data-type": "string",
"data-type": "character",
"required": false
},
"recency_col": {
Expand All @@ -198,7 +195,7 @@
"type": "string",
"default": "odays",
"data-mapping": true,
"data-type": "number",
"data-type": "numeric",
"required": false
},
"recency_cutoffs": {
Expand Down Expand Up @@ -236,7 +233,7 @@
}
},
"data-mapping": true,
"data-type": "string",
"data-type": "either",
"required": false
},
"status_groups": {
Expand Down Expand Up @@ -269,7 +266,7 @@
}
},
"data-mapping": true,
"data-type": "string",
"data-type": "either",
"required": false
},
"filters": {
Expand All @@ -292,7 +289,7 @@
}
},
"data-mapping": true,
"data-type": "string",
"data-type": "either",
"required": false
},
"dropdown_size": {
Expand Down Expand Up @@ -321,7 +318,7 @@
}
},
"data-mapping": true,
"data-type": "string",
"data-type": "either",
"required": false
},
"bar_arrangement": {
Expand Down

0 comments on commit b65a6d1

Please sign in to comment.