rxfoundry.clients.swifty-api 0.0.680__py3-none-any.whl → 0.1.1005__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.
- rxfoundry/clients/swifty_api/__init__.py +37 -3
- rxfoundry/clients/swifty_api/api/__init__.py +3 -1
- rxfoundry/clients/swifty_api/api/async_api.py +2336 -52
- rxfoundry/clients/swifty_api/api/code_api.py +281 -0
- rxfoundry/clients/swifty_api/api/default_api.py +318 -0
- rxfoundry/clients/swifty_api/api/medication_api.py +647 -51
- rxfoundry/clients/swifty_api/api/patient_api.py +1126 -35
- rxfoundry/clients/swifty_api/api/pharmacist_api.py +24 -24
- rxfoundry/clients/swifty_api/api/pharmacy_api.py +48 -48
- rxfoundry/clients/swifty_api/api/prescriber_api.py +24 -24
- rxfoundry/clients/swifty_api/api/prescription_api.py +934 -130
- rxfoundry/clients/swifty_api/api/task_api.py +1835 -0
- rxfoundry/clients/swifty_api/api/tasks_api.py +374 -0
- rxfoundry/clients/swifty_api/api/validation_api.py +311 -0
- rxfoundry/clients/swifty_api/api/virtual_pharmacy_api.py +262 -0
- rxfoundry/clients/swifty_api/api/workflow_api.py +633 -0
- rxfoundry/clients/swifty_api/models/__init__.py +34 -2
- rxfoundry/clients/swifty_api/models/address.py +11 -10
- rxfoundry/clients/swifty_api/models/code_type.py +92 -0
- rxfoundry/clients/swifty_api/models/formulary.py +96 -0
- rxfoundry/clients/swifty_api/models/insurance.py +96 -0
- rxfoundry/clients/swifty_api/models/medication_instruction.py +92 -0
- rxfoundry/clients/swifty_api/models/medication_ref.py +100 -0
- rxfoundry/clients/swifty_api/models/patient.py +85 -2
- rxfoundry/clients/swifty_api/models/patient_activity_data.py +169 -0
- rxfoundry/clients/swifty_api/models/patient_activity_message.py +112 -0
- rxfoundry/clients/swifty_api/models/patient_activity_notification.py +9 -17
- rxfoundry/clients/swifty_api/models/patient_activity_notification_activity_data.py +39 -8
- rxfoundry/clients/swifty_api/models/patient_address_activity_notification.py +105 -0
- rxfoundry/clients/swifty_api/models/patient_address_data.py +25 -9
- rxfoundry/clients/swifty_api/models/patient_allergy.py +92 -0
- rxfoundry/clients/swifty_api/models/patient_condition.py +92 -0
- rxfoundry/clients/swifty_api/models/patient_data.py +13 -2
- rxfoundry/clients/swifty_api/models/patient_external_identifier.py +6 -5
- rxfoundry/clients/swifty_api/models/patient_health_profile_data.py +127 -0
- rxfoundry/clients/swifty_api/models/patient_insurance.py +106 -0
- rxfoundry/clients/swifty_api/models/patient_insurance_data.py +105 -0
- rxfoundry/clients/swifty_api/models/patient_medication.py +92 -0
- rxfoundry/clients/swifty_api/models/patient_name.py +99 -0
- rxfoundry/clients/swifty_api/models/patient_name_data.py +108 -0
- rxfoundry/clients/swifty_api/models/patient_phone_number.py +89 -0
- rxfoundry/clients/swifty_api/models/patient_phone_number_data.py +98 -0
- rxfoundry/clients/swifty_api/models/patient_task.py +115 -0
- rxfoundry/clients/swifty_api/models/patient_task_status.py +105 -0
- rxfoundry/clients/swifty_api/models/patient_task_type.py +45 -0
- rxfoundry/clients/swifty_api/models/prescription.py +35 -30
- rxfoundry/clients/swifty_api/models/prescription_change_request.py +24 -36
- rxfoundry/clients/swifty_api/models/prescription_change_request_and_response.py +145 -0
- rxfoundry/clients/swifty_api/models/prescription_change_request_response.py +134 -0
- rxfoundry/clients/swifty_api/models/prescription_data.py +126 -0
- rxfoundry/clients/swifty_api/models/prescription_message.py +100 -0
- rxfoundry/clients/swifty_api/models/prescription_message_task.py +109 -0
- rxfoundry/clients/swifty_api/models/prescription_message_task_status.py +99 -0
- rxfoundry/clients/swifty_api/models/prescription_message_task_type.py +43 -0
- rxfoundry/clients/swifty_api/models/prescription_message_type.py +53 -0
- rxfoundry/clients/swifty_api/models/prescription_patch.py +6 -2
- rxfoundry/clients/swifty_api/models/prescription_status_type.py +40 -0
- rxfoundry/clients/swifty_api/models/prescription_task.py +14 -12
- rxfoundry/clients/swifty_api/models/prescription_task_status.py +6 -2
- rxfoundry/clients/swifty_api/models/prescription_task_type.py +42 -0
- rxfoundry/clients/swifty_api/models/prescription_transfer_request_and_response.py +145 -0
- rxfoundry/clients/swifty_api/models/prescription_transfer_request_response.py +128 -0
- rxfoundry/clients/swifty_api/models/status_type.py +92 -0
- rxfoundry/clients/swifty_api/models/workflow.py +108 -0
- rxfoundry/clients/swifty_api/models/workflow_sub_task.py +96 -0
- rxfoundry/clients/swifty_api/models/workflow_sub_task_sub_task.py +155 -0
- rxfoundry/clients/swifty_api/models/workflow_task.py +111 -0
- rxfoundry/clients/swifty_api/models/workflow_task_task.py +155 -0
- rxfoundry/clients/swifty_api/models/workflow_type.py +55 -0
- {rxfoundry_clients_swifty_api-0.0.680.dist-info → rxfoundry_clients_swifty_api-0.1.1005.dist-info}/METADATA +1 -1
- rxfoundry_clients_swifty_api-0.1.1005.dist-info/RECORD +109 -0
- rxfoundry_clients_swifty_api-0.0.680.dist-info/RECORD +0 -64
- {rxfoundry_clients_swifty_api-0.0.680.dist-info → rxfoundry_clients_swifty_api-0.1.1005.dist-info}/WHEEL +0 -0
- {rxfoundry_clients_swifty_api-0.0.680.dist-info → rxfoundry_clients_swifty_api-0.1.1005.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
SwiftyRX API
|
|
5
|
+
|
|
6
|
+
API for the SwiftyRX Backend
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.DEV-0
|
|
9
|
+
Contact: paul.tindall@rxfoundry.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from rxfoundry.clients.swifty_api.models.workflow_task import WorkflowTask
|
|
25
|
+
from rxfoundry.clients.swifty_api.models.workflow_type import WorkflowType
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class Workflow(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
Workflow
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
uuid: Optional[StrictStr] = None
|
|
34
|
+
created_on: Optional[datetime] = None
|
|
35
|
+
workflow_type: Optional[WorkflowType] = None
|
|
36
|
+
is_completed: Optional[StrictBool] = None
|
|
37
|
+
completed_with_errors: Optional[StrictBool] = None
|
|
38
|
+
tasks: Optional[List[WorkflowTask]] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["uuid", "created_on", "workflow_type", "is_completed", "completed_with_errors", "tasks"]
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of Workflow from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of each item in tasks (list)
|
|
81
|
+
_items = []
|
|
82
|
+
if self.tasks:
|
|
83
|
+
for _item_tasks in self.tasks:
|
|
84
|
+
if _item_tasks:
|
|
85
|
+
_items.append(_item_tasks.to_dict())
|
|
86
|
+
_dict['tasks'] = _items
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of Workflow from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"uuid": obj.get("uuid"),
|
|
100
|
+
"created_on": obj.get("created_on"),
|
|
101
|
+
"workflow_type": obj.get("workflow_type"),
|
|
102
|
+
"is_completed": obj.get("is_completed"),
|
|
103
|
+
"completed_with_errors": obj.get("completed_with_errors"),
|
|
104
|
+
"tasks": [WorkflowTask.from_dict(_item) for _item in obj["tasks"]] if obj.get("tasks") is not None else None
|
|
105
|
+
})
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
SwiftyRX API
|
|
5
|
+
|
|
6
|
+
API for the SwiftyRX Backend
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.DEV-0
|
|
9
|
+
Contact: paul.tindall@rxfoundry.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from rxfoundry.clients.swifty_api.models.workflow_sub_task_sub_task import WorkflowSubTaskSubTask
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class WorkflowSubTask(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
WorkflowSubTask
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
uuid: Optional[StrictStr] = None
|
|
32
|
+
task_info: Optional[Dict[str, Any]] = None
|
|
33
|
+
sub_task: Optional[WorkflowSubTaskSubTask] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["uuid", "task_info", "sub_task"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of WorkflowSubTask from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of sub_task
|
|
76
|
+
if self.sub_task:
|
|
77
|
+
_dict['sub_task'] = self.sub_task.to_dict()
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of WorkflowSubTask from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate({
|
|
90
|
+
"uuid": obj.get("uuid"),
|
|
91
|
+
"task_info": obj.get("task_info"),
|
|
92
|
+
"sub_task": WorkflowSubTaskSubTask.from_dict(obj["sub_task"]) if obj.get("sub_task") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
SwiftyRX API
|
|
5
|
+
|
|
6
|
+
API for the SwiftyRX Backend
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.DEV-0
|
|
9
|
+
Contact: paul.tindall@rxfoundry.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
|
+
from typing import Any, List, Optional
|
|
21
|
+
from rxfoundry.clients.swifty_api.models.patient_task import PatientTask
|
|
22
|
+
from rxfoundry.clients.swifty_api.models.prescription_message_task import PrescriptionMessageTask
|
|
23
|
+
from rxfoundry.clients.swifty_api.models.prescription_task import PrescriptionTask
|
|
24
|
+
from pydantic import StrictStr, Field
|
|
25
|
+
from typing import Union, List, Set, Optional, Dict
|
|
26
|
+
from typing_extensions import Literal, Self
|
|
27
|
+
|
|
28
|
+
WORKFLOWSUBTASKSUBTASK_ONE_OF_SCHEMAS = ["PatientTask", "PrescriptionMessageTask", "PrescriptionTask"]
|
|
29
|
+
|
|
30
|
+
class WorkflowSubTaskSubTask(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
WorkflowSubTaskSubTask
|
|
33
|
+
"""
|
|
34
|
+
# data type: PatientTask
|
|
35
|
+
oneof_schema_1_validator: Optional[PatientTask] = None
|
|
36
|
+
# data type: PrescriptionTask
|
|
37
|
+
oneof_schema_2_validator: Optional[PrescriptionTask] = None
|
|
38
|
+
# data type: PrescriptionMessageTask
|
|
39
|
+
oneof_schema_3_validator: Optional[PrescriptionMessageTask] = None
|
|
40
|
+
actual_instance: Optional[Union[PatientTask, PrescriptionMessageTask, PrescriptionTask]] = None
|
|
41
|
+
one_of_schemas: Set[str] = { "PatientTask", "PrescriptionMessageTask", "PrescriptionTask" }
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
53
|
+
if args:
|
|
54
|
+
if len(args) > 1:
|
|
55
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
56
|
+
if kwargs:
|
|
57
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
58
|
+
super().__init__(actual_instance=args[0])
|
|
59
|
+
else:
|
|
60
|
+
super().__init__(**kwargs)
|
|
61
|
+
|
|
62
|
+
@field_validator('actual_instance')
|
|
63
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
64
|
+
instance = WorkflowSubTaskSubTask.model_construct()
|
|
65
|
+
error_messages = []
|
|
66
|
+
match = 0
|
|
67
|
+
# validate data type: PatientTask
|
|
68
|
+
if not isinstance(v, PatientTask):
|
|
69
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PatientTask`")
|
|
70
|
+
else:
|
|
71
|
+
match += 1
|
|
72
|
+
# validate data type: PrescriptionTask
|
|
73
|
+
if not isinstance(v, PrescriptionTask):
|
|
74
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PrescriptionTask`")
|
|
75
|
+
else:
|
|
76
|
+
match += 1
|
|
77
|
+
# validate data type: PrescriptionMessageTask
|
|
78
|
+
if not isinstance(v, PrescriptionMessageTask):
|
|
79
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PrescriptionMessageTask`")
|
|
80
|
+
else:
|
|
81
|
+
match += 1
|
|
82
|
+
if match > 1:
|
|
83
|
+
# more than 1 match
|
|
84
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in WorkflowSubTaskSubTask with oneOf schemas: PatientTask, PrescriptionMessageTask, PrescriptionTask. Details: " + ", ".join(error_messages))
|
|
85
|
+
elif match == 0:
|
|
86
|
+
# no match
|
|
87
|
+
raise ValueError("No match found when setting `actual_instance` in WorkflowSubTaskSubTask with oneOf schemas: PatientTask, PrescriptionMessageTask, PrescriptionTask. Details: " + ", ".join(error_messages))
|
|
88
|
+
else:
|
|
89
|
+
return v
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
93
|
+
return cls.from_json(json.dumps(obj))
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_json(cls, json_str: str) -> Self:
|
|
97
|
+
"""Returns the object represented by the json string"""
|
|
98
|
+
instance = cls.model_construct()
|
|
99
|
+
error_messages = []
|
|
100
|
+
match = 0
|
|
101
|
+
|
|
102
|
+
# deserialize data into PatientTask
|
|
103
|
+
try:
|
|
104
|
+
instance.actual_instance = PatientTask.from_json(json_str)
|
|
105
|
+
match += 1
|
|
106
|
+
except (ValidationError, ValueError) as e:
|
|
107
|
+
error_messages.append(str(e))
|
|
108
|
+
# deserialize data into PrescriptionTask
|
|
109
|
+
try:
|
|
110
|
+
instance.actual_instance = PrescriptionTask.from_json(json_str)
|
|
111
|
+
match += 1
|
|
112
|
+
except (ValidationError, ValueError) as e:
|
|
113
|
+
error_messages.append(str(e))
|
|
114
|
+
# deserialize data into PrescriptionMessageTask
|
|
115
|
+
try:
|
|
116
|
+
instance.actual_instance = PrescriptionMessageTask.from_json(json_str)
|
|
117
|
+
match += 1
|
|
118
|
+
except (ValidationError, ValueError) as e:
|
|
119
|
+
error_messages.append(str(e))
|
|
120
|
+
|
|
121
|
+
if match > 1:
|
|
122
|
+
# more than 1 match
|
|
123
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into WorkflowSubTaskSubTask with oneOf schemas: PatientTask, PrescriptionMessageTask, PrescriptionTask. Details: " + ", ".join(error_messages))
|
|
124
|
+
elif match == 0:
|
|
125
|
+
# no match
|
|
126
|
+
raise ValueError("No match found when deserializing the JSON string into WorkflowSubTaskSubTask with oneOf schemas: PatientTask, PrescriptionMessageTask, PrescriptionTask. Details: " + ", ".join(error_messages))
|
|
127
|
+
else:
|
|
128
|
+
return instance
|
|
129
|
+
|
|
130
|
+
def to_json(self) -> str:
|
|
131
|
+
"""Returns the JSON representation of the actual instance"""
|
|
132
|
+
if self.actual_instance is None:
|
|
133
|
+
return "null"
|
|
134
|
+
|
|
135
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
136
|
+
return self.actual_instance.to_json()
|
|
137
|
+
else:
|
|
138
|
+
return json.dumps(self.actual_instance)
|
|
139
|
+
|
|
140
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], PatientTask, PrescriptionMessageTask, PrescriptionTask]]:
|
|
141
|
+
"""Returns the dict representation of the actual instance"""
|
|
142
|
+
if self.actual_instance is None:
|
|
143
|
+
return None
|
|
144
|
+
|
|
145
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
146
|
+
return self.actual_instance.to_dict()
|
|
147
|
+
else:
|
|
148
|
+
# primitive type
|
|
149
|
+
return self.actual_instance
|
|
150
|
+
|
|
151
|
+
def to_str(self) -> str:
|
|
152
|
+
"""Returns the string representation of the actual instance"""
|
|
153
|
+
return pprint.pformat(self.model_dump())
|
|
154
|
+
|
|
155
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
SwiftyRX API
|
|
5
|
+
|
|
6
|
+
API for the SwiftyRX Backend
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.DEV-0
|
|
9
|
+
Contact: paul.tindall@rxfoundry.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from rxfoundry.clients.swifty_api.models.workflow_task_task import WorkflowTaskTask
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class WorkflowTask(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
WorkflowTask
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
uuid: Optional[StrictStr] = None
|
|
33
|
+
created_on: Optional[datetime] = None
|
|
34
|
+
task_status: Optional[StrictStr] = None
|
|
35
|
+
task_info: Optional[Dict[str, Any]] = None
|
|
36
|
+
task: Optional[WorkflowTaskTask] = None
|
|
37
|
+
__properties: ClassVar[List[str]] = ["uuid", "created_on", "task_status", "task_info", "task"]
|
|
38
|
+
|
|
39
|
+
@field_validator('task_status')
|
|
40
|
+
def task_status_validate_enum(cls, value):
|
|
41
|
+
"""Validates the enum"""
|
|
42
|
+
if value is None:
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
if value not in set(['COMPLETED', 'FAILED', 'RUNNING', 'SKIPPED']):
|
|
46
|
+
raise ValueError("must be one of enum values ('COMPLETED', 'FAILED', 'RUNNING', 'SKIPPED')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
63
|
+
return json.dumps(self.to_dict())
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
67
|
+
"""Create an instance of WorkflowTask from a JSON string"""
|
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
|
+
|
|
73
|
+
This has the following differences from calling pydantic's
|
|
74
|
+
`self.model_dump(by_alias=True)`:
|
|
75
|
+
|
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
|
77
|
+
were set at model initialization. Other fields with value `None`
|
|
78
|
+
are ignored.
|
|
79
|
+
"""
|
|
80
|
+
excluded_fields: Set[str] = set([
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of task
|
|
89
|
+
if self.task:
|
|
90
|
+
_dict['task'] = self.task.to_dict()
|
|
91
|
+
return _dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
95
|
+
"""Create an instance of WorkflowTask from a dict"""
|
|
96
|
+
if obj is None:
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
if not isinstance(obj, dict):
|
|
100
|
+
return cls.model_validate(obj)
|
|
101
|
+
|
|
102
|
+
_obj = cls.model_validate({
|
|
103
|
+
"uuid": obj.get("uuid"),
|
|
104
|
+
"created_on": obj.get("created_on"),
|
|
105
|
+
"task_status": obj.get("task_status"),
|
|
106
|
+
"task_info": obj.get("task_info"),
|
|
107
|
+
"task": WorkflowTaskTask.from_dict(obj["task"]) if obj.get("task") is not None else None
|
|
108
|
+
})
|
|
109
|
+
return _obj
|
|
110
|
+
|
|
111
|
+
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
SwiftyRX API
|
|
5
|
+
|
|
6
|
+
API for the SwiftyRX Backend
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.DEV-0
|
|
9
|
+
Contact: paul.tindall@rxfoundry.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
|
+
from typing import Any, List, Optional
|
|
21
|
+
from rxfoundry.clients.swifty_api.models.patient_task import PatientTask
|
|
22
|
+
from rxfoundry.clients.swifty_api.models.prescription_message_task import PrescriptionMessageTask
|
|
23
|
+
from rxfoundry.clients.swifty_api.models.prescription_task import PrescriptionTask
|
|
24
|
+
from pydantic import StrictStr, Field
|
|
25
|
+
from typing import Union, List, Set, Optional, Dict
|
|
26
|
+
from typing_extensions import Literal, Self
|
|
27
|
+
|
|
28
|
+
WORKFLOWTASKTASK_ONE_OF_SCHEMAS = ["PatientTask", "PrescriptionMessageTask", "PrescriptionTask"]
|
|
29
|
+
|
|
30
|
+
class WorkflowTaskTask(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
WorkflowTaskTask
|
|
33
|
+
"""
|
|
34
|
+
# data type: PatientTask
|
|
35
|
+
oneof_schema_1_validator: Optional[PatientTask] = None
|
|
36
|
+
# data type: PrescriptionTask
|
|
37
|
+
oneof_schema_2_validator: Optional[PrescriptionTask] = None
|
|
38
|
+
# data type: PrescriptionMessageTask
|
|
39
|
+
oneof_schema_3_validator: Optional[PrescriptionMessageTask] = None
|
|
40
|
+
actual_instance: Optional[Union[PatientTask, PrescriptionMessageTask, PrescriptionTask]] = None
|
|
41
|
+
one_of_schemas: Set[str] = { "PatientTask", "PrescriptionMessageTask", "PrescriptionTask" }
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
53
|
+
if args:
|
|
54
|
+
if len(args) > 1:
|
|
55
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
56
|
+
if kwargs:
|
|
57
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
58
|
+
super().__init__(actual_instance=args[0])
|
|
59
|
+
else:
|
|
60
|
+
super().__init__(**kwargs)
|
|
61
|
+
|
|
62
|
+
@field_validator('actual_instance')
|
|
63
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
64
|
+
instance = WorkflowTaskTask.model_construct()
|
|
65
|
+
error_messages = []
|
|
66
|
+
match = 0
|
|
67
|
+
# validate data type: PatientTask
|
|
68
|
+
if not isinstance(v, PatientTask):
|
|
69
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PatientTask`")
|
|
70
|
+
else:
|
|
71
|
+
match += 1
|
|
72
|
+
# validate data type: PrescriptionTask
|
|
73
|
+
if not isinstance(v, PrescriptionTask):
|
|
74
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PrescriptionTask`")
|
|
75
|
+
else:
|
|
76
|
+
match += 1
|
|
77
|
+
# validate data type: PrescriptionMessageTask
|
|
78
|
+
if not isinstance(v, PrescriptionMessageTask):
|
|
79
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PrescriptionMessageTask`")
|
|
80
|
+
else:
|
|
81
|
+
match += 1
|
|
82
|
+
if match > 1:
|
|
83
|
+
# more than 1 match
|
|
84
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in WorkflowTaskTask with oneOf schemas: PatientTask, PrescriptionMessageTask, PrescriptionTask. Details: " + ", ".join(error_messages))
|
|
85
|
+
elif match == 0:
|
|
86
|
+
# no match
|
|
87
|
+
raise ValueError("No match found when setting `actual_instance` in WorkflowTaskTask with oneOf schemas: PatientTask, PrescriptionMessageTask, PrescriptionTask. Details: " + ", ".join(error_messages))
|
|
88
|
+
else:
|
|
89
|
+
return v
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
93
|
+
return cls.from_json(json.dumps(obj))
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_json(cls, json_str: str) -> Self:
|
|
97
|
+
"""Returns the object represented by the json string"""
|
|
98
|
+
instance = cls.model_construct()
|
|
99
|
+
error_messages = []
|
|
100
|
+
match = 0
|
|
101
|
+
|
|
102
|
+
# deserialize data into PatientTask
|
|
103
|
+
try:
|
|
104
|
+
instance.actual_instance = PatientTask.from_json(json_str)
|
|
105
|
+
match += 1
|
|
106
|
+
except (ValidationError, ValueError) as e:
|
|
107
|
+
error_messages.append(str(e))
|
|
108
|
+
# deserialize data into PrescriptionTask
|
|
109
|
+
try:
|
|
110
|
+
instance.actual_instance = PrescriptionTask.from_json(json_str)
|
|
111
|
+
match += 1
|
|
112
|
+
except (ValidationError, ValueError) as e:
|
|
113
|
+
error_messages.append(str(e))
|
|
114
|
+
# deserialize data into PrescriptionMessageTask
|
|
115
|
+
try:
|
|
116
|
+
instance.actual_instance = PrescriptionMessageTask.from_json(json_str)
|
|
117
|
+
match += 1
|
|
118
|
+
except (ValidationError, ValueError) as e:
|
|
119
|
+
error_messages.append(str(e))
|
|
120
|
+
|
|
121
|
+
if match > 1:
|
|
122
|
+
# more than 1 match
|
|
123
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into WorkflowTaskTask with oneOf schemas: PatientTask, PrescriptionMessageTask, PrescriptionTask. Details: " + ", ".join(error_messages))
|
|
124
|
+
elif match == 0:
|
|
125
|
+
# no match
|
|
126
|
+
raise ValueError("No match found when deserializing the JSON string into WorkflowTaskTask with oneOf schemas: PatientTask, PrescriptionMessageTask, PrescriptionTask. Details: " + ", ".join(error_messages))
|
|
127
|
+
else:
|
|
128
|
+
return instance
|
|
129
|
+
|
|
130
|
+
def to_json(self) -> str:
|
|
131
|
+
"""Returns the JSON representation of the actual instance"""
|
|
132
|
+
if self.actual_instance is None:
|
|
133
|
+
return "null"
|
|
134
|
+
|
|
135
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
136
|
+
return self.actual_instance.to_json()
|
|
137
|
+
else:
|
|
138
|
+
return json.dumps(self.actual_instance)
|
|
139
|
+
|
|
140
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], PatientTask, PrescriptionMessageTask, PrescriptionTask]]:
|
|
141
|
+
"""Returns the dict representation of the actual instance"""
|
|
142
|
+
if self.actual_instance is None:
|
|
143
|
+
return None
|
|
144
|
+
|
|
145
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
146
|
+
return self.actual_instance.to_dict()
|
|
147
|
+
else:
|
|
148
|
+
# primitive type
|
|
149
|
+
return self.actual_instance
|
|
150
|
+
|
|
151
|
+
def to_str(self) -> str:
|
|
152
|
+
"""Returns the string representation of the actual instance"""
|
|
153
|
+
return pprint.pformat(self.model_dump())
|
|
154
|
+
|
|
155
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
SwiftyRX API
|
|
5
|
+
|
|
6
|
+
API for the SwiftyRX Backend
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.1.DEV-0
|
|
9
|
+
Contact: paul.tindall@rxfoundry.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class WorkflowType(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
WorkflowType
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
RXCHANGEREQUEST = 'RxChangeRequest'
|
|
31
|
+
RX_TRANSFER_REQUEST_OUT = 'RxTransferRequest_Out'
|
|
32
|
+
SURESCRIPTS_NEW_RX = 'Surescripts_NewRx'
|
|
33
|
+
SURESCRIPTS_RX_TRANSFER_IN = 'Surescripts_RxTransfer_In'
|
|
34
|
+
SURESCRIPTS_RX_TRANSFER_OUT = 'Surescripts_RxTransfer_Out'
|
|
35
|
+
SWIFTY_DIRECT_NEW_RX = 'SwiftyDirect_NewRx'
|
|
36
|
+
SWIFTY_DIRECT_RX_TRANSFER_IN = 'SwiftyDirect_RxTransfer_In'
|
|
37
|
+
FAX_DOWNLOAD = 'fax_download'
|
|
38
|
+
FAX_IMPORT = 'fax_import'
|
|
39
|
+
PATIENT_ADDRESS_NEW = 'patient_address_new'
|
|
40
|
+
PATIENT_ADDRESS_EDIT = 'patient_address_edit'
|
|
41
|
+
PATIENT_ADDRESS_DELETE = 'patient_address_delete'
|
|
42
|
+
PATIENT_DATA_NEW = 'patient_data_new'
|
|
43
|
+
PATIENT_DATA_EDIT = 'patient_data_edit'
|
|
44
|
+
PATIENT_INSURANCE_NEW = 'patient_insurance_new'
|
|
45
|
+
PATIENT_INSURANCE_EDIT = 'patient_insurance_edit'
|
|
46
|
+
PATIENT_INSURANCE_DELETE = 'patient_insurance_delete'
|
|
47
|
+
PATIENT_HEALTH_PROFILE = 'patient_health_profile'
|
|
48
|
+
RX_EDIT = 'rx_edit'
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Self:
|
|
52
|
+
"""Create an instance of WorkflowType from a JSON string"""
|
|
53
|
+
return cls(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
|