Skip to content

Commit

Permalink
some changes for keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
calmacx committed Aug 13, 2024
1 parent ffffb1c commit 8ad21ca
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 50 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ env/
.idea/

# Ignore editor backup files
*~
*~

# Ignore mac files
*DS_store
6 changes: 3 additions & 3 deletions docs/HDRUK/2.2.0.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"isPartOf": "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}] | typing.List[typing.Union[hdr_schemata.definitions.HDRUK.Url.Url, NoneType, hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters, hdr_schemata.definitions.HDRUK.IsPartOfEnum.IsPartOfEnum]] | null"
},
"coverage": {
"spatial": "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}] | typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]] | null",
"typicalAgeRange": "AgeRange[{'anyOf': [{'pattern': 'Not Known|(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])-(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])', 'type': 'string'}, {'type': 'null'}]}] | null",
"spatial": "CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}] | null",
"pathway": "LongDescription[{'anyOf': [{'maxLength': 50000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}] | null",
"followup": "Followup['0 - 6 MONTHS','6 - 12 MONTHS','1 - 10 YEARS','> 10 YEARS','UNKNOWN','CONTINUOUS','OTHER',null] | null",
"pathway": "Description[{'anyOf': [{'maxLength': 10000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}] | null",
"typicalAgeRange": "AgeRange[{'anyOf': [{'pattern': 'Not Known|(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])-(150|1[0-4][0-9]|[0-9]|[1-8][0-9]|9[0-9])', 'type': 'string'}, {'type': 'null'}]}] | null",
"gender": "GenderType['Male','Female','Other']",
"biologicalsamples": "BiologicalSampleType['Blood','Other','Urine','Saliva']",
"psychological": "PsychologicalType['Cognitive Function','Mental Health']",
Expand Down
7 changes: 4 additions & 3 deletions docs/HDRUK/3.0.0.form.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,12 @@
"Primary Care Prescription",
"Accident and Emergency Admissions"
],
"is_list": false,
"is_list": true,
"is_optional": true,
"types": {
"title": "CommaSeparatedValues",
"pattern": "([^,]+)",
"maxLength": 150,
"minLength": 2,
"title": "OneHundredFiftyCharacters",
"type": "string"
},
"location": "summary.keywords"
Expand Down
54 changes: 27 additions & 27 deletions docs/HDRUK/3.0.0.md

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions docs/HDRUK/3.0.0.structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
"examples": null,
"type": [
"EmailAddress[{'anyOf': [{'format': 'email', 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[hdr_schemata.definitions.HDRUK.EmailAddress.EmailAddress]"
"List"
],
"is_list": false,
"is_optional": false,
Expand Down Expand Up @@ -285,11 +285,9 @@
"Accident and Emergency Admissions"
],
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters]",
"null"
"OneHundredFiftyCharacters[{'maxLength': 150, 'minLength': 2, 'type': 'string'}]"
],
"is_list": false,
"is_list": true,
"is_optional": true,
"subItems": []
},
Expand Down Expand Up @@ -335,7 +333,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.ShortDescription.ShortDescription]]",
"List",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -383,7 +381,7 @@
],
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]",
"List",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -431,7 +429,7 @@
],
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[hdr_schemata.definitions.HDRUK.Url.Url]"
"List"
],
"is_list": false,
"is_optional": false,
Expand Down Expand Up @@ -805,7 +803,7 @@
],
"type": [
"ShortDescription[{'anyOf': [{'maxLength': 1000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.ShortDescription.ShortDescription]]",
"List",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -926,7 +924,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[hdr_schemata.definitions.HDRUK.Isocountrycode.Isocountrycode]",
"List",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -1023,7 +1021,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[hdr_schemata.definitions.HDRUK.Language.Language]",
"List",
"null"
],
"is_list": false,
Expand All @@ -1044,7 +1042,7 @@
],
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"typing.List[hdr_schemata.definitions.HDRUK.Format.Format]",
"List",
"null"
],
"is_list": false,
Expand Down
3 changes: 0 additions & 3 deletions hdr_schemata/models/HDRUK/3.0.0/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1953,9 +1953,6 @@
},
"keywords": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"items": {
"$ref": "#/$defs/OneHundredFiftyCharacters"
Expand Down
2 changes: 1 addition & 1 deletion hdr_schemata/models/HDRUK/v3_0_0/Summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Config:
..., **an.populationSize.__dict__, json_schema_extra={"guidance": an.populationSize.guidance}
)

keywords: Optional[Union[CommaSeparatedValues, List[OneHundredFiftyCharacters]]] = (
keywords: Optional[List[OneHundredFiftyCharacters]] = (
Field(..., **an.keywords.__dict__, json_schema_extra={"guidance": an.keywords.guidance})
)

Expand Down

0 comments on commit 8ad21ca

Please sign in to comment.