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
|
@@ -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 datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
+
from rxfoundry.clients.swifty_api.models.patient import Patient
|
|
25
|
+
from rxfoundry.clients.swifty_api.models.status_type import StatusType
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class PatientTaskStatus(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
PatientTaskStatus
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
uuid: Optional[StrictStr] = None
|
|
34
|
+
status_type: Optional[StatusType] = None
|
|
35
|
+
status_date_time: Optional[datetime] = None
|
|
36
|
+
status_info: Optional[Dict[str, Any]] = None
|
|
37
|
+
patient: Optional[Patient] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["uuid", "status_type", "status_date_time", "status_info", "patient"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of PatientTaskStatus from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of status_type
|
|
80
|
+
if self.status_type:
|
|
81
|
+
_dict['status_type'] = self.status_type.to_dict()
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of patient
|
|
83
|
+
if self.patient:
|
|
84
|
+
_dict['patient'] = self.patient.to_dict()
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of PatientTaskStatus from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"uuid": obj.get("uuid"),
|
|
98
|
+
"status_type": StatusType.from_dict(obj["status_type"]) if obj.get("status_type") is not None else None,
|
|
99
|
+
"status_date_time": obj.get("status_date_time"),
|
|
100
|
+
"status_info": obj.get("status_info"),
|
|
101
|
+
"patient": Patient.from_dict(obj["patient"]) if obj.get("patient") is not None else None
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
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 PatientTaskType(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
PatientTaskType
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
PATIENT_IMPORT = 'PATIENT_IMPORT'
|
|
31
|
+
PATIENT_UPDATE = 'PATIENT_UPDATE'
|
|
32
|
+
PATIENT_ADDRESS_IMPORT = 'PATIENT_ADDRESS_IMPORT'
|
|
33
|
+
PATIENT_ADDRESS_UPDATE = 'PATIENT_ADDRESS_UPDATE'
|
|
34
|
+
PATIENT_ADDRESS_DELETE = 'PATIENT_ADDRESS_DELETE'
|
|
35
|
+
PATIENT_INSURANCE_IMPORT = 'PATIENT_INSURANCE_IMPORT'
|
|
36
|
+
PATIENT_INSURANCE_UPDATE = 'PATIENT_INSURANCE_UPDATE'
|
|
37
|
+
PATIENT_INSURANCE_DELETE = 'PATIENT_INSURANCE_DELETE'
|
|
38
|
+
PATIENT_HEALTH_PROFILE_UPDATE = 'PATIENT_HEALTH_PROFILE_UPDATE'
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_json(cls, json_str: str) -> Self:
|
|
42
|
+
"""Create an instance of PatientTaskType from a JSON string"""
|
|
43
|
+
return cls(json.loads(json_str))
|
|
44
|
+
|
|
45
|
+
|
|
@@ -26,14 +26,14 @@ from rxfoundry.clients.swifty_api.models.medication import Medication
|
|
|
26
26
|
from rxfoundry.clients.swifty_api.models.patient import Patient
|
|
27
27
|
from rxfoundry.clients.swifty_api.models.pharmacy import Pharmacy
|
|
28
28
|
from rxfoundry.clients.swifty_api.models.prescriber import Prescriber
|
|
29
|
-
from rxfoundry.clients.swifty_api.models.
|
|
29
|
+
from rxfoundry.clients.swifty_api.models.prescription_change_request_and_response import PrescriptionChangeRequestAndResponse
|
|
30
30
|
from rxfoundry.clients.swifty_api.models.prescription_issue import PrescriptionIssue
|
|
31
31
|
from rxfoundry.clients.swifty_api.models.prescription_patch import PrescriptionPatch
|
|
32
|
+
from rxfoundry.clients.swifty_api.models.prescription_status_type import PrescriptionStatusType
|
|
32
33
|
from rxfoundry.clients.swifty_api.models.prescription_task import PrescriptionTask
|
|
34
|
+
from rxfoundry.clients.swifty_api.models.prescription_transfer_request_and_response import PrescriptionTransferRequestAndResponse
|
|
33
35
|
from rxfoundry.clients.swifty_api.models.prescription_verification import PrescriptionVerification
|
|
34
|
-
from rxfoundry.clients.swifty_api.models.surescripts_message import SurescriptsMessage
|
|
35
36
|
from rxfoundry.clients.swifty_api.models.user import User
|
|
36
|
-
from rxfoundry.clients.swifty_api.models.virtual_pharmacy import VirtualPharmacy
|
|
37
37
|
from typing import Optional, Set
|
|
38
38
|
from typing_extensions import Self
|
|
39
39
|
|
|
@@ -65,30 +65,32 @@ class Prescription(BaseModel):
|
|
|
65
65
|
structured_sig_max_does_restrictions: Optional[Dict[str, Any]] = None
|
|
66
66
|
structured_sig_clarifying_free_text: Optional[StrictStr] = None
|
|
67
67
|
rx_fill_indicators: Optional[List[Code]] = None
|
|
68
|
-
surescripts_message: Optional[SurescriptsMessage] = None
|
|
69
|
-
intake_pharmacy: Optional[VirtualPharmacy] = None
|
|
70
68
|
pv0: Optional[PrescriptionVerification] = None
|
|
71
69
|
pv1: Optional[PrescriptionVerification] = None
|
|
72
70
|
is_on_formulary: Optional[StrictBool] = None
|
|
73
71
|
has_open_issues: Optional[StrictBool] = None
|
|
74
72
|
ignore_open_issues: Optional[StrictBool] = None
|
|
75
73
|
has_running_workflow: Optional[StrictBool] = None
|
|
74
|
+
has_pending_change_requests: Optional[StrictBool] = None
|
|
75
|
+
has_approved_change_requests: Optional[StrictBool] = None
|
|
76
|
+
has_denied_change_requests: Optional[StrictBool] = None
|
|
76
77
|
notified_on: Optional[datetime] = None
|
|
77
78
|
prescription_issues: Optional[List[PrescriptionIssue]] = None
|
|
78
|
-
prescription_change_requests: Optional[List[PrescriptionChangeRequest]] = None
|
|
79
79
|
prescription_tasks: Optional[List[PrescriptionTask]] = None
|
|
80
80
|
prescription_edits: Optional[List[PrescriptionPatch]] = None
|
|
81
|
+
prescription_change_requests: Optional[List[PrescriptionChangeRequestAndResponse]] = None
|
|
82
|
+
prescription_transfer_requests: Optional[List[PrescriptionTransferRequestAndResponse]] = None
|
|
81
83
|
transfer_requested_on: Optional[datetime] = None
|
|
82
84
|
transfer_requested_to: Optional[Pharmacy] = None
|
|
83
85
|
transferred_on: Optional[datetime] = None
|
|
84
86
|
transfer_type: Optional[StrictStr] = None
|
|
85
87
|
transferred_by: Optional[User] = None
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
change_request_approved: Optional[StrictBool] = None
|
|
88
|
+
original_image_pdf: Optional[StrictStr] = None
|
|
89
|
+
original_image_png: Optional[StrictStr] = None
|
|
89
90
|
image_pdf: Optional[StrictStr] = None
|
|
90
91
|
image_png: Optional[StrictStr] = None
|
|
91
|
-
|
|
92
|
+
status: Optional[PrescriptionStatusType] = None
|
|
93
|
+
__properties: ClassVar[List[str]] = ["uuid", "rx_number", "prescriber_order_number", "patient", "pharmacy", "prescriber", "drug_description", "prescribed_ndc", "medication", "number_of_fills", "quantity_value", "quantity_type", "quantity_uom", "days_supply", "written_date", "substitutions", "sig_text", "structured_sig_snomed_verson", "structured_sig_fmt_version", "structured_sig_instructions", "structured_sig_indications", "structured_sig_max_does_restrictions", "structured_sig_clarifying_free_text", "rx_fill_indicators", "pv0", "pv1", "is_on_formulary", "has_open_issues", "ignore_open_issues", "has_running_workflow", "has_pending_change_requests", "has_approved_change_requests", "has_denied_change_requests", "notified_on", "prescription_issues", "prescription_tasks", "prescription_edits", "prescription_change_requests", "prescription_transfer_requests", "transfer_requested_on", "transfer_requested_to", "transferred_on", "transfer_type", "transferred_by", "original_image_pdf", "original_image_png", "image_pdf", "image_png", "status"]
|
|
92
94
|
|
|
93
95
|
@field_validator('transfer_type')
|
|
94
96
|
def transfer_type_validate_enum(cls, value):
|
|
@@ -167,12 +169,6 @@ class Prescription(BaseModel):
|
|
|
167
169
|
if _item_rx_fill_indicators:
|
|
168
170
|
_items.append(_item_rx_fill_indicators.to_dict())
|
|
169
171
|
_dict['rx_fill_indicators'] = _items
|
|
170
|
-
# override the default output from pydantic by calling `to_dict()` of surescripts_message
|
|
171
|
-
if self.surescripts_message:
|
|
172
|
-
_dict['surescripts_message'] = self.surescripts_message.to_dict()
|
|
173
|
-
# override the default output from pydantic by calling `to_dict()` of intake_pharmacy
|
|
174
|
-
if self.intake_pharmacy:
|
|
175
|
-
_dict['intake_pharmacy'] = self.intake_pharmacy.to_dict()
|
|
176
172
|
# override the default output from pydantic by calling `to_dict()` of pv0
|
|
177
173
|
if self.pv0:
|
|
178
174
|
_dict['pv0'] = self.pv0.to_dict()
|
|
@@ -186,13 +182,6 @@ class Prescription(BaseModel):
|
|
|
186
182
|
if _item_prescription_issues:
|
|
187
183
|
_items.append(_item_prescription_issues.to_dict())
|
|
188
184
|
_dict['prescription_issues'] = _items
|
|
189
|
-
# override the default output from pydantic by calling `to_dict()` of each item in prescription_change_requests (list)
|
|
190
|
-
_items = []
|
|
191
|
-
if self.prescription_change_requests:
|
|
192
|
-
for _item_prescription_change_requests in self.prescription_change_requests:
|
|
193
|
-
if _item_prescription_change_requests:
|
|
194
|
-
_items.append(_item_prescription_change_requests.to_dict())
|
|
195
|
-
_dict['prescription_change_requests'] = _items
|
|
196
185
|
# override the default output from pydantic by calling `to_dict()` of each item in prescription_tasks (list)
|
|
197
186
|
_items = []
|
|
198
187
|
if self.prescription_tasks:
|
|
@@ -207,6 +196,20 @@ class Prescription(BaseModel):
|
|
|
207
196
|
if _item_prescription_edits:
|
|
208
197
|
_items.append(_item_prescription_edits.to_dict())
|
|
209
198
|
_dict['prescription_edits'] = _items
|
|
199
|
+
# override the default output from pydantic by calling `to_dict()` of each item in prescription_change_requests (list)
|
|
200
|
+
_items = []
|
|
201
|
+
if self.prescription_change_requests:
|
|
202
|
+
for _item_prescription_change_requests in self.prescription_change_requests:
|
|
203
|
+
if _item_prescription_change_requests:
|
|
204
|
+
_items.append(_item_prescription_change_requests.to_dict())
|
|
205
|
+
_dict['prescription_change_requests'] = _items
|
|
206
|
+
# override the default output from pydantic by calling `to_dict()` of each item in prescription_transfer_requests (list)
|
|
207
|
+
_items = []
|
|
208
|
+
if self.prescription_transfer_requests:
|
|
209
|
+
for _item_prescription_transfer_requests in self.prescription_transfer_requests:
|
|
210
|
+
if _item_prescription_transfer_requests:
|
|
211
|
+
_items.append(_item_prescription_transfer_requests.to_dict())
|
|
212
|
+
_dict['prescription_transfer_requests'] = _items
|
|
210
213
|
# override the default output from pydantic by calling `to_dict()` of transfer_requested_to
|
|
211
214
|
if self.transfer_requested_to:
|
|
212
215
|
_dict['transfer_requested_to'] = self.transfer_requested_to.to_dict()
|
|
@@ -249,29 +252,31 @@ class Prescription(BaseModel):
|
|
|
249
252
|
"structured_sig_max_does_restrictions": obj.get("structured_sig_max_does_restrictions"),
|
|
250
253
|
"structured_sig_clarifying_free_text": obj.get("structured_sig_clarifying_free_text"),
|
|
251
254
|
"rx_fill_indicators": [Code.from_dict(_item) for _item in obj["rx_fill_indicators"]] if obj.get("rx_fill_indicators") is not None else None,
|
|
252
|
-
"surescripts_message": SurescriptsMessage.from_dict(obj["surescripts_message"]) if obj.get("surescripts_message") is not None else None,
|
|
253
|
-
"intake_pharmacy": VirtualPharmacy.from_dict(obj["intake_pharmacy"]) if obj.get("intake_pharmacy") is not None else None,
|
|
254
255
|
"pv0": PrescriptionVerification.from_dict(obj["pv0"]) if obj.get("pv0") is not None else None,
|
|
255
256
|
"pv1": PrescriptionVerification.from_dict(obj["pv1"]) if obj.get("pv1") is not None else None,
|
|
256
257
|
"is_on_formulary": obj.get("is_on_formulary"),
|
|
257
258
|
"has_open_issues": obj.get("has_open_issues"),
|
|
258
259
|
"ignore_open_issues": obj.get("ignore_open_issues"),
|
|
259
260
|
"has_running_workflow": obj.get("has_running_workflow"),
|
|
261
|
+
"has_pending_change_requests": obj.get("has_pending_change_requests"),
|
|
262
|
+
"has_approved_change_requests": obj.get("has_approved_change_requests"),
|
|
263
|
+
"has_denied_change_requests": obj.get("has_denied_change_requests"),
|
|
260
264
|
"notified_on": obj.get("notified_on"),
|
|
261
265
|
"prescription_issues": [PrescriptionIssue.from_dict(_item) for _item in obj["prescription_issues"]] if obj.get("prescription_issues") is not None else None,
|
|
262
|
-
"prescription_change_requests": [PrescriptionChangeRequest.from_dict(_item) for _item in obj["prescription_change_requests"]] if obj.get("prescription_change_requests") is not None else None,
|
|
263
266
|
"prescription_tasks": [PrescriptionTask.from_dict(_item) for _item in obj["prescription_tasks"]] if obj.get("prescription_tasks") is not None else None,
|
|
264
267
|
"prescription_edits": [PrescriptionPatch.from_dict(_item) for _item in obj["prescription_edits"]] if obj.get("prescription_edits") is not None else None,
|
|
268
|
+
"prescription_change_requests": [PrescriptionChangeRequestAndResponse.from_dict(_item) for _item in obj["prescription_change_requests"]] if obj.get("prescription_change_requests") is not None else None,
|
|
269
|
+
"prescription_transfer_requests": [PrescriptionTransferRequestAndResponse.from_dict(_item) for _item in obj["prescription_transfer_requests"]] if obj.get("prescription_transfer_requests") is not None else None,
|
|
265
270
|
"transfer_requested_on": obj.get("transfer_requested_on"),
|
|
266
271
|
"transfer_requested_to": Pharmacy.from_dict(obj["transfer_requested_to"]) if obj.get("transfer_requested_to") is not None else None,
|
|
267
272
|
"transferred_on": obj.get("transferred_on"),
|
|
268
273
|
"transfer_type": obj.get("transfer_type"),
|
|
269
274
|
"transferred_by": User.from_dict(obj["transferred_by"]) if obj.get("transferred_by") is not None else None,
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
"change_request_approved": obj.get("change_request_approved"),
|
|
275
|
+
"original_image_pdf": obj.get("original_image_pdf"),
|
|
276
|
+
"original_image_png": obj.get("original_image_png"),
|
|
273
277
|
"image_pdf": obj.get("image_pdf"),
|
|
274
|
-
"image_png": obj.get("image_png")
|
|
278
|
+
"image_png": obj.get("image_png"),
|
|
279
|
+
"status": obj.get("status")
|
|
275
280
|
})
|
|
276
281
|
return _obj
|
|
277
282
|
|
|
@@ -19,10 +19,9 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from datetime import datetime
|
|
22
|
-
from pydantic import BaseModel, ConfigDict,
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
23
23
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
24
|
from rxfoundry.clients.swifty_api.models.code import Code
|
|
25
|
-
from rxfoundry.clients.swifty_api.models.user import User
|
|
26
25
|
from typing import Optional, Set
|
|
27
26
|
from typing_extensions import Self
|
|
28
27
|
|
|
@@ -30,19 +29,14 @@ class PrescriptionChangeRequest(BaseModel):
|
|
|
30
29
|
"""
|
|
31
30
|
PrescriptionChangeRequest
|
|
32
31
|
""" # noqa: E501
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
message_id: Optional[StrictStr] = Field(default=None, description="The message id for this change request")
|
|
33
|
+
prescription_number: StrictStr = Field(description="The Swifty prescription number to request a change for")
|
|
34
|
+
change_request_code: Code
|
|
35
|
+
change_request_sub_code: Optional[Code] = None
|
|
36
|
+
change_request_text: StrictStr = Field(description="What specifically is being requested to be changed")
|
|
37
|
+
urgency: Optional[Code] = None
|
|
37
38
|
requested_on: Optional[datetime] = None
|
|
38
|
-
|
|
39
|
-
approved: Optional[StrictBool] = None
|
|
40
|
-
approved_on: Optional[datetime] = None
|
|
41
|
-
approved_with_changes: Optional[StrictStr] = None
|
|
42
|
-
denied_on: Optional[datetime] = None
|
|
43
|
-
denied_reasons: Optional[List[Code]] = None
|
|
44
|
-
denied_reason: Optional[StrictStr] = None
|
|
45
|
-
__properties: ClassVar[List[str]] = ["surescripts_request_code", "surescripts_request_sub_code", "request", "urgency", "requested_on", "requested_by", "approved", "approved_on", "approved_with_changes", "denied_on", "denied_reasons", "denied_reason"]
|
|
39
|
+
__properties: ClassVar[List[str]] = ["message_id", "prescription_number", "change_request_code", "change_request_sub_code", "change_request_text", "urgency", "requested_on"]
|
|
46
40
|
|
|
47
41
|
model_config = ConfigDict(
|
|
48
42
|
populate_by_name=True,
|
|
@@ -83,16 +77,15 @@ class PrescriptionChangeRequest(BaseModel):
|
|
|
83
77
|
exclude=excluded_fields,
|
|
84
78
|
exclude_none=True,
|
|
85
79
|
)
|
|
86
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
87
|
-
if self.
|
|
88
|
-
_dict['
|
|
89
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
_dict['denied_reasons'] = _items
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of change_request_code
|
|
81
|
+
if self.change_request_code:
|
|
82
|
+
_dict['change_request_code'] = self.change_request_code.to_dict()
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of change_request_sub_code
|
|
84
|
+
if self.change_request_sub_code:
|
|
85
|
+
_dict['change_request_sub_code'] = self.change_request_sub_code.to_dict()
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of urgency
|
|
87
|
+
if self.urgency:
|
|
88
|
+
_dict['urgency'] = self.urgency.to_dict()
|
|
96
89
|
return _dict
|
|
97
90
|
|
|
98
91
|
@classmethod
|
|
@@ -105,18 +98,13 @@ class PrescriptionChangeRequest(BaseModel):
|
|
|
105
98
|
return cls.model_validate(obj)
|
|
106
99
|
|
|
107
100
|
_obj = cls.model_validate({
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"approved_on": obj.get("approved_on"),
|
|
116
|
-
"approved_with_changes": obj.get("approved_with_changes"),
|
|
117
|
-
"denied_on": obj.get("denied_on"),
|
|
118
|
-
"denied_reasons": [Code.from_dict(_item) for _item in obj["denied_reasons"]] if obj.get("denied_reasons") is not None else None,
|
|
119
|
-
"denied_reason": obj.get("denied_reason")
|
|
101
|
+
"message_id": obj.get("message_id"),
|
|
102
|
+
"prescription_number": obj.get("prescription_number"),
|
|
103
|
+
"change_request_code": Code.from_dict(obj["change_request_code"]) if obj.get("change_request_code") is not None else None,
|
|
104
|
+
"change_request_sub_code": Code.from_dict(obj["change_request_sub_code"]) if obj.get("change_request_sub_code") is not None else None,
|
|
105
|
+
"change_request_text": obj.get("change_request_text"),
|
|
106
|
+
"urgency": Code.from_dict(obj["urgency"]) if obj.get("urgency") is not None else None,
|
|
107
|
+
"requested_on": obj.get("requested_on")
|
|
120
108
|
})
|
|
121
109
|
return _obj
|
|
122
110
|
|
|
@@ -0,0 +1,145 @@
|
|
|
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.prescription_change_request import PrescriptionChangeRequest
|
|
25
|
+
from rxfoundry.clients.swifty_api.models.prescription_change_request_response import PrescriptionChangeRequestResponse
|
|
26
|
+
from rxfoundry.clients.swifty_api.models.prescription_message_task import PrescriptionMessageTask
|
|
27
|
+
from rxfoundry.clients.swifty_api.models.user import User
|
|
28
|
+
from typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class PrescriptionChangeRequestAndResponse(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
PrescriptionChangeRequestAndResponse
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
change_request: Optional[PrescriptionChangeRequest] = None
|
|
36
|
+
change_request_tasks: Optional[List[PrescriptionMessageTask]] = None
|
|
37
|
+
requested_on: Optional[datetime] = None
|
|
38
|
+
requested_by: Optional[User] = None
|
|
39
|
+
response: Optional[PrescriptionChangeRequestResponse] = None
|
|
40
|
+
response_tasks: Optional[List[PrescriptionMessageTask]] = None
|
|
41
|
+
responded_on: Optional[datetime] = None
|
|
42
|
+
responded_by: Optional[User] = None
|
|
43
|
+
response_status: Optional[StrictStr] = None
|
|
44
|
+
__properties: ClassVar[List[str]] = ["change_request", "change_request_tasks", "requested_on", "requested_by", "response", "response_tasks", "responded_on", "responded_by", "response_status"]
|
|
45
|
+
|
|
46
|
+
@field_validator('response_status')
|
|
47
|
+
def response_status_validate_enum(cls, value):
|
|
48
|
+
"""Validates the enum"""
|
|
49
|
+
if value is None:
|
|
50
|
+
return value
|
|
51
|
+
|
|
52
|
+
if value not in set(['APPROVED', 'REJECTED', 'PENDING']):
|
|
53
|
+
raise ValueError("must be one of enum values ('APPROVED', 'REJECTED', 'PENDING')")
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
model_config = ConfigDict(
|
|
57
|
+
populate_by_name=True,
|
|
58
|
+
validate_assignment=True,
|
|
59
|
+
protected_namespaces=(),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def to_str(self) -> str:
|
|
64
|
+
"""Returns the string representation of the model using alias"""
|
|
65
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
66
|
+
|
|
67
|
+
def to_json(self) -> str:
|
|
68
|
+
"""Returns the JSON representation of the model using alias"""
|
|
69
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
70
|
+
return json.dumps(self.to_dict())
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of PrescriptionChangeRequestAndResponse from a JSON string"""
|
|
75
|
+
return cls.from_dict(json.loads(json_str))
|
|
76
|
+
|
|
77
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
78
|
+
"""Return the dictionary representation of the model using alias.
|
|
79
|
+
|
|
80
|
+
This has the following differences from calling pydantic's
|
|
81
|
+
`self.model_dump(by_alias=True)`:
|
|
82
|
+
|
|
83
|
+
* `None` is only added to the output dict for nullable fields that
|
|
84
|
+
were set at model initialization. Other fields with value `None`
|
|
85
|
+
are ignored.
|
|
86
|
+
"""
|
|
87
|
+
excluded_fields: Set[str] = set([
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
_dict = self.model_dump(
|
|
91
|
+
by_alias=True,
|
|
92
|
+
exclude=excluded_fields,
|
|
93
|
+
exclude_none=True,
|
|
94
|
+
)
|
|
95
|
+
# override the default output from pydantic by calling `to_dict()` of change_request
|
|
96
|
+
if self.change_request:
|
|
97
|
+
_dict['change_request'] = self.change_request.to_dict()
|
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of each item in change_request_tasks (list)
|
|
99
|
+
_items = []
|
|
100
|
+
if self.change_request_tasks:
|
|
101
|
+
for _item_change_request_tasks in self.change_request_tasks:
|
|
102
|
+
if _item_change_request_tasks:
|
|
103
|
+
_items.append(_item_change_request_tasks.to_dict())
|
|
104
|
+
_dict['change_request_tasks'] = _items
|
|
105
|
+
# override the default output from pydantic by calling `to_dict()` of requested_by
|
|
106
|
+
if self.requested_by:
|
|
107
|
+
_dict['requested_by'] = self.requested_by.to_dict()
|
|
108
|
+
# override the default output from pydantic by calling `to_dict()` of response
|
|
109
|
+
if self.response:
|
|
110
|
+
_dict['response'] = self.response.to_dict()
|
|
111
|
+
# override the default output from pydantic by calling `to_dict()` of each item in response_tasks (list)
|
|
112
|
+
_items = []
|
|
113
|
+
if self.response_tasks:
|
|
114
|
+
for _item_response_tasks in self.response_tasks:
|
|
115
|
+
if _item_response_tasks:
|
|
116
|
+
_items.append(_item_response_tasks.to_dict())
|
|
117
|
+
_dict['response_tasks'] = _items
|
|
118
|
+
# override the default output from pydantic by calling `to_dict()` of responded_by
|
|
119
|
+
if self.responded_by:
|
|
120
|
+
_dict['responded_by'] = self.responded_by.to_dict()
|
|
121
|
+
return _dict
|
|
122
|
+
|
|
123
|
+
@classmethod
|
|
124
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
125
|
+
"""Create an instance of PrescriptionChangeRequestAndResponse from a dict"""
|
|
126
|
+
if obj is None:
|
|
127
|
+
return None
|
|
128
|
+
|
|
129
|
+
if not isinstance(obj, dict):
|
|
130
|
+
return cls.model_validate(obj)
|
|
131
|
+
|
|
132
|
+
_obj = cls.model_validate({
|
|
133
|
+
"change_request": PrescriptionChangeRequest.from_dict(obj["change_request"]) if obj.get("change_request") is not None else None,
|
|
134
|
+
"change_request_tasks": [PrescriptionMessageTask.from_dict(_item) for _item in obj["change_request_tasks"]] if obj.get("change_request_tasks") is not None else None,
|
|
135
|
+
"requested_on": obj.get("requested_on"),
|
|
136
|
+
"requested_by": User.from_dict(obj["requested_by"]) if obj.get("requested_by") is not None else None,
|
|
137
|
+
"response": PrescriptionChangeRequestResponse.from_dict(obj["response"]) if obj.get("response") is not None else None,
|
|
138
|
+
"response_tasks": [PrescriptionMessageTask.from_dict(_item) for _item in obj["response_tasks"]] if obj.get("response_tasks") is not None else None,
|
|
139
|
+
"responded_on": obj.get("responded_on"),
|
|
140
|
+
"responded_by": User.from_dict(obj["responded_by"]) if obj.get("responded_by") is not None else None,
|
|
141
|
+
"response_status": obj.get("response_status")
|
|
142
|
+
})
|
|
143
|
+
return _obj
|
|
144
|
+
|
|
145
|
+
|