rxfoundry.clients.swifty-api 0.0.593__py3-none-any.whl → 1.0.0__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.
Files changed (61) hide show
  1. rxfoundry/clients/swifty_api/models/virtual_pharmacy.py +3 -1
  2. {rxfoundry_clients_swifty_api-0.0.593.dist-info → rxfoundry_clients_swifty_api-1.0.0.dist-info}/METADATA +1 -1
  3. rxfoundry_clients_swifty_api-1.0.0.dist-info/RECORD +61 -0
  4. rxfoundry/clients/p2rx_api/__init__.py +0 -79
  5. rxfoundry/clients/p2rx_api/api/__init__.py +0 -17
  6. rxfoundry/clients/p2rx_api/api/async_api.py +0 -862
  7. rxfoundry/clients/p2rx_api/api/code_api.py +0 -337
  8. rxfoundry/clients/p2rx_api/api/fax_api.py +0 -632
  9. rxfoundry/clients/p2rx_api/api/medication_api.py +0 -666
  10. rxfoundry/clients/p2rx_api/api/patient_api.py +0 -981
  11. rxfoundry/clients/p2rx_api/api/pharmacist_api.py +0 -615
  12. rxfoundry/clients/p2rx_api/api/pharmacy_api.py +0 -684
  13. rxfoundry/clients/p2rx_api/api/prescriber_api.py +0 -615
  14. rxfoundry/clients/p2rx_api/api/prescription_api.py +0 -1864
  15. rxfoundry/clients/p2rx_api/api/token_api.py +0 -314
  16. rxfoundry/clients/p2rx_api/api/user_api.py +0 -306
  17. rxfoundry/clients/p2rx_api/api/version_api.py +0 -282
  18. rxfoundry/clients/p2rx_api/api/virtual_pharmacy_api.py +0 -284
  19. rxfoundry/clients/p2rx_api/api_client.py +0 -798
  20. rxfoundry/clients/p2rx_api/api_response.py +0 -21
  21. rxfoundry/clients/p2rx_api/configuration.py +0 -583
  22. rxfoundry/clients/p2rx_api/exceptions.py +0 -217
  23. rxfoundry/clients/p2rx_api/models/__init__.py +0 -50
  24. rxfoundry/clients/p2rx_api/models/address.py +0 -106
  25. rxfoundry/clients/p2rx_api/models/asynchronous_response.py +0 -90
  26. rxfoundry/clients/p2rx_api/models/code.py +0 -92
  27. rxfoundry/clients/p2rx_api/models/code_qualifier_code.py +0 -96
  28. rxfoundry/clients/p2rx_api/models/error_message.py +0 -90
  29. rxfoundry/clients/p2rx_api/models/fax.py +0 -141
  30. rxfoundry/clients/p2rx_api/models/medication.py +0 -137
  31. rxfoundry/clients/p2rx_api/models/medication_program_pricing.py +0 -99
  32. rxfoundry/clients/p2rx_api/models/medication_variant.py +0 -96
  33. rxfoundry/clients/p2rx_api/models/patient.py +0 -128
  34. rxfoundry/clients/p2rx_api/models/patient_activity_notification.py +0 -114
  35. rxfoundry/clients/p2rx_api/models/patient_external_identifier.py +0 -94
  36. rxfoundry/clients/p2rx_api/models/pharmacist.py +0 -104
  37. rxfoundry/clients/p2rx_api/models/pharmacy.py +0 -156
  38. rxfoundry/clients/p2rx_api/models/pharmacy_chain.py +0 -100
  39. rxfoundry/clients/p2rx_api/models/pharmacy_other_identifier.py +0 -98
  40. rxfoundry/clients/p2rx_api/models/pharmacy_program_pricing.py +0 -103
  41. rxfoundry/clients/p2rx_api/models/prescriber.py +0 -106
  42. rxfoundry/clients/p2rx_api/models/prescription.py +0 -278
  43. rxfoundry/clients/p2rx_api/models/prescription_change_request.py +0 -123
  44. rxfoundry/clients/p2rx_api/models/prescription_issue.py +0 -120
  45. rxfoundry/clients/p2rx_api/models/prescription_patch.py +0 -113
  46. rxfoundry/clients/p2rx_api/models/prescription_task.py +0 -130
  47. rxfoundry/clients/p2rx_api/models/prescription_task_status.py +0 -95
  48. rxfoundry/clients/p2rx_api/models/prescription_transfer_request.py +0 -93
  49. rxfoundry/clients/p2rx_api/models/prescription_verification.py +0 -107
  50. rxfoundry/clients/p2rx_api/models/pricing_program.py +0 -90
  51. rxfoundry/clients/p2rx_api/models/surescripts_message.py +0 -111
  52. rxfoundry/clients/p2rx_api/models/token.py +0 -92
  53. rxfoundry/clients/p2rx_api/models/user.py +0 -98
  54. rxfoundry/clients/p2rx_api/models/version.py +0 -88
  55. rxfoundry/clients/p2rx_api/models/virtual_pharmacy.py +0 -96
  56. rxfoundry/clients/p2rx_api/models/workflow_request.py +0 -90
  57. rxfoundry/clients/p2rx_api/py.typed +0 -0
  58. rxfoundry/clients/p2rx_api/rest.py +0 -259
  59. rxfoundry_clients_swifty_api-0.0.593.dist-info/RECORD +0 -116
  60. {rxfoundry_clients_swifty_api-0.0.593.dist-info → rxfoundry_clients_swifty_api-1.0.0.dist-info}/WHEEL +0 -0
  61. {rxfoundry_clients_swifty_api-0.0.593.dist-info → rxfoundry_clients_swifty_api-1.0.0.dist-info}/top_level.txt +0 -0
