phenostore-sdk-python 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phenostore/__init__.py +26 -0
- phenostore/_auth.py +94 -0
- phenostore/client.py +276 -0
- phenostore/errors.py +93 -0
- phenostore/gen/__init__.py +8 -0
- phenostore/gen/api/__init__.py +1 -0
- phenostore/gen/api/bulk/__init__.py +1 -0
- phenostore/gen/api/bulk/get_bulk_status.py +194 -0
- phenostore/gen/api/bulk/submit_bulk.py +223 -0
- phenostore/gen/api/fhir/__init__.py +1 -0
- phenostore/gen/api/fhir/conditional_delete_resource.py +277 -0
- phenostore/gen/api/fhir/create_resource.py +257 -0
- phenostore/gen/api/fhir/delete_resource.py +212 -0
- phenostore/gen/api/fhir/get_docref.py +281 -0
- phenostore/gen/api/fhir/get_metadata.py +185 -0
- phenostore/gen/api/fhir/get_resource_history.py +240 -0
- phenostore/gen/api/fhir/get_smart_configuration.py +169 -0
- phenostore/gen/api/fhir/patch_resource.py +282 -0
- phenostore/gen/api/fhir/post_docref.py +200 -0
- phenostore/gen/api/fhir/process_bundle.py +201 -0
- phenostore/gen/api/fhir/read_resource.py +214 -0
- phenostore/gen/api/fhir/read_resource_version.py +228 -0
- phenostore/gen/api/fhir/search_resources.py +390 -0
- phenostore/gen/api/fhir/search_resources_post.py +228 -0
- phenostore/gen/api/fhir/update_resource.py +281 -0
- phenostore/gen/api/fhir/validate_resource.py +217 -0
- phenostore/gen/api/o_auth/__init__.py +1 -0
- phenostore/gen/api/o_auth/issue_token.py +186 -0
- phenostore/gen/api/system/__init__.py +1 -0
- phenostore/gen/api/system/get_health.py +128 -0
- phenostore/gen/client.py +280 -0
- phenostore/gen/errors.py +16 -0
- phenostore/gen/models/__init__.py +71 -0
- phenostore/gen/models/bulk_operation_accepted.py +79 -0
- phenostore/gen/models/bulk_operation_accepted_status.py +8 -0
- phenostore/gen/models/bulk_operation_status.py +122 -0
- phenostore/gen/models/bulk_operation_status_code.py +11 -0
- phenostore/gen/models/bundle.py +132 -0
- phenostore/gen/models/bundle_entry.py +128 -0
- phenostore/gen/models/bundle_entry_request.py +70 -0
- phenostore/gen/models/bundle_entry_response.py +97 -0
- phenostore/gen/models/bundle_entry_search.py +69 -0
- phenostore/gen/models/bundle_entry_search_mode.py +9 -0
- phenostore/gen/models/bundle_link.py +69 -0
- phenostore/gen/models/bundle_resource_type.py +8 -0
- phenostore/gen/models/bundle_type.py +11 -0
- phenostore/gen/models/fhir_resource.py +47 -0
- phenostore/gen/models/health_response.py +63 -0
- phenostore/gen/models/health_response_status.py +8 -0
- phenostore/gen/models/issue_severity.py +11 -0
- phenostore/gen/models/issue_token_body.py +91 -0
- phenostore/gen/models/issue_token_body_grant_type.py +8 -0
- phenostore/gen/models/json_patch_item.py +90 -0
- phenostore/gen/models/json_patch_op.py +13 -0
- phenostore/gen/models/o_auth_error.py +69 -0
- phenostore/gen/models/operation_outcome.py +85 -0
- phenostore/gen/models/operation_outcome_issue.py +92 -0
- phenostore/gen/models/operation_outcome_resource_type.py +8 -0
- phenostore/gen/models/post_docref_body.py +124 -0
- phenostore/gen/models/resource_type.py +47 -0
- phenostore/gen/models/search_resources_post_body.py +155 -0
- phenostore/gen/models/search_summary_mode.py +12 -0
- phenostore/gen/models/search_total_mode.py +10 -0
- phenostore/gen/models/smart_configuration.py +111 -0
- phenostore/gen/models/token_response.py +87 -0
- phenostore/gen/models/token_response_token_type.py +8 -0
- phenostore/gen/types.py +54 -0
- phenostore/py.typed +0 -0
- phenostore_sdk_python-0.1.1.dist-info/METADATA +196 -0
- phenostore_sdk_python-0.1.1.dist-info/RECORD +72 -0
- phenostore_sdk_python-0.1.1.dist-info/WHEEL +4 -0
- phenostore_sdk_python-0.1.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="BundleLink")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class BundleLink:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
relation (str):
|
|
17
|
+
url (str):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
relation: str
|
|
21
|
+
url: str
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
relation = self.relation
|
|
26
|
+
|
|
27
|
+
url = self.url
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"relation": relation,
|
|
34
|
+
"url": url,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
relation = d.pop("relation")
|
|
44
|
+
|
|
45
|
+
url = d.pop("url")
|
|
46
|
+
|
|
47
|
+
bundle_link = cls(
|
|
48
|
+
relation=relation,
|
|
49
|
+
url=url,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
bundle_link.additional_properties = d
|
|
53
|
+
return bundle_link
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="FhirResource")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class FhirResource:
|
|
14
|
+
"""An arbitrary FHIR resource stored as raw JSON."""
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
17
|
+
|
|
18
|
+
def to_dict(self) -> dict[str, Any]:
|
|
19
|
+
|
|
20
|
+
field_dict: dict[str, Any] = {}
|
|
21
|
+
field_dict.update(self.additional_properties)
|
|
22
|
+
|
|
23
|
+
return field_dict
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
27
|
+
d = dict(src_dict)
|
|
28
|
+
fhir_resource = cls()
|
|
29
|
+
|
|
30
|
+
fhir_resource.additional_properties = d
|
|
31
|
+
return fhir_resource
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def additional_keys(self) -> list[str]:
|
|
35
|
+
return list(self.additional_properties.keys())
|
|
36
|
+
|
|
37
|
+
def __getitem__(self, key: str) -> Any:
|
|
38
|
+
return self.additional_properties[key]
|
|
39
|
+
|
|
40
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
41
|
+
self.additional_properties[key] = value
|
|
42
|
+
|
|
43
|
+
def __delitem__(self, key: str) -> None:
|
|
44
|
+
del self.additional_properties[key]
|
|
45
|
+
|
|
46
|
+
def __contains__(self, key: str) -> bool:
|
|
47
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.health_response_status import HealthResponseStatus
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="HealthResponse")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class HealthResponse:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
status (HealthResponseStatus):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
status: HealthResponseStatus
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
status = self.status.value
|
|
26
|
+
|
|
27
|
+
field_dict: dict[str, Any] = {}
|
|
28
|
+
field_dict.update(self.additional_properties)
|
|
29
|
+
field_dict.update(
|
|
30
|
+
{
|
|
31
|
+
"status": status,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
return field_dict
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
39
|
+
d = dict(src_dict)
|
|
40
|
+
status = HealthResponseStatus(d.pop("status"))
|
|
41
|
+
|
|
42
|
+
health_response = cls(
|
|
43
|
+
status=status,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
health_response.additional_properties = d
|
|
47
|
+
return health_response
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def additional_keys(self) -> list[str]:
|
|
51
|
+
return list(self.additional_properties.keys())
|
|
52
|
+
|
|
53
|
+
def __getitem__(self, key: str) -> Any:
|
|
54
|
+
return self.additional_properties[key]
|
|
55
|
+
|
|
56
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
57
|
+
self.additional_properties[key] = value
|
|
58
|
+
|
|
59
|
+
def __delitem__(self, key: str) -> None:
|
|
60
|
+
del self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __contains__(self, key: str) -> bool:
|
|
63
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.issue_token_body_grant_type import IssueTokenBodyGrantType
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="IssueTokenBody")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class IssueTokenBody:
|
|
17
|
+
"""
|
|
18
|
+
Attributes:
|
|
19
|
+
grant_type (IssueTokenBodyGrantType):
|
|
20
|
+
client_id (str | Unset): Required when credentials are not sent via HTTP Basic auth.
|
|
21
|
+
client_secret (str | Unset): Required when credentials are not sent via HTTP Basic auth.
|
|
22
|
+
scope (str | Unset): Space-delimited list of requested scopes (subset of granted permissions)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
grant_type: IssueTokenBodyGrantType
|
|
26
|
+
client_id: str | Unset = UNSET
|
|
27
|
+
client_secret: str | Unset = UNSET
|
|
28
|
+
scope: str | Unset = UNSET
|
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
30
|
+
|
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
|
32
|
+
grant_type = self.grant_type.value
|
|
33
|
+
|
|
34
|
+
client_id = self.client_id
|
|
35
|
+
|
|
36
|
+
client_secret = self.client_secret
|
|
37
|
+
|
|
38
|
+
scope = self.scope
|
|
39
|
+
|
|
40
|
+
field_dict: dict[str, Any] = {}
|
|
41
|
+
field_dict.update(self.additional_properties)
|
|
42
|
+
field_dict.update(
|
|
43
|
+
{
|
|
44
|
+
"grant_type": grant_type,
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
if client_id is not UNSET:
|
|
48
|
+
field_dict["client_id"] = client_id
|
|
49
|
+
if client_secret is not UNSET:
|
|
50
|
+
field_dict["client_secret"] = client_secret
|
|
51
|
+
if scope is not UNSET:
|
|
52
|
+
field_dict["scope"] = scope
|
|
53
|
+
|
|
54
|
+
return field_dict
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
58
|
+
d = dict(src_dict)
|
|
59
|
+
grant_type = IssueTokenBodyGrantType(d.pop("grant_type"))
|
|
60
|
+
|
|
61
|
+
client_id = d.pop("client_id", UNSET)
|
|
62
|
+
|
|
63
|
+
client_secret = d.pop("client_secret", UNSET)
|
|
64
|
+
|
|
65
|
+
scope = d.pop("scope", UNSET)
|
|
66
|
+
|
|
67
|
+
issue_token_body = cls(
|
|
68
|
+
grant_type=grant_type,
|
|
69
|
+
client_id=client_id,
|
|
70
|
+
client_secret=client_secret,
|
|
71
|
+
scope=scope,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
issue_token_body.additional_properties = d
|
|
75
|
+
return issue_token_body
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def additional_keys(self) -> list[str]:
|
|
79
|
+
return list(self.additional_properties.keys())
|
|
80
|
+
|
|
81
|
+
def __getitem__(self, key: str) -> Any:
|
|
82
|
+
return self.additional_properties[key]
|
|
83
|
+
|
|
84
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
85
|
+
self.additional_properties[key] = value
|
|
86
|
+
|
|
87
|
+
def __delitem__(self, key: str) -> None:
|
|
88
|
+
del self.additional_properties[key]
|
|
89
|
+
|
|
90
|
+
def __contains__(self, key: str) -> bool:
|
|
91
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.json_patch_op import JsonPatchOp
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="JsonPatchItem")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class JsonPatchItem:
|
|
17
|
+
"""
|
|
18
|
+
Attributes:
|
|
19
|
+
op (JsonPatchOp): JSON Patch operation type (RFC 6902)
|
|
20
|
+
path (str):
|
|
21
|
+
value (Any | Unset):
|
|
22
|
+
from_ (str | Unset):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
op: JsonPatchOp
|
|
26
|
+
path: str
|
|
27
|
+
value: Any | Unset = UNSET
|
|
28
|
+
from_: str | Unset = UNSET
|
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
30
|
+
|
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
|
32
|
+
op = self.op.value
|
|
33
|
+
|
|
34
|
+
path = self.path
|
|
35
|
+
|
|
36
|
+
value = self.value
|
|
37
|
+
|
|
38
|
+
from_ = self.from_
|
|
39
|
+
|
|
40
|
+
field_dict: dict[str, Any] = {}
|
|
41
|
+
field_dict.update(self.additional_properties)
|
|
42
|
+
field_dict.update(
|
|
43
|
+
{
|
|
44
|
+
"op": op,
|
|
45
|
+
"path": path,
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
if value is not UNSET:
|
|
49
|
+
field_dict["value"] = value
|
|
50
|
+
if from_ is not UNSET:
|
|
51
|
+
field_dict["from"] = from_
|
|
52
|
+
|
|
53
|
+
return field_dict
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
57
|
+
d = dict(src_dict)
|
|
58
|
+
op = JsonPatchOp(d.pop("op"))
|
|
59
|
+
|
|
60
|
+
path = d.pop("path")
|
|
61
|
+
|
|
62
|
+
value = d.pop("value", UNSET)
|
|
63
|
+
|
|
64
|
+
from_ = d.pop("from", UNSET)
|
|
65
|
+
|
|
66
|
+
json_patch_item = cls(
|
|
67
|
+
op=op,
|
|
68
|
+
path=path,
|
|
69
|
+
value=value,
|
|
70
|
+
from_=from_,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
json_patch_item.additional_properties = d
|
|
74
|
+
return json_patch_item
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def additional_keys(self) -> list[str]:
|
|
78
|
+
return list(self.additional_properties.keys())
|
|
79
|
+
|
|
80
|
+
def __getitem__(self, key: str) -> Any:
|
|
81
|
+
return self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
84
|
+
self.additional_properties[key] = value
|
|
85
|
+
|
|
86
|
+
def __delitem__(self, key: str) -> None:
|
|
87
|
+
del self.additional_properties[key]
|
|
88
|
+
|
|
89
|
+
def __contains__(self, key: str) -> bool:
|
|
90
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="OAuthError")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class OAuthError:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
error (str): OAuth2 error code (RFC 6749)
|
|
17
|
+
error_description (str):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
error: str
|
|
21
|
+
error_description: str
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
error = self.error
|
|
26
|
+
|
|
27
|
+
error_description = self.error_description
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"error": error,
|
|
34
|
+
"error_description": error_description,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
error = d.pop("error")
|
|
44
|
+
|
|
45
|
+
error_description = d.pop("error_description")
|
|
46
|
+
|
|
47
|
+
o_auth_error = cls(
|
|
48
|
+
error=error,
|
|
49
|
+
error_description=error_description,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
o_auth_error.additional_properties = d
|
|
53
|
+
return o_auth_error
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.operation_outcome_resource_type import OperationOutcomeResourceType
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.operation_outcome_issue import OperationOutcomeIssue
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="OperationOutcome")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class OperationOutcome:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
resource_type (OperationOutcomeResourceType):
|
|
23
|
+
issue (list[OperationOutcomeIssue]):
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
resource_type: OperationOutcomeResourceType
|
|
27
|
+
issue: list[OperationOutcomeIssue]
|
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
resource_type = self.resource_type.value
|
|
32
|
+
|
|
33
|
+
issue = []
|
|
34
|
+
for issue_item_data in self.issue:
|
|
35
|
+
issue_item = issue_item_data.to_dict()
|
|
36
|
+
issue.append(issue_item)
|
|
37
|
+
|
|
38
|
+
field_dict: dict[str, Any] = {}
|
|
39
|
+
field_dict.update(self.additional_properties)
|
|
40
|
+
field_dict.update(
|
|
41
|
+
{
|
|
42
|
+
"resourceType": resource_type,
|
|
43
|
+
"issue": issue,
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
from ..models.operation_outcome_issue import OperationOutcomeIssue # noqa: PLC0415
|
|
52
|
+
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
resource_type = OperationOutcomeResourceType(d.pop("resourceType"))
|
|
55
|
+
|
|
56
|
+
issue = []
|
|
57
|
+
_issue = d.pop("issue")
|
|
58
|
+
for issue_item_data in _issue:
|
|
59
|
+
issue_item = OperationOutcomeIssue.from_dict(issue_item_data)
|
|
60
|
+
|
|
61
|
+
issue.append(issue_item)
|
|
62
|
+
|
|
63
|
+
operation_outcome = cls(
|
|
64
|
+
resource_type=resource_type,
|
|
65
|
+
issue=issue,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
operation_outcome.additional_properties = d
|
|
69
|
+
return operation_outcome
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def additional_keys(self) -> list[str]:
|
|
73
|
+
return list(self.additional_properties.keys())
|
|
74
|
+
|
|
75
|
+
def __getitem__(self, key: str) -> Any:
|
|
76
|
+
return self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
79
|
+
self.additional_properties[key] = value
|
|
80
|
+
|
|
81
|
+
def __delitem__(self, key: str) -> None:
|
|
82
|
+
del self.additional_properties[key]
|
|
83
|
+
|
|
84
|
+
def __contains__(self, key: str) -> bool:
|
|
85
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.issue_severity import IssueSeverity
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="OperationOutcomeIssue")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class OperationOutcomeIssue:
|
|
17
|
+
"""
|
|
18
|
+
Attributes:
|
|
19
|
+
severity (IssueSeverity): FHIR OperationOutcome issue severity
|
|
20
|
+
code (str): FHIR issue type code
|
|
21
|
+
diagnostics (str | Unset):
|
|
22
|
+
expression (list[str] | Unset):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
severity: IssueSeverity
|
|
26
|
+
code: str
|
|
27
|
+
diagnostics: str | Unset = UNSET
|
|
28
|
+
expression: list[str] | Unset = UNSET
|
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
30
|
+
|
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
|
32
|
+
severity = self.severity.value
|
|
33
|
+
|
|
34
|
+
code = self.code
|
|
35
|
+
|
|
36
|
+
diagnostics = self.diagnostics
|
|
37
|
+
|
|
38
|
+
expression: list[str] | Unset = UNSET
|
|
39
|
+
if not isinstance(self.expression, Unset):
|
|
40
|
+
expression = self.expression
|
|
41
|
+
|
|
42
|
+
field_dict: dict[str, Any] = {}
|
|
43
|
+
field_dict.update(self.additional_properties)
|
|
44
|
+
field_dict.update(
|
|
45
|
+
{
|
|
46
|
+
"severity": severity,
|
|
47
|
+
"code": code,
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
if diagnostics is not UNSET:
|
|
51
|
+
field_dict["diagnostics"] = diagnostics
|
|
52
|
+
if expression is not UNSET:
|
|
53
|
+
field_dict["expression"] = expression
|
|
54
|
+
|
|
55
|
+
return field_dict
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
severity = IssueSeverity(d.pop("severity"))
|
|
61
|
+
|
|
62
|
+
code = d.pop("code")
|
|
63
|
+
|
|
64
|
+
diagnostics = d.pop("diagnostics", UNSET)
|
|
65
|
+
|
|
66
|
+
expression = cast(list[str], d.pop("expression", UNSET))
|
|
67
|
+
|
|
68
|
+
operation_outcome_issue = cls(
|
|
69
|
+
severity=severity,
|
|
70
|
+
code=code,
|
|
71
|
+
diagnostics=diagnostics,
|
|
72
|
+
expression=expression,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
operation_outcome_issue.additional_properties = d
|
|
76
|
+
return operation_outcome_issue
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def additional_keys(self) -> list[str]:
|
|
80
|
+
return list(self.additional_properties.keys())
|
|
81
|
+
|
|
82
|
+
def __getitem__(self, key: str) -> Any:
|
|
83
|
+
return self.additional_properties[key]
|
|
84
|
+
|
|
85
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
86
|
+
self.additional_properties[key] = value
|
|
87
|
+
|
|
88
|
+
def __delitem__(self, key: str) -> None:
|
|
89
|
+
del self.additional_properties[key]
|
|
90
|
+
|
|
91
|
+
def __contains__(self, key: str) -> bool:
|
|
92
|
+
return key in self.additional_properties
|