onconova.terminology.fhir
This module defines Pydantic models for FHIR CodeSystem and ValueSet resources, enabling validation and serialization of terminology data according to the FHIR specification.
CodeSystem
¶
Bases: BaseModel
Represents a FHIR CodeSystem resource.
Attributes:
Name | Type | Description |
---|---|---|
resourceType |
Literal['CodeSystem']
|
The type of the resource (always "CodeSystem"). |
id |
Optional[str]
|
Logical id of the resource. |
url |
Optional[str]
|
Canonical identifier for the code system. |
version |
Optional[str]
|
Version of the code system. |
name |
Optional[str]
|
Name for this code system. |
status |
str
|
Status of the code system (e.g., "active", "draft"). |
content |
str
|
The content mode of the code system. |
experimental |
Optional[bool]
|
If true, indicates the code system is experimental. |
date |
Optional[str]
|
Date when the code system was published. |
publisher |
Optional[str]
|
Name of the publisher. |
description |
Optional[str]
|
Natural language description of the code system. |
caseSensitive |
Optional[bool]
|
If true, code comparisons are case sensitive. |
valueSet |
Optional[str]
|
Canonical reference to the value set. |
hierarchyMeaning |
Optional[str]
|
The meaning of the hierarchy of concepts. |
compositional |
Optional[bool]
|
If true, supports compositional grammar. |
versionNeeded |
Optional[bool]
|
If true, indicates if the version is needed. |
count |
Optional[int]
|
Total number of concepts defined. |
concept |
Optional[List[CodeSystemConcept]]
|
List of concepts defined in the code system. |
caseSensitive
class-attribute
instance-attribute
¶
compositional
class-attribute
instance-attribute
¶
concept
class-attribute
instance-attribute
¶
content
instance-attribute
¶
count
class-attribute
instance-attribute
¶
date
class-attribute
instance-attribute
¶
description
class-attribute
instance-attribute
¶
experimental
class-attribute
instance-attribute
¶
hierarchyMeaning
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
name
class-attribute
instance-attribute
¶
publisher
class-attribute
instance-attribute
¶
resourceType
class-attribute
instance-attribute
¶
status
instance-attribute
¶
url
class-attribute
instance-attribute
¶
valueSet
class-attribute
instance-attribute
¶
version
class-attribute
instance-attribute
¶
versionNeeded
class-attribute
instance-attribute
¶
CodeSystemConcept
¶
Bases: BaseModel
Represents a concept within a FHIR CodeSystem resource.
Attributes:
Name | Type | Description |
---|---|---|
code |
str
|
The code that identifies the concept. |
display |
Optional[str]
|
A human-readable string for the concept. |
definition |
Optional[str]
|
A formal definition of the concept. |
designation |
Optional[List[CodeSystemConceptDesignation]]
|
Additional designations for the concept. |
property |
Optional[List[CodeSystemConceptProperty]]
|
Properties associated with the concept. |
concept |
Optional[List[Any]]
|
Nested concepts, allowing for recursive concept hierarchies. |
CodeSystemConceptDesignation
¶
Bases: BaseModel
Represents a designation for a concept within a code system.
Attributes:
Name | Type | Description |
---|---|---|
language |
Optional[str]
|
The language in which the designation is expressed. |
use |
Optional[Coding]
|
The type of designation (e.g., synonym, preferred term). |
value |
str
|
The actual text of the designation. |
CodeSystemConceptProperty
¶
Bases: BaseModel
Represents a property of a concept within a FHIR CodeSystem.
Attributes:
Name | Type | Description |
---|---|---|
code |
str
|
The property code that identifies the type of property. |
valueCode |
Optional[str]
|
A coded value for the property, if applicable. |
valueCoding |
Optional[Coding]
|
A Coding object representing the property value. |
valueString |
Optional[str]
|
A string value for the property. |
valueInteger |
Optional[int]
|
An integer value for the property. |
valueBoolean |
Optional[bool]
|
A boolean value for the property. |
valueDateTime |
Optional[str]
|
A date-time value for the property, represented as a string. |
valueDecimal |
Optional[float]
|
A decimal value for the property. |
code
instance-attribute
¶
valueBoolean
class-attribute
instance-attribute
¶
valueCode
class-attribute
instance-attribute
¶
valueCoding
class-attribute
instance-attribute
¶
valueDateTime
class-attribute
instance-attribute
¶
valueDecimal
class-attribute
instance-attribute
¶
valueInteger
class-attribute
instance-attribute
¶
valueString
class-attribute
instance-attribute
¶
Coding
¶
Bases: BaseModel
Represents a FHIR Coding element, which specifies a coded value from a terminology system.
Attributes:
Name | Type | Description |
---|---|---|
system |
Optional[str]
|
The identification of the code system that defines the meaning of the symbol. |
version |
Optional[str]
|
The version of the code system which was used when choosing this code. |
code |
Optional[str]
|
The actual code defined by the code system. |
display |
Optional[str]
|
A human-readable representation of the code. |
userSelected |
Optional[bool]
|
Indicates that this coding was chosen directly by the user. |
ValueSet
¶
Bases: BaseModel
Represents a FHIR ValueSet resource.
Attributes:
Name | Type | Description |
---|---|---|
resourceType |
Literal['ValueSet']
|
The type of the resource, always "ValueSet". |
id |
Optional[str]
|
Logical id of the resource. |
url |
Optional[str]
|
Canonical identifier for the ValueSet. |
version |
Optional[str]
|
Business version of the ValueSet. |
name |
Optional[str]
|
Name for this ValueSet (computer friendly). |
status |
Optional[str]
|
Status of the ValueSet (e.g., draft, active, retired). |
experimental |
Optional[bool]
|
Indicates if the ValueSet is experimental. |
date |
Optional[str]
|
Date when the ValueSet was published. |
publisher |
Optional[str]
|
Name of the publisher. |
description |
Optional[str]
|
Natural language description of the ValueSet. |
immutable |
Optional[bool]
|
Indicates if the ValueSet is immutable. |
compose |
Optional[ValueSetCompose]
|
Criteria for selecting codes for the ValueSet. |
expansion |
Optional[ValueSetExpansion]
|
Expansion of the ValueSet for use. |
compose
class-attribute
instance-attribute
¶
date
class-attribute
instance-attribute
¶
description
class-attribute
instance-attribute
¶
expansion
class-attribute
instance-attribute
¶
experimental
class-attribute
instance-attribute
¶
id
class-attribute
instance-attribute
¶
immutable
class-attribute
instance-attribute
¶
name
class-attribute
instance-attribute
¶
publisher
class-attribute
instance-attribute
¶
resourceType
class-attribute
instance-attribute
¶
status
class-attribute
instance-attribute
¶
url
class-attribute
instance-attribute
¶
version
class-attribute
instance-attribute
¶
ValueSetCompose
¶
Bases: BaseModel
Represents the 'compose' element of a FHIR ValueSet resource.
Attributes:
Name | Type | Description |
---|---|---|
lockedDate |
Optional[str]
|
The date that the composition was locked. No further changes to the content are permitted after this date. |
inactive |
Optional[bool]
|
If true, indicates that inactive concepts are included in the ValueSet. |
include |
List[ValueSetComposeInclude]
|
A list of criteria for concepts or codes to be included in the ValueSet. |
exclude |
Optional[List[ValueSetComposeInclude]]
|
A list of criteria for concepts or codes to be excluded from the ValueSet. |
ValueSetComposeInclude
¶
Bases: BaseModel
Represents the 'include' element of a FHIR ValueSet compose definition.
Attributes:
Name | Type | Description |
---|---|---|
system |
Optional[str]
|
The URI of the code system from which codes are included. |
version |
Optional[str]
|
The version of the code system to use. |
concept |
Optional[List[ValueSetComposeIncludeConcept]]
|
Specific concepts to be included from the code system. |
filter |
Optional[List[ValueSetComposeIncludeFilter]]
|
Filters to select codes to be included. |
valueSet |
Optional[List[str]]
|
References to other value sets whose codes should be included. |
ValueSetComposeIncludeConcept
¶
Bases: BaseModel
Represents a concept to be included in a FHIR ValueSet compose include.
Attributes:
Name | Type | Description |
---|---|---|
code |
str
|
The code identifying the concept. |
display |
Optional[str]
|
A human-readable representation of the concept. |
designation |
Optional[List[ValueSetComposeIncludeConceptDesignation]]
|
Additional designations for the concept, such as language-specific names. |
ValueSetComposeIncludeConceptDesignation
¶
Bases: BaseModel
Represents a designation for a concept within a ValueSet compose include.
Attributes:
Name | Type | Description |
---|---|---|
language |
Optional[str]
|
The language in which the designation is expressed. |
use |
Optional[Any]
|
The coding that specifies the use or purpose of the designation. |
value |
str
|
The text value of the designation. |
ValueSetComposeIncludeFilter
¶
Bases: BaseModel
Represents a filter for including concepts in a FHIR ValueSet compose element.
Attributes:
Name | Type | Description |
---|---|---|
property |
str
|
The property to filter on (e.g., code, system, display). |
op |
str
|
The operation to apply for filtering (e.g., '=', 'in', 'exists'). |
value |
str
|
The value to compare against the property. |
ValueSetExpansion
¶
Bases: BaseModel
Represents the expansion of a FHIR ValueSet, including metadata and the expanded concepts.
Attributes:
Name | Type | Description |
---|---|---|
identifier |
Optional[str]
|
Unique identifier for the expansion instance. |
timestamp |
Optional[str]
|
Timestamp when the expansion was generated. |
total |
Optional[int]
|
Total number of concepts in the expansion. |
offset |
Optional[int]
|
Offset for paging through the expansion results. |
parameter |
Optional[List[ValueSetExpansionParameter]]
|
Parameters used during the expansion. |
contains |
Optional[List[ValueSetExpansionContains]]
|
List of concepts included in the expansion. |
ValueSetExpansionContains
¶
Bases: BaseModel
Represents an element within a FHIR ValueSet expansion's 'contains' array.
Attributes:
Name | Type | Description |
---|---|---|
system |
Optional[str]
|
The system URI that defines the code. |
abstract |
Optional[bool]
|
Indicates if the code is abstract (not selectable). |
inactive |
Optional[bool]
|
Indicates if the code is inactive. |
version |
Optional[str]
|
The version of the code system. |
code |
Optional[str]
|
The code value. |
display |
Optional[str]
|
The human-readable display for the code. |
contains |
Optional[List[Any]]
|
Nested list of further contained codes (recursive structure). |
abstract
class-attribute
instance-attribute
¶
code
class-attribute
instance-attribute
¶
contains
class-attribute
instance-attribute
¶
display
class-attribute
instance-attribute
¶
inactive
class-attribute
instance-attribute
¶
system
class-attribute
instance-attribute
¶
version
class-attribute
instance-attribute
¶
ValueSetExpansionParameter
¶
Bases: BaseModel
Represents a parameter used in the expansion of a FHIR ValueSet.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the parameter. |
valueString |
Optional[str]
|
The string value of the parameter, if applicable. |
valueBoolean |
Optional[bool]
|
The boolean value of the parameter, if applicable. |
valueInteger |
Optional[int]
|
The integer value of the parameter, if applicable. |
valueDecimal |
Optional[float]
|
The decimal value of the parameter, if applicable. |
valueUri |
Optional[str]
|
The URI value of the parameter, if applicable. |
valueCode |
Optional[str]
|
The code value of the parameter, if applicable. |