rxfoundry.clients.swifty-api 0.0.652__py3-none-any.whl → 0.1.1009__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 +38 -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 +1429 -49
- 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 +35 -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/create_patient_request.py +98 -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 +88 -3
- 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 +26 -10
- 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.652.dist-info → rxfoundry_clients_swifty_api-0.1.1009.dist-info}/METADATA +1 -1
- rxfoundry_clients_swifty_api-0.1.1009.dist-info/RECORD +110 -0
- {rxfoundry_clients_swifty_api-0.0.652.dist-info → rxfoundry_clients_swifty_api-0.1.1009.dist-info}/WHEEL +1 -1
- rxfoundry_clients_swifty_api-0.0.652.dist-info/RECORD +0 -64
- {rxfoundry_clients_swifty_api-0.0.652.dist-info → rxfoundry_clients_swifty_api-0.1.1009.dist-info}/top_level.txt +0 -0
|
@@ -18,8 +18,9 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from typing_extensions import Annotated
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -27,13 +28,24 @@ class PatientAddressData(BaseModel):
|
|
|
27
28
|
"""
|
|
28
29
|
PatientAddressData
|
|
29
30
|
""" # noqa: E501
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
object_type: StrictStr = Field(description="The discriminator used to determine the type of the object. This is required for the discriminator to work correctly")
|
|
32
|
+
uuid: Optional[StrictStr] = Field(default=None, description="The uuid of the address for updates and deletes. If passed in on create, then it is ignored.")
|
|
33
|
+
address_line_one: Annotated[str, Field(strict=True, max_length=255)] = Field(description="The first line of the address")
|
|
34
|
+
address_line_two: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The second line of the address")
|
|
35
|
+
city: Annotated[str, Field(strict=True, max_length=50)] = Field(description="The city")
|
|
36
|
+
state_province: Annotated[str, Field(strict=True, max_length=50)] = Field(description="The state or province using the two alphabetic character abbreviation (e.g. TX, CA, NY)")
|
|
37
|
+
postal_code: Annotated[str, Field(strict=True, max_length=50)] = Field(description="The postal code in 5 digit format")
|
|
38
|
+
country_code: Annotated[str, Field(strict=True, max_length=50)] = Field(description="The country code using the two alphabetic character abbreviation (e.g. US, CA, GB)")
|
|
39
|
+
latitude: Optional[Union[Annotated[float, Field(strict=True)], Annotated[int, Field(strict=True)]]] = Field(default=None, description="The latitude of the address")
|
|
40
|
+
longitude: Optional[Union[Annotated[float, Field(strict=True)], Annotated[int, Field(strict=True)]]] = Field(default=None, description="The longitude of the address")
|
|
41
|
+
__properties: ClassVar[List[str]] = ["object_type", "uuid", "address_line_one", "address_line_two", "city", "state_province", "postal_code", "country_code", "latitude", "longitude"]
|
|
42
|
+
|
|
43
|
+
@field_validator('object_type')
|
|
44
|
+
def object_type_validate_enum(cls, value):
|
|
45
|
+
"""Validates the enum"""
|
|
46
|
+
if value not in set(['address']):
|
|
47
|
+
raise ValueError("must be one of enum values ('address')")
|
|
48
|
+
return value
|
|
37
49
|
|
|
38
50
|
model_config = ConfigDict(
|
|
39
51
|
populate_by_name=True,
|
|
@@ -86,12 +98,16 @@ class PatientAddressData(BaseModel):
|
|
|
86
98
|
return cls.model_validate(obj)
|
|
87
99
|
|
|
88
100
|
_obj = cls.model_validate({
|
|
101
|
+
"object_type": obj.get("object_type"),
|
|
102
|
+
"uuid": obj.get("uuid"),
|
|
89
103
|
"address_line_one": obj.get("address_line_one"),
|
|
90
104
|
"address_line_two": obj.get("address_line_two"),
|
|
91
105
|
"city": obj.get("city"),
|
|
92
106
|
"state_province": obj.get("state_province"),
|
|
93
107
|
"postal_code": obj.get("postal_code"),
|
|
94
|
-
"country_code": obj.get("country_code")
|
|
108
|
+
"country_code": obj.get("country_code"),
|
|
109
|
+
"latitude": obj.get("latitude"),
|
|
110
|
+
"longitude": obj.get("longitude")
|
|
95
111
|
})
|
|
96
112
|
return _obj
|
|
97
113
|
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from rxfoundry.clients.swifty_api.models.code import Code
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PatientAllergy(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PatientAllergy
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
allergy: Optional[Code] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["allergy"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of PatientAllergy from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of allergy
|
|
74
|
+
if self.allergy:
|
|
75
|
+
_dict['allergy'] = self.allergy.to_dict()
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of PatientAllergy from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"allergy": Code.from_dict(obj["allergy"]) if obj.get("allergy") is not None else None
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from rxfoundry.clients.swifty_api.models.code import Code
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class PatientCondition(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PatientCondition
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
condition: Optional[Code] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["condition"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of PatientCondition from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of condition
|
|
74
|
+
if self.condition:
|
|
75
|
+
_dict['condition'] = self.condition.to_dict()
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of PatientCondition from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"condition": Code.from_dict(obj["condition"]) if obj.get("condition") is not None else None
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -28,6 +28,7 @@ class PatientData(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
A patient's data that is used to manage a patient record within Swifty
|
|
30
30
|
""" # noqa: E501
|
|
31
|
+
object_type: StrictStr = Field(description="The discriminator used to determine the type of the object. This is required for the discriminator to work correctly.")
|
|
31
32
|
last_name: StrictStr = Field(description="The patient's last name")
|
|
32
33
|
first_name: StrictStr = Field(description="The patient's first name")
|
|
33
34
|
middle_name: Optional[StrictStr] = Field(default=None, description="The patient's middle name")
|
|
@@ -38,7 +39,15 @@ class PatientData(BaseModel):
|
|
|
38
39
|
primary_phone: StrictStr = Field(description="The patient's primary phone number. This could be a mobile phone number or a landline phone number. The format is a string based upon US numbers. For example, 555-555-5555 or (555) 555-5555")
|
|
39
40
|
alternate_phone: Optional[StrictStr] = Field(default=None, description="An alternate phone number for the patient. Similar rules apply here as in the primary_phone field")
|
|
40
41
|
email: StrictStr = Field(description="The patient's email address")
|
|
41
|
-
|
|
42
|
+
preferred_language: Optional[StrictStr] = Field(default='EN', description="The patient's preferred language using the two alphabetic character abbreviation (e.g. EN, FR, ES). Must be a value in the Languages Codes Type.")
|
|
43
|
+
__properties: ClassVar[List[str]] = ["object_type", "last_name", "first_name", "middle_name", "suffix", "prefix", "gender_assigned_at_birth", "date_of_birth", "primary_phone", "alternate_phone", "email", "preferred_language"]
|
|
44
|
+
|
|
45
|
+
@field_validator('object_type')
|
|
46
|
+
def object_type_validate_enum(cls, value):
|
|
47
|
+
"""Validates the enum"""
|
|
48
|
+
if value not in set(['patient']):
|
|
49
|
+
raise ValueError("must be one of enum values ('patient')")
|
|
50
|
+
return value
|
|
42
51
|
|
|
43
52
|
@field_validator('gender_assigned_at_birth')
|
|
44
53
|
def gender_assigned_at_birth_validate_enum(cls, value):
|
|
@@ -98,6 +107,7 @@ class PatientData(BaseModel):
|
|
|
98
107
|
return cls.model_validate(obj)
|
|
99
108
|
|
|
100
109
|
_obj = cls.model_validate({
|
|
110
|
+
"object_type": obj.get("object_type"),
|
|
101
111
|
"last_name": obj.get("last_name"),
|
|
102
112
|
"first_name": obj.get("first_name"),
|
|
103
113
|
"middle_name": obj.get("middle_name"),
|
|
@@ -107,7 +117,8 @@ class PatientData(BaseModel):
|
|
|
107
117
|
"date_of_birth": obj.get("date_of_birth"),
|
|
108
118
|
"primary_phone": obj.get("primary_phone"),
|
|
109
119
|
"alternate_phone": obj.get("alternate_phone"),
|
|
110
|
-
"email": obj.get("email")
|
|
120
|
+
"email": obj.get("email"),
|
|
121
|
+
"preferred_language": obj.get("preferred_language") if obj.get("preferred_language") is not None else 'EN'
|
|
111
122
|
})
|
|
112
123
|
return _obj
|
|
113
124
|
|
|
@@ -18,8 +18,9 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict,
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -27,10 +28,10 @@ class PatientExternalIdentifier(BaseModel):
|
|
|
27
28
|
"""
|
|
28
29
|
PatientExternalIdentifier
|
|
29
30
|
""" # noqa: E501
|
|
30
|
-
external_id:
|
|
31
|
-
external_system_slug:
|
|
32
|
-
external_email: Optional[
|
|
33
|
-
external_mobile_phone: Optional[
|
|
31
|
+
external_id: Annotated[str, Field(strict=True, max_length=255)] = Field(description="The identifier for the patient in the context of the external system")
|
|
32
|
+
external_system_slug: Annotated[str, Field(strict=True, max_length=255)] = Field(description="The identifier for the external system that is managing the patient record. Not the same as the virtual pharamcy slug.")
|
|
33
|
+
external_email: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The email address for the patient in the context of the external system")
|
|
34
|
+
external_mobile_phone: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field(default=None, description="The mobile phone number for the patient in the context of the external system")
|
|
34
35
|
__properties: ClassVar[List[str]] = ["external_id", "external_system_slug", "external_email", "external_mobile_phone"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
@@ -0,0 +1,127 @@
|
|
|
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, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from rxfoundry.clients.swifty_api.models.code import Code
|
|
24
|
+
from rxfoundry.clients.swifty_api.models.medication_ref import MedicationRef
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class PatientHealthProfileData(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
The latest patient health profile as provided by an external system (e.g. patient portal, emr). This data should include all current information and the backend will determine what to add or remove. Also, the only action that is operated on is 'updated'.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
object_type: Optional[StrictStr] = Field(default=None, description="The discriminator used to determine the type of the object. This is required for the discriminator to work correctly.")
|
|
33
|
+
allergies: Optional[List[Code]] = None
|
|
34
|
+
conditions: Optional[List[Code]] = None
|
|
35
|
+
medications: Optional[List[MedicationRef]] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["object_type", "allergies", "conditions", "medications"]
|
|
37
|
+
|
|
38
|
+
@field_validator('object_type')
|
|
39
|
+
def object_type_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value is None:
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
if value not in set(['health_profile']):
|
|
45
|
+
raise ValueError("must be one of enum values ('health_profile')")
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
populate_by_name=True,
|
|
50
|
+
validate_assignment=True,
|
|
51
|
+
protected_namespaces=(),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of PatientHealthProfileData from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([
|
|
80
|
+
])
|
|
81
|
+
|
|
82
|
+
_dict = self.model_dump(
|
|
83
|
+
by_alias=True,
|
|
84
|
+
exclude=excluded_fields,
|
|
85
|
+
exclude_none=True,
|
|
86
|
+
)
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of each item in allergies (list)
|
|
88
|
+
_items = []
|
|
89
|
+
if self.allergies:
|
|
90
|
+
for _item_allergies in self.allergies:
|
|
91
|
+
if _item_allergies:
|
|
92
|
+
_items.append(_item_allergies.to_dict())
|
|
93
|
+
_dict['allergies'] = _items
|
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of each item in conditions (list)
|
|
95
|
+
_items = []
|
|
96
|
+
if self.conditions:
|
|
97
|
+
for _item_conditions in self.conditions:
|
|
98
|
+
if _item_conditions:
|
|
99
|
+
_items.append(_item_conditions.to_dict())
|
|
100
|
+
_dict['conditions'] = _items
|
|
101
|
+
# override the default output from pydantic by calling `to_dict()` of each item in medications (list)
|
|
102
|
+
_items = []
|
|
103
|
+
if self.medications:
|
|
104
|
+
for _item_medications in self.medications:
|
|
105
|
+
if _item_medications:
|
|
106
|
+
_items.append(_item_medications.to_dict())
|
|
107
|
+
_dict['medications'] = _items
|
|
108
|
+
return _dict
|
|
109
|
+
|
|
110
|
+
@classmethod
|
|
111
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
112
|
+
"""Create an instance of PatientHealthProfileData from a dict"""
|
|
113
|
+
if obj is None:
|
|
114
|
+
return None
|
|
115
|
+
|
|
116
|
+
if not isinstance(obj, dict):
|
|
117
|
+
return cls.model_validate(obj)
|
|
118
|
+
|
|
119
|
+
_obj = cls.model_validate({
|
|
120
|
+
"object_type": obj.get("object_type"),
|
|
121
|
+
"allergies": [Code.from_dict(_item) for _item in obj["allergies"]] if obj.get("allergies") is not None else None,
|
|
122
|
+
"conditions": [Code.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None,
|
|
123
|
+
"medications": [MedicationRef.from_dict(_item) for _item in obj["medications"]] if obj.get("medications") is not None else None
|
|
124
|
+
})
|
|
125
|
+
return _obj
|
|
126
|
+
|
|
127
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
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, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class PatientInsurance(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
PatientInsurance
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
uuid: Optional[StrictStr] = Field(default=None, description="The unique identifier for the insurance")
|
|
31
|
+
member_id: Optional[StrictStr] = Field(default=None, description="The unique identifier for the member")
|
|
32
|
+
rx_bin: Optional[StrictStr] = Field(default=None, description="The BIN number for the insurance")
|
|
33
|
+
rx_pcn: Optional[StrictStr] = Field(default=None, description="The PCN number for the insurance")
|
|
34
|
+
rx_group: Optional[StrictStr] = Field(default=None, description="The group number for the insurance")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["uuid", "member_id", "rx_bin", "rx_pcn", "rx_group"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of PatientInsurance from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# set to None if rx_pcn (nullable) is None
|
|
77
|
+
# and model_fields_set contains the field
|
|
78
|
+
if self.rx_pcn is None and "rx_pcn" in self.model_fields_set:
|
|
79
|
+
_dict['rx_pcn'] = None
|
|
80
|
+
|
|
81
|
+
# set to None if rx_group (nullable) is None
|
|
82
|
+
# and model_fields_set contains the field
|
|
83
|
+
if self.rx_group is None and "rx_group" in self.model_fields_set:
|
|
84
|
+
_dict['rx_group'] = None
|
|
85
|
+
|
|
86
|
+
return _dict
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of PatientInsurance from a dict"""
|
|
91
|
+
if obj is None:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
if not isinstance(obj, dict):
|
|
95
|
+
return cls.model_validate(obj)
|
|
96
|
+
|
|
97
|
+
_obj = cls.model_validate({
|
|
98
|
+
"uuid": obj.get("uuid"),
|
|
99
|
+
"member_id": obj.get("member_id"),
|
|
100
|
+
"rx_bin": obj.get("rx_bin"),
|
|
101
|
+
"rx_pcn": obj.get("rx_pcn"),
|
|
102
|
+
"rx_group": obj.get("rx_group")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
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, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class PatientInsuranceData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
A patient's insurance data. member_id and rx_bin are combined to form a primary key for the insurance record.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
object_type: StrictStr = Field(description="The discriminator used to determine the type of the object. This is required for the discriminator to work correctly.")
|
|
31
|
+
uuid: Optional[StrictStr] = Field(default=None, description="The insurances' UUID, if known. If not set, member_id and rx_bin are used to form a primary key for the insurance record.")
|
|
32
|
+
member_id: StrictStr = Field(description="The insurances' member ID")
|
|
33
|
+
rx_bin: StrictStr = Field(description="The insurances' RX BIN")
|
|
34
|
+
rx_pcn: Optional[StrictStr] = Field(default=None, description="The insurances' RX PCN")
|
|
35
|
+
rx_group: Optional[StrictStr] = Field(default=None, description="The insurances' RX Group Number")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["object_type", "uuid", "member_id", "rx_bin", "rx_pcn", "rx_group"]
|
|
37
|
+
|
|
38
|
+
@field_validator('object_type')
|
|
39
|
+
def object_type_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value not in set(['insurance']):
|
|
42
|
+
raise ValueError("must be one of enum values ('insurance')")
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
populate_by_name=True,
|
|
47
|
+
validate_assignment=True,
|
|
48
|
+
protected_namespaces=(),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def to_str(self) -> str:
|
|
53
|
+
"""Returns the string representation of the model using alias"""
|
|
54
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
55
|
+
|
|
56
|
+
def to_json(self) -> str:
|
|
57
|
+
"""Returns the JSON representation of the model using alias"""
|
|
58
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
59
|
+
return json.dumps(self.to_dict())
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of PatientInsuranceData from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of PatientInsuranceData from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"object_type": obj.get("object_type"),
|
|
97
|
+
"uuid": obj.get("uuid"),
|
|
98
|
+
"member_id": obj.get("member_id"),
|
|
99
|
+
"rx_bin": obj.get("rx_bin"),
|
|
100
|
+
"rx_pcn": obj.get("rx_pcn"),
|
|
101
|
+
"rx_group": obj.get("rx_group")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|