@@ -1,103 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX 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 date
22
- from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt
23
- from typing import Any, ClassVar, Dict, List, Optional, Union
24
- from rxfoundry.clients.swifty_api.models.pricing_program import PricingProgram
25
- from typing import Optional, Set
26
- from typing_extensions import Self
27
-
28
- class PharmacyProgramPricing(BaseModel):
29
- """
30
- PharmacyProgramPricing
31
- """ # noqa: E501
32
- pricing_program: Optional[PricingProgram] = None
33
- from_date: Optional[date] = None
34
- to_date: Optional[date] = None
35
- dispensing_fee: Optional[Union[StrictFloat, StrictInt]] = None
36
- transaction_fee: Optional[Union[StrictFloat, StrictInt]] = None
37
- ingredient_cost_markup: Optional[Union[StrictFloat, StrictInt]] = None
38
- __properties: ClassVar[List[str]] = ["pricing_program", "from_date", "to_date", "dispensing_fee", "transaction_fee", "ingredient_cost_markup"]
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 PharmacyProgramPricing 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 pricing_program
80
- if self.pricing_program:
81
- _dict['pricing_program'] = self.pricing_program.to_dict()
82
- return _dict
83
-
84
- @classmethod
85
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
- """Create an instance of PharmacyProgramPricing from a dict"""
87
- if obj is None:
88
- return None
89
-
90
- if not isinstance(obj, dict):
91
- return cls.model_validate(obj)
92
-
93
- _obj = cls.model_validate({
94
- "pricing_program": PricingProgram.from_dict(obj["pricing_program"]) if obj.get("pricing_program") is not None else None,
95
- "from_date": obj.get("from_date"),
96
- "to_date": obj.get("to_date"),
97
- "dispensing_fee": obj.get("dispensing_fee"),
98
- "transaction_fee": obj.get("transaction_fee"),
99
- "ingredient_cost_markup": obj.get("ingredient_cost_markup")
100
- })
101
- return _obj
102
-
103
-
@@ -1,106 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX 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.address import Address
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class Prescriber(BaseModel):
28
- """
29
- Prescriber
30
- """ # noqa: E501
31
- uuid: Optional[StrictStr] = None
32
- last_name: Optional[StrictStr] = None
33
- first_name: Optional[StrictStr] = None
34
- middle_name: Optional[StrictStr] = None
35
- credentials_text: Optional[StrictStr] = None
36
- npi: Optional[StrictStr] = None
37
- dea_number: Optional[StrictStr] = None
38
- practice_address: Optional[Address] = None
39
- __properties: ClassVar[List[str]] = ["uuid", "last_name", "first_name", "middle_name", "credentials_text", "npi", "dea_number", "practice_address"]
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 Prescriber 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 practice_address
81
- if self.practice_address:
82
- _dict['practice_address'] = self.practice_address.to_dict()
83
- return _dict
84
-
85
- @classmethod
86
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
- """Create an instance of Prescriber from a dict"""
88
- if obj is None:
89
- return None
90
-
91
- if not isinstance(obj, dict):
92
- return cls.model_validate(obj)
93
-
94
- _obj = cls.model_validate({
95
- "uuid": obj.get("uuid"),
96
- "last_name": obj.get("last_name"),
97
- "first_name": obj.get("first_name"),
98
- "middle_name": obj.get("middle_name"),
99
- "credentials_text": obj.get("credentials_text"),
100
- "npi": obj.get("npi"),
101
- "dea_number": obj.get("dea_number"),
102
- "practice_address": Address.from_dict(obj["practice_address"]) if obj.get("practice_address") is not None else None
103
- })
104
- return _obj
105
-
106
-
@@ -1,278 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX 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 date, datetime
22
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
23
- from typing import Any, ClassVar, Dict, List, Optional, Union
24
- from rxfoundry.clients.swifty_api.models.code import Code
25
- from rxfoundry.clients.swifty_api.models.medication import Medication
26
- from rxfoundry.clients.swifty_api.models.patient import Patient
27
- from rxfoundry.clients.swifty_api.models.pharmacy import Pharmacy
28
- from rxfoundry.clients.swifty_api.models.prescriber import Prescriber
29
- from rxfoundry.clients.swifty_api.models.prescription_change_request import PrescriptionChangeRequest
30
- from rxfoundry.clients.swifty_api.models.prescription_issue import PrescriptionIssue
31
- from rxfoundry.clients.swifty_api.models.prescription_patch import PrescriptionPatch
32
- from rxfoundry.clients.swifty_api.models.prescription_task import PrescriptionTask
33
- from rxfoundry.clients.swifty_api.models.prescription_verification import PrescriptionVerification
34
- from rxfoundry.clients.swifty_api.models.surescripts_message import SurescriptsMessage
35
- from rxfoundry.clients.swifty_api.models.user import User
36
- from rxfoundry.clients.swifty_api.models.virtual_pharmacy import VirtualPharmacy
37
- from typing import Optional, Set
38
- from typing_extensions import Self
39
-
40
- class Prescription(BaseModel):
41
- """
42
- Prescription
43
- """ # noqa: E501
44
- uuid: Optional[StrictStr] = None
45
- rx_number: Optional[StrictStr] = None
46
- prescriber_order_number: Optional[StrictStr] = None
47
- patient: Optional[Patient] = None
48
- pharmacy: Optional[Pharmacy] = None
49
- prescriber: Optional[Prescriber] = None
50
- drug_description: Optional[StrictStr] = None
51
- prescribed_ndc: Optional[StrictStr] = None
52
- medication: Optional[Medication] = None
53
- number_of_fills: Optional[StrictInt] = None
54
- quantity_value: Optional[Union[StrictFloat, StrictInt]] = None
55
- quantity_type: Optional[Code] = None
56
- quantity_uom: Optional[Code] = None
57
- days_supply: Optional[StrictInt] = None
58
- written_date: Optional[date] = None
59
- substitutions: Optional[Code] = None
60
- sig_text: Optional[StrictStr] = None
61
- structured_sig_snomed_verson: Optional[StrictStr] = None
62
- structured_sig_fmt_version: Optional[StrictStr] = None
63
- structured_sig_instructions: Optional[Dict[str, Any]] = None
64
- structured_sig_indications: Optional[Dict[str, Any]] = None
65
- structured_sig_max_does_restrictions: Optional[Dict[str, Any]] = None
66
- structured_sig_clarifying_free_text: Optional[StrictStr] = None
67
- rx_fill_indicators: Optional[List[Code]] = None
68
- surescripts_message: Optional[SurescriptsMessage] = None
69
- intake_pharmacy: Optional[VirtualPharmacy] = None
70
- pv0: Optional[PrescriptionVerification] = None
71
- pv1: Optional[PrescriptionVerification] = None
72
- is_on_formulary: Optional[StrictBool] = None
73
- has_open_issues: Optional[StrictBool] = None
74
- ignore_open_issues: Optional[StrictBool] = None
75
- has_running_workflow: Optional[StrictBool] = None
76
- notified_on: Optional[datetime] = None
77
- prescription_issues: Optional[List[PrescriptionIssue]] = None
78
- prescription_change_requests: Optional[List[PrescriptionChangeRequest]] = None
79
- prescription_tasks: Optional[List[PrescriptionTask]] = None
80
- prescription_edits: Optional[List[PrescriptionPatch]] = None
81
- transfer_requested_on: Optional[datetime] = None
82
- transfer_requested_to: Optional[Pharmacy] = None
83
- transferred_on: Optional[datetime] = None
84
- transfer_type: Optional[StrictStr] = None
85
- transferred_by: Optional[User] = None
86
- change_requested_on: Optional[datetime] = None
87
- change_request_closed_on: Optional[datetime] = None
88
- change_request_approved: Optional[StrictBool] = None
89
- image_pdf: Optional[StrictStr] = None
90
- image_png: Optional[StrictStr] = None
91
- __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", "surescripts_message", "intake_pharmacy", "pv0", "pv1", "is_on_formulary", "has_open_issues", "ignore_open_issues", "has_running_workflow", "notified_on", "prescription_issues", "prescription_change_requests", "prescription_tasks", "prescription_edits", "transfer_requested_on", "transfer_requested_to", "transferred_on", "transfer_type", "transferred_by", "change_requested_on", "change_request_closed_on", "change_request_approved", "image_pdf", "image_png"]
92
-
93
- @field_validator('transfer_type')
94
- def transfer_type_validate_enum(cls, value):
95
- """Validates the enum"""
96
- if value is None:
97
- return value
98
-
99
- if value not in set(['API', 'MANUAL', 'SURESCRIPTS', 'FAX']):
100
- raise ValueError("must be one of enum values ('API', 'MANUAL', 'SURESCRIPTS', 'FAX')")
101
- return value
102
-
103
- model_config = ConfigDict(
104
- populate_by_name=True,
105
- validate_assignment=True,
106
- protected_namespaces=(),
107
- )
108
-
109
-
110
- def to_str(self) -> str:
111
- """Returns the string representation of the model using alias"""
112
- return pprint.pformat(self.model_dump(by_alias=True))
113
-
114
- def to_json(self) -> str:
115
- """Returns the JSON representation of the model using alias"""
116
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
117
- return json.dumps(self.to_dict())
118
-
119
- @classmethod
120
- def from_json(cls, json_str: str) -> Optional[Self]:
121
- """Create an instance of Prescription from a JSON string"""
122
- return cls.from_dict(json.loads(json_str))
123
-
124
- def to_dict(self) -> Dict[str, Any]:
125
- """Return the dictionary representation of the model using alias.
126
-
127
- This has the following differences from calling pydantic's
128
- `self.model_dump(by_alias=True)`:
129
-
130
- * `None` is only added to the output dict for nullable fields that
131
- were set at model initialization. Other fields with value `None`
132
- are ignored.
133
- """
134
- excluded_fields: Set[str] = set([
135
- ])
136
-
137
- _dict = self.model_dump(
138
- by_alias=True,
139
- exclude=excluded_fields,
140
- exclude_none=True,
141
- )
142
- # override the default output from pydantic by calling `to_dict()` of patient
143
- if self.patient:
144
- _dict['patient'] = self.patient.to_dict()
145
- # override the default output from pydantic by calling `to_dict()` of pharmacy
146
- if self.pharmacy:
147
- _dict['pharmacy'] = self.pharmacy.to_dict()
148
- # override the default output from pydantic by calling `to_dict()` of prescriber
149
- if self.prescriber:
150
- _dict['prescriber'] = self.prescriber.to_dict()
151
- # override the default output from pydantic by calling `to_dict()` of medication
152
- if self.medication:
153
- _dict['medication'] = self.medication.to_dict()
154
- # override the default output from pydantic by calling `to_dict()` of quantity_type
155
- if self.quantity_type:
156
- _dict['quantity_type'] = self.quantity_type.to_dict()
157
- # override the default output from pydantic by calling `to_dict()` of quantity_uom
158
- if self.quantity_uom:
159
- _dict['quantity_uom'] = self.quantity_uom.to_dict()
160
- # override the default output from pydantic by calling `to_dict()` of substitutions
161
- if self.substitutions:
162
- _dict['substitutions'] = self.substitutions.to_dict()
163
- # override the default output from pydantic by calling `to_dict()` of each item in rx_fill_indicators (list)
164
- _items = []
165
- if self.rx_fill_indicators:
166
- for _item_rx_fill_indicators in self.rx_fill_indicators:
167
- if _item_rx_fill_indicators:
168
- _items.append(_item_rx_fill_indicators.to_dict())
169
- _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
- # override the default output from pydantic by calling `to_dict()` of pv0
177
- if self.pv0:
178
- _dict['pv0'] = self.pv0.to_dict()
179
- # override the default output from pydantic by calling `to_dict()` of pv1
180
- if self.pv1:
181
- _dict['pv1'] = self.pv1.to_dict()
182
- # override the default output from pydantic by calling `to_dict()` of each item in prescription_issues (list)
183
- _items = []
184
- if self.prescription_issues:
185
- for _item_prescription_issues in self.prescription_issues:
186
- if _item_prescription_issues:
187
- _items.append(_item_prescription_issues.to_dict())
188
- _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
- # override the default output from pydantic by calling `to_dict()` of each item in prescription_tasks (list)
197
- _items = []
198
- if self.prescription_tasks:
199
- for _item_prescription_tasks in self.prescription_tasks:
200
- if _item_prescription_tasks:
201
- _items.append(_item_prescription_tasks.to_dict())
202
- _dict['prescription_tasks'] = _items
203
- # override the default output from pydantic by calling `to_dict()` of each item in prescription_edits (list)
204
- _items = []
205
- if self.prescription_edits:
206
- for _item_prescription_edits in self.prescription_edits:
207
- if _item_prescription_edits:
208
- _items.append(_item_prescription_edits.to_dict())
209
- _dict['prescription_edits'] = _items
210
- # override the default output from pydantic by calling `to_dict()` of transfer_requested_to
211
- if self.transfer_requested_to:
212
- _dict['transfer_requested_to'] = self.transfer_requested_to.to_dict()
213
- # override the default output from pydantic by calling `to_dict()` of transferred_by
214
- if self.transferred_by:
215
- _dict['transferred_by'] = self.transferred_by.to_dict()
216
- return _dict
217
-
218
- @classmethod
219
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
220
- """Create an instance of Prescription from a dict"""
221
- if obj is None:
222
- return None
223
-
224
- if not isinstance(obj, dict):
225
- return cls.model_validate(obj)
226
-
227
- _obj = cls.model_validate({
228
- "uuid": obj.get("uuid"),
229
- "rx_number": obj.get("rx_number"),
230
- "prescriber_order_number": obj.get("prescriber_order_number"),
231
- "patient": Patient.from_dict(obj["patient"]) if obj.get("patient") is not None else None,
232
- "pharmacy": Pharmacy.from_dict(obj["pharmacy"]) if obj.get("pharmacy") is not None else None,
233
- "prescriber": Prescriber.from_dict(obj["prescriber"]) if obj.get("prescriber") is not None else None,
234
- "drug_description": obj.get("drug_description"),
235
- "prescribed_ndc": obj.get("prescribed_ndc"),
236
- "medication": Medication.from_dict(obj["medication"]) if obj.get("medication") is not None else None,
237
- "number_of_fills": obj.get("number_of_fills"),
238
- "quantity_value": obj.get("quantity_value"),
239
- "quantity_type": Code.from_dict(obj["quantity_type"]) if obj.get("quantity_type") is not None else None,
240
- "quantity_uom": Code.from_dict(obj["quantity_uom"]) if obj.get("quantity_uom") is not None else None,
241
- "days_supply": obj.get("days_supply"),
242
- "written_date": obj.get("written_date"),
243
- "substitutions": Code.from_dict(obj["substitutions"]) if obj.get("substitutions") is not None else None,
244
- "sig_text": obj.get("sig_text"),
245
- "structured_sig_snomed_verson": obj.get("structured_sig_snomed_verson"),
246
- "structured_sig_fmt_version": obj.get("structured_sig_fmt_version"),
247
- "structured_sig_instructions": obj.get("structured_sig_instructions"),
248
- "structured_sig_indications": obj.get("structured_sig_indications"),
249
- "structured_sig_max_does_restrictions": obj.get("structured_sig_max_does_restrictions"),
250
- "structured_sig_clarifying_free_text": obj.get("structured_sig_clarifying_free_text"),
251
- "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
- "pv0": PrescriptionVerification.from_dict(obj["pv0"]) if obj.get("pv0") is not None else None,
255
- "pv1": PrescriptionVerification.from_dict(obj["pv1"]) if obj.get("pv1") is not None else None,
256
- "is_on_formulary": obj.get("is_on_formulary"),
257
- "has_open_issues": obj.get("has_open_issues"),
258
- "ignore_open_issues": obj.get("ignore_open_issues"),
259
- "has_running_workflow": obj.get("has_running_workflow"),
260
- "notified_on": obj.get("notified_on"),
261
- "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
- "prescription_tasks": [PrescriptionTask.from_dict(_item) for _item in obj["prescription_tasks"]] if obj.get("prescription_tasks") is not None else None,
264
- "prescription_edits": [PrescriptionPatch.from_dict(_item) for _item in obj["prescription_edits"]] if obj.get("prescription_edits") is not None else None,
265
- "transfer_requested_on": obj.get("transfer_requested_on"),
266
- "transfer_requested_to": Pharmacy.from_dict(obj["transfer_requested_to"]) if obj.get("transfer_requested_to") is not None else None,
267
- "transferred_on": obj.get("transferred_on"),
268
- "transfer_type": obj.get("transfer_type"),
269
- "transferred_by": User.from_dict(obj["transferred_by"]) if obj.get("transferred_by") is not None else None,
270
- "change_requested_on": obj.get("change_requested_on"),
271
- "change_request_closed_on": obj.get("change_request_closed_on"),
272
- "change_request_approved": obj.get("change_request_approved"),
273
- "image_pdf": obj.get("image_pdf"),
274
- "image_png": obj.get("image_png")
275
- })
276
- return _obj
277
-
278
-
@@ -1,123 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX 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.code import Code
25
- from rxfoundry.clients.swifty_api.models.user import User
26
- from typing import Optional, Set
27
- from typing_extensions import Self
28
-
29
- class PrescriptionChangeRequest(BaseModel):
30
- """
31
- PrescriptionChangeRequest
32
- """ # noqa: E501
33
- surescripts_request_code: Optional[StrictStr] = None
34
- surescripts_request_sub_code: Optional[StrictStr] = None
35
- request: Optional[StrictStr] = None
36
- urgency: Optional[StrictStr] = None
37
- requested_on: Optional[datetime] = None
38
- requested_by: Optional[User] = None
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"]
46
-
47
- model_config = ConfigDict(
48
- populate_by_name=True,
49
- validate_assignment=True,
50
- protected_namespaces=(),
51
- )
52
-
53
-
54
- def to_str(self) -> str:
55
- """Returns the string representation of the model using alias"""
56
- return pprint.pformat(self.model_dump(by_alias=True))
57
-
58
- def to_json(self) -> str:
59
- """Returns the JSON representation of the model using alias"""
60
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
- return json.dumps(self.to_dict())
62
-
63
- @classmethod
64
- def from_json(cls, json_str: str) -> Optional[Self]:
65
- """Create an instance of PrescriptionChangeRequest from a JSON string"""
66
- return cls.from_dict(json.loads(json_str))
67
-
68
- def to_dict(self) -> Dict[str, Any]:
69
- """Return the dictionary representation of the model using alias.
70
-
71
- This has the following differences from calling pydantic's
72
- `self.model_dump(by_alias=True)`:
73
-
74
- * `None` is only added to the output dict for nullable fields that
75
- were set at model initialization. Other fields with value `None`
76
- are ignored.
77
- """
78
- excluded_fields: Set[str] = set([
79
- ])
80
-
81
- _dict = self.model_dump(
82
- by_alias=True,
83
- exclude=excluded_fields,
84
- exclude_none=True,
85
- )
86
- # override the default output from pydantic by calling `to_dict()` of requested_by
87
- if self.requested_by:
88
- _dict['requested_by'] = self.requested_by.to_dict()
89
- # override the default output from pydantic by calling `to_dict()` of each item in denied_reasons (list)
90
- _items = []
91
- if self.denied_reasons:
92
- for _item_denied_reasons in self.denied_reasons:
93
- if _item_denied_reasons:
94
- _items.append(_item_denied_reasons.to_dict())
95
- _dict['denied_reasons'] = _items
96
- return _dict
97
-
98
- @classmethod
99
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
100
- """Create an instance of PrescriptionChangeRequest from a dict"""
101
- if obj is None:
102
- return None
103
-
104
- if not isinstance(obj, dict):
105
- return cls.model_validate(obj)
106
-
107
- _obj = cls.model_validate({
108
- "surescripts_request_code": obj.get("surescripts_request_code"),
109
- "surescripts_request_sub_code": obj.get("surescripts_request_sub_code"),
110
- "request": obj.get("request"),
111
- "urgency": obj.get("urgency"),
112
- "requested_on": obj.get("requested_on"),
113
- "requested_by": User.from_dict(obj["requested_by"]) if obj.get("requested_by") is not None else None,
114
- "approved": obj.get("approved"),
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")
120
- })
121
- return _obj
122
-
123
-