Skip to content

Commit

Permalink
Merge pull request #38 from HDRUK/GAT-3848
Browse files Browse the repository at this point in the history
Gat 3848
  • Loading branch information
spco authored Apr 23, 2024
2 parents 866da1c + 33cfa69 commit 3e128b1
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 106 deletions.
120 changes: 60 additions & 60 deletions docs/HDRUK/2.2.1.md

Large diffs are not rendered by default.

44 changes: 21 additions & 23 deletions docs/HDRUK/2.2.1.structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
"examples": null,
"type": [
"EmailAddress[{'anyOf': [{'format': 'email', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.EmailAddress.EmailAddress]]",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -267,7 +267,7 @@
],
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters]",
"null"
],
"is_list": false,
Expand All @@ -282,7 +282,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.ShortDescription.ShortDescription]]",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -385,7 +385,7 @@
],
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]",
"null"
],
"is_list": false,
Expand All @@ -402,7 +402,7 @@
],
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Union[hdr_schemata.definitions.HDRUK.Url.Url, NoneType, hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters, hdr_schemata.definitions.HDRUK.IsPartOfEnum.IsPartOfEnum]]",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -434,7 +434,7 @@
],
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -749,7 +749,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[hdr_schemata.definitions.HDRUK.DataUseLimitation.DataUseLimitation]",
"null"
],
"is_list": false,
Expand All @@ -764,7 +764,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[hdr_schemata.definitions.HDRUK.DataUseRequirements.DataUseRequirements]",
"null"
],
"is_list": false,
Expand All @@ -779,7 +779,7 @@
"examples": null,
"type": [
"ShortDescription[{'anyOf': [{'maxLength': 1000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.ShortDescription.ShortDescription]]",
"null"
],
"is_list": false,
Expand All @@ -794,7 +794,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]",
"null"
],
"is_list": false,
Expand All @@ -810,7 +810,7 @@
"type": [
"Doi[{'anyOf': [{'pattern': '^10.\\\\d{4,9}/[-._;()/:a-zA-Z0-9]+$', 'type': 'string'}, {'type': 'null'}]}]",
"str",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Doi.Doi]]",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -869,7 +869,7 @@
"examples": null,
"type": [
"LongDescription[{'anyOf': [{'maxLength': 50000, 'minLength': 2, 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -897,7 +897,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[hdr_schemata.definitions.HDRUK.Isocountrycode.Isocountrycode]",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -969,7 +969,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[hdr_schemata.definitions.HDRUK.ControlledVocabulary.ControlledVocabulary]",
"null"
],
"is_list": false,
Expand All @@ -983,11 +983,9 @@
"description": "List any relevant terminologies / ontologies / controlled vocabularies, such as ICD 10 Codes, NHS Data Dictionary National Codes or SNOMED CT International, that are being used by the dataset. If the controlled vocabularies are local standards, please make that explicit. If you are using a standard that has not been included in the list, please use \u201cother\u201d and contact support desk to ask for an addition. Notes: More than one vocabulary may be provided.",
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"null"
"StandardisedDataModels[{'$defs': {'StandardisedDataModelsEnum': {'enum': ['HL7 FHIR', 'HL7 V2', 'HL7 CDA', 'HL7 CCOW', 'LOINC', 'DICOM', 'I2B2', 'IHE', 'OMOP', 'OPENEHR', 'SENTINEL', 'PCORNET', 'CDISC', 'NHS DATA DICTIONARY', 'NHS SCOTLAND DATA DICTIONARY', 'NHS WALES DATA DICTIONARY', 'LOCAL', 'OTHER'], 'title': 'StandardisedDataModelsEnum', 'type': 'string'}}, 'anyOf': [{'$ref': '#/$defs/StandardisedDataModelsEnum'}, {'type': 'null'}], 'default': null}]"
],
"is_list": false,
"is_list": true,
"is_optional": true,
"subItems": []
},
Expand All @@ -999,7 +997,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[hdr_schemata.definitions.HDRUK.Language.Language]",
"null"
],
"is_list": false,
Expand All @@ -1014,7 +1012,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[hdr_schemata.definitions.HDRUK.Format.Format]",
"null"
],
"is_list": false,
Expand Down Expand Up @@ -1046,7 +1044,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Union[hdr_schemata.definitions.HDRUK.Url.Url, NoneType, hdr_schemata.definitions.HDRUK.OneHundredFiftyCharacters.OneHundredFiftyCharacters]]",
"null"
],
"is_list": false,
Expand All @@ -1061,7 +1059,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.AbstractText.AbstractText]]",
"null"
],
"is_list": false,
Expand All @@ -1076,7 +1074,7 @@
"examples": null,
"type": [
"CommaSeparatedValues[{'anyOf': [{'pattern': '([^,]+)', 'type': 'string'}, {'type': 'null'}]}]",
"List",
"typing.List[typing.Optional[hdr_schemata.definitions.HDRUK.Url.Url]]",
"null"
],
"is_list": false,
Expand Down
39 changes: 19 additions & 20 deletions hdr_schemata/definitions/HDRUK/StandardisedDataModelsEnum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
from typing import List, Optional, Union
from pydantic import AnyUrl, BaseModel, EmailStr, Field, constr

