-
Notifications
You must be signed in to change notification settings - Fork 73
[SYNPY-1746] Add IsTemplate column to Curator CSV data model #1311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
fcd6e7a
72907c6
39733e9
7cbfc77
7728d73
28f9b83
096fb54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,13 +55,13 @@ These columns must be present in your CSV data model: | |
| - [Description](#description) | ||
| - [Valid Values](#valid-values) | ||
| - [Required](#required) | ||
| - [Parent](#parent) | ||
| - [Validation Rules](#validation-rules) | ||
| - [IsTemplate](#validation-rules) | ||
|
|
||
| Defining data types: | ||
|
|
||
| - Put a unique data type name in the `Attribute` column. | ||
| - Put the value `DataType` in the `Parent` column. | ||
| - Put the value `True` in the `IsTemplate` column. | ||
| - List at least one attribute in the `DependsOn` column (comma-separated). | ||
| - Optionally add a description to the `Description` column. | ||
|
|
||
|
|
@@ -142,9 +142,9 @@ JSON Schema output: | |
| } | ||
| ``` | ||
|
|
||
| ### Parent | ||
| ### IsTemplate | ||
|
|
||
| Put the value `DataType` in this column if this row is a data type. Other values are currently ignored. It is currently used to find all the data types in the data model. | ||
| Put the value `True` in this column if this row is a data type(template). It is currently used to find all the data types in the data model. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andrewelamb what's the behavior if both
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For creating JSON Schema, the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got, thanks! |
||
|
|
||
| ### columnType | ||
|
|
||
|
|
@@ -164,11 +164,11 @@ Must be one of: | |
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | columnType | Parent | | ||
| |-----------|-------------------|-------------|----------| | ||
| | Patient | "Gender, Hobbies" | | DataType | | ||
| | Gender | | string | | | ||
| | Hobbies | | string_list | | | ||
| | Attribute | DependsOn | columnType | IsTemplate | | ||
| |-----------|-------------------|-------------|------------| | ||
| | Patient | "Gender, Hobbies" | | True | | ||
| | Gender | | string | | | ||
| | Hobbies | | string_list | | | ||
|
|
||
| JSON Schema output: | ||
|
|
||
|
|
@@ -213,11 +213,11 @@ The format of this attribute. See [format](https://json-schema.org/understanding | |
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | columnType | Format | Parent | | ||
| |-----------------|----------------------|-------------|--------|----------| | ||
| | Patient | "Gender, Birth Date" | | | DataType | | ||
| | Gender | | string | | | | ||
| | Birth Date | | string | date | | | ||
| | Attribute | DependsOn | columnType | Format | IsTemplate | | ||
| |-----------------|----------------------|-------------|--------|------------| | ||
| | Patient | "Gender, Birth Date" | | | True | | ||
| | Gender | | string | | | | ||
| | Birth Date | | string | date | | | ||
|
|
||
| JSON Schema output: | ||
|
|
||
|
|
@@ -246,11 +246,11 @@ The regex pattern this attribute must match. The type of this attribute must be | |
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | columnType | Pattern | Parent | | ||
| |-----------|---------------|-------------|---------|----------| | ||
| | Patient | "Gender, ID" | | | DataType | | ||
| | Gender | | string | | | | ||
| | ID | | string | [a-f] | | | ||
| | Attribute | DependsOn | columnType | Pattern | IsTemplate | | ||
| |-----------|---------------|-------------|---------|------------| | ||
| | Patient | "Gender, ID" | | | True | | ||
| | Gender | | string | | | | ||
| | ID | | string | [a-f] | | | ||
|
|
||
| JSON Schema output: | ||
|
|
||
|
|
@@ -279,12 +279,12 @@ The range that this attribute's numeric values must fall within. The type of thi | |
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | columnType | Minimum | Maximum | Parent | | ||
| |--------------|-----------------------------|-------------|---------|---------|----------| | ||
| | Patient | "Age, Weight, Health Score" | | | | DataType | | ||
| | Age | | integer | 0 | 120 | | | ||
| | Weight | | number | 0.0 | | | | ||
| | Health Score | | number | 0.0 | 1.0 | | | ||
| | Attribute | DependsOn | columnType | Minimum | Maximum | IsTemplate | | ||
| |--------------|-----------------------------|-------------|---------|---------|------------| | ||
| | Patient | "Age, Weight, Health Score" | | | | True | | ||
| | Age | | integer | 0 | 120 | | | ||
| | Weight | | number | 0.0 | | | | ||
| | Health Score | | number | 0.0 | 1.0 | | | ||
|
|
||
| JSON Schema output: | ||
|
|
||
|
|
@@ -334,23 +334,23 @@ If you have an existing data model using any of the following validation rules, | |
|
|
||
| ## Conditional dependencies | ||
|
|
||
| The `DependsOn`, `Valid Values` and `Parent` columns can be used together to flexibly define conditional logic for determining the relevant attributes for a data type. | ||
| The `DependsOn`, `Valid Values` and `IsTemplate` columns can be used together to flexibly define conditional logic for determining the relevant attributes for a data type. | ||
|
|
||
| In this example we have the `Patient` data type. The `Patient` can be diagnosed as healthy or with cancer. For Patients with cancer we also want to collect info about their cancer type, and any cancers in their family history. | ||
|
|
||
| Data Model: | ||
|
|
||
| | Attribute | DependsOn | Valid Values | Required | columnType | Parent | | ||
| |----------------|-------------------------------|---------------------|----------|-------------|----------| | ||
| | Patient | "Diagnosis" | | | | DataType | | ||
| | Diagnosis | | "Healthy, Cancer" | True | string | | | ||
| | Cancer | "Cancer Type, Family History" | | | | | | ||
| | Cancer Type | | "Brain, Lung, Skin" | True | string | | | ||
| | Family History | | "Brain, Lung, Skin" | True | string_list | | | ||
| | Attribute | DependsOn | Valid Values | Required | columnType | IsTemplate | | ||
| |----------------|-------------------------------|---------------------|----------|-------------|------------| | ||
| | Patient | "Diagnosis" | | | | True | | ||
| | Diagnosis | | "Healthy, Cancer" | True | string | | | ||
| | Cancer | "Cancer Type, Family History" | | | | | | ||
| | Cancer Type | | "Brain, Lung, Skin" | | string | | | ||
| | Family History | | "Brain, Lung, Skin" | | string_list | | | ||
|
|
||
| To demonstrate this, see the above example with the `Patient` and `Cancer` data types: | ||
|
|
||
| - `Patient` is a data type, but `Cancer` is not, as defined by the `Parent` column. | ||
| - `Patient` is a data type, but `Cancer` is not, as defined by the `IsTemplate` column. | ||
| - `Diagnosis` is an attribute of `Patient`. | ||
| - `Diagnosis` has `Valid Values` of `Healthy` and `Cancer`. | ||
| - `Cancer` is also a data type. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a Product perspective, I just wanted to confirm that having the "Parent" column will not cause this code to fail. Is this correct?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomasyu888 I realized I hadn't updated the documentation, this is fixed now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @andrewelamb, the question remains, will having the Parent column be an issue at all?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parentis now an optional column. In fact, technically, anything is an optional column. We have it that way so that data modelers can add whatever optional columns they wish, and the Curator Extension will just ignore them.