Skip to content

Commit

Permalink
add additions for 1.1 for tissue samples
Browse files Browse the repository at this point in the history
  • Loading branch information
calmacx committed Jan 30, 2024
1 parent 163b2f3 commit f1dca22
Show file tree
Hide file tree
Showing 6 changed files with 543 additions and 23 deletions.
314 changes: 314 additions & 0 deletions hdr_schemata/models/GWDM/1.1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,307 @@
],
"title": "TimeLag"
},
"TissueSampleDonor": {
"properties": {
"id": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "ID of the sample donor",
"title": "Donor ID"
},
"sex": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Sex of the sample donor",
"title": "Donor Sex"
},
"dataCategories": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Data categories related to the sample donor",
"title": "Donor Data Categories"
}
},
"title": "TissueSampleDonor",
"type": "object"
},
"TissueSampleMetadata": {
"properties": {
"id": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "ID of the tissue sample metadata",
"title": "Metadata ID"
},
"sampleDonor": {
"allOf": [
{
"$ref": "#/$defs/TissueSampleDonor"
}
],
"default": null,
"description": "Information about the sample donor",
"title": "Sample Donor"
},
"sampleType": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Type of the tissue sample",
"title": "Sample Type"
},
"storageTemperature": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Storage temperature of the tissue sample",
"title": "Storage Temperature"
},
"creationDate": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Date when the tissue sample metadata was created",
"title": "Creation Date"
},
"AnatomicalSiteOntologyCode": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Ontology code for the anatomical site",
"title": "Anatomical Site Ontology Code"
},
"AnatomicalSiteOntologyDescription": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Ontology description for the anatomical site",
"title": "Anatomical Site Ontology Description"
},
"AnatomicalSiteFreeText": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Free text describing the anatomical site",
"title": "Anatomical Site Free Text"
},
"sampleContentDiagnosis": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Diagnosis related to the sample content",
"title": "Sample Content Diagnosis"
},
"useReCommaSeparatedValuesictions": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Restrictions on the use of the tissue sample",
"title": "Use Restrictions"
}
},
"title": "TissueSampleMetadata",
"type": "object"
},
"TissuesSampleCollection": {
"properties": {
"id": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "ID of the tissue sample collection",
"title": "ID"
},
"dataCategories": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Data categories related to the tissue sample collection",
"title": "Data Categories"
},
"materialType": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Material type of the tissue sample collection",
"title": "Material Type"
},
"accessConditions": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Access conditions for the tissue sample collection",
"title": "Access Conditions"
},
"collectionType": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Type of the tissue sample collection",
"title": "Collection Type"
},
"disease": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Disease associated with the tissue sample collection",
"title": "Disease"
},
"storageTemperature": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Storage temperature of the tissue sample collection",
"title": "Storage Temperature"
},
"sampleAgeRange": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"type": "null"
}
],
"default": null,
"description": "Age range of the tissue sample collection",
"title": "Sample Age Range"
},
"tissueSampleMetadata": {
"anyOf": [
{
"$ref": "#/$defs/TissueSampleMetadata"
},
{
"type": "null"
}
],
"default": null,
"description": "Metadata related to the tissue sample",
"title": "Tissue Sample Metadata"
}
},
"title": "TissuesSampleCollection",
"type": "object"
},
"TwoHundredFiftyFiveCharacters": {
"maxLength": 255,
"minLength": 2,
Expand Down Expand Up @@ -1622,6 +1923,19 @@
"default": null,
"description": "Descriptions of all tables and data elements that can be included in the dataset",
"title": "Structural Metadata"
},
"tissuesSampleCollection": {
"anyOf": [
{
"$ref": "#/$defs/TissuesSampleCollection"
},
{
"type": "null"
}
],
"default": null,
"description": "Metadata collection for Tissue Samples datasets",
"title": "Tissues Sample Collection"
}
},
"required": [
Expand Down
13 changes: 6 additions & 7 deletions hdr_schemata/models/GWDM/v1_1/Organisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@


class Organisation(BaseModel):

name: Optional[Name] = Field(
...,
description="The organisation responsible for running or supporting the data access request process, as well as publishing and maintaining the metadata. In most this will be the same as the HDR UK Organisation (Hub or Alliance Member)/",
example="SAIL",
title='Name'
title="Name",
)

#note: will need to do something about this in the future
# note: will need to do something about this in the future
# should match a pattern? sha256? integer?
gatewayId: Optional[constr(min_length=2,max_length=50)] = Field(
gatewayId: Optional[constr(min_length=2, max_length=50)] = Field(
None,
description="The link to an ID somewhere in the gateway where more information on the publisher can be retrieved.",
title='Publisher gateway id'
title="Publisher gateway id",
)

rorId: Optional[constr(min_length=9,max_length=9)] = Field(
rorId: Optional[constr(min_length=9, max_length=9)] = Field(
None,
description="The Research Organization Registry (ROR) for the organisation, if applicable",
title="Research Organization Registry Identifier"
title="Research Organization Registry Identifier",
)
24 changes: 24 additions & 0 deletions hdr_schemata/models/GWDM/v1_1/SampleDonor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from typing import Optional, Union
from datetime import date, datetime
from pydantic import BaseModel, Field, constr
from hdr_schemata.definitions.HDRUK import CommaSeparatedValues


class SampleDonor(BaseModel):
id: Optional[constr(min_length=2, max_length=50)] = Field(
None, title="Donor ID", description="ID of the sample donor"
)

sex: Optional[str] = Field(
None, title="Donor Sex", description="Sex of the sample donor"
)

birthDate: Optional[Union[date, datetime]] = Field(
None, title="Donor birth date", description="Date of birth of the sample donor"
)

dataCategories: Optional[CommaSeparatedValues] = Field(
None,
title="Donor Data Categories",
description="Data categories related to the sample donor",
)
Loading

0 comments on commit f1dca22

Please sign in to comment.