class StandardisedDataModelsEnum(Enum):
HL7_FHIR = 'HL7 FHIR'
HL7_V2 = 'HL7 V2'
HL7_CDA = 'HL7 CDA'
HL7_CCOW = 'HL7 CCOW'
LOINC = 'LOINC'
DICOM = 'DICOM'
I2B2 = 'I2B2'
IHE = 'IHE'
OMOP = 'OMOP'
OPENEHR = 'OPENEHR'
SENTINEL = 'SENTINEL'
PCORNET = 'PCORNET'
CDISC = 'CDISC'
NHS_DATA_DICTIONARY = 'NHS DATA DICTIONARY'
NHS_SCOTLAND_DATA_DICTIONARY = 'NHS SCOTLAND DATA DICTIONARY'
NHS_WALES_DATA_DICTIONARY = 'NHS WALES DATA DICTIONARY'
LOCAL = 'LOCAL'
OTHER = 'OTHER'


class StandardisedDataModelsEnum(Enum):
HL7_FHIR = "HL7 FHIR"
HL7_V2 = "HL7 V2"
HL7_CDA = "HL7 CDA"
HL7_CCOW = "HL7 CCOW"
LOINC = "LOINC"
DICOM = "DICOM"
I2B2 = "I2B2"
IHE = "IHE"
OMOP = "OMOP"
OPENEHR = "OPENEHR"
SENTINEL = "SENTINEL"
PCORNET = "PCORNET"
CDISC = "CDISC"
NHS_DATA_DICTIONARY = "NHS DATA DICTIONARY"
NHS_SCOTLAND_DATA_DICTIONARY = "NHS SCOTLAND DATA DICTIONARY"
NHS_WALES_DATA_DICTIONARY = "NHS WALES DATA DICTIONARY"
LOCAL = "LOCAL"
OTHER = "OTHER"
3 changes: 0 additions & 3 deletions hdr_schemata/models/HDRUK/2.2.1/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -929,9 +929,6 @@
},
"conformsTo": {
"anyOf": [
{
"$ref": "#/$defs/CommaSeparatedValues"
},
{
"items": {
"$ref": "#/$defs/StandardisedDataModels"
Expand Down
1 change: 1 addition & 0 deletions hdr_schemata/models/HDRUK/v2_1_2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .Observations import Observation
from .DataClass import DataClass
from .DataElement import DataElement
from .FormatAndStandards import FormatAndStandards

from .annotations import annotations as an

Expand Down
10 changes: 10 additions & 0 deletions hdr_schemata/models/HDRUK/v2_2_1/Accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
from hdr_schemata.definitions.HDRUK import *

from hdr_schemata.models.HDRUK.v2_2_0 import Accessibility as BaseAccessibility

from typing import Optional

from .Access import Access
from .FormatAndStandards import FormatAndStandards

from .annotations import annotations

Expand All @@ -11,3 +15,9 @@

class Accessibility(BaseAccessibility):
access: Access = Field(..., description=an.description, title=an.title)

formatAndStandards: Optional[FormatAndStandards] = Field(
None,
title=an.formatAndStandards.title,
description=an.formatAndStandards.description,
)
17 changes: 17 additions & 0 deletions hdr_schemata/models/HDRUK/v2_2_1/FormatAndStandards.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from typing import Optional, List
from pydantic import Field
from hdr_schemata.definitions.HDRUK import *

from .annotations import annotations

an = annotations.accessibility.formatAndStandards

from hdr_schemata.models.HDRUK.v2_2_0 import (
FormatAndStandards as BaseFormatAndStandards,
)


class FormatAndStandards(BaseFormatAndStandards):
conformsTo: Optional[List[StandardisedDataModels]] = Field(
..., **an.vocabularyEncodingScheme.__dict__
)

0 comments on commit 3e128b1

Please sign in to comment.