rxfoundry.clients.swifty-api 0.0.668__py3-none-any.whl → 0.1.1008__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 (75) hide show
  1. rxfoundry/clients/swifty_api/__init__.py +38 -3
  2. rxfoundry/clients/swifty_api/api/__init__.py +3 -1
  3. rxfoundry/clients/swifty_api/api/async_api.py +2336 -52
  4. rxfoundry/clients/swifty_api/api/code_api.py +281 -0
  5. rxfoundry/clients/swifty_api/api/default_api.py +318 -0
  6. rxfoundry/clients/swifty_api/api/medication_api.py +647 -51
  7. rxfoundry/clients/swifty_api/api/patient_api.py +1429 -49
  8. rxfoundry/clients/swifty_api/api/pharmacist_api.py +24 -24
  9. rxfoundry/clients/swifty_api/api/pharmacy_api.py +48 -48
  10. rxfoundry/clients/swifty_api/api/prescriber_api.py +24 -24
  11. rxfoundry/clients/swifty_api/api/prescription_api.py +934 -130
  12. rxfoundry/clients/swifty_api/api/task_api.py +1835 -0
  13. rxfoundry/clients/swifty_api/api/tasks_api.py +374 -0
  14. rxfoundry/clients/swifty_api/api/validation_api.py +311 -0
  15. rxfoundry/clients/swifty_api/api/virtual_pharmacy_api.py +262 -0
  16. rxfoundry/clients/swifty_api/api/workflow_api.py +633 -0
  17. rxfoundry/clients/swifty_api/models/__init__.py +35 -2
  18. rxfoundry/clients/swifty_api/models/address.py +11 -10
  19. rxfoundry/clients/swifty_api/models/code_type.py +92 -0
  20. rxfoundry/clients/swifty_api/models/create_patient_request.py +98 -0
  21. rxfoundry/clients/swifty_api/models/formulary.py +96 -0
  22. rxfoundry/clients/swifty_api/models/insurance.py +96 -0
  23. rxfoundry/clients/swifty_api/models/medication_instruction.py +92 -0
  24. rxfoundry/clients/swifty_api/models/medication_ref.py +100 -0
  25. rxfoundry/clients/swifty_api/models/patient.py +88 -3
  26. rxfoundry/clients/swifty_api/models/patient_activity_data.py +169 -0
  27. rxfoundry/clients/swifty_api/models/patient_activity_message.py +112 -0
  28. rxfoundry/clients/swifty_api/models/patient_activity_notification.py +9 -17
  29. rxfoundry/clients/swifty_api/models/patient_activity_notification_activity_data.py +39 -8
  30. rxfoundry/clients/swifty_api/models/patient_address_activity_notification.py +105 -0
  31. rxfoundry/clients/swifty_api/models/patient_address_data.py +25 -9
  32. rxfoundry/clients/swifty_api/models/patient_allergy.py +92 -0
  33. rxfoundry/clients/swifty_api/models/patient_condition.py +92 -0
  34. rxfoundry/clients/swifty_api/models/patient_data.py +13 -2
  35. rxfoundry/clients/swifty_api/models/patient_external_identifier.py +6 -5
  36. rxfoundry/clients/swifty_api/models/patient_health_profile_data.py +127 -0
  37. rxfoundry/clients/swifty_api/models/patient_insurance.py +106 -0
  38. rxfoundry/clients/swifty_api/models/patient_insurance_data.py +105 -0
  39. rxfoundry/clients/swifty_api/models/patient_medication.py +92 -0
  40. rxfoundry/clients/swifty_api/models/patient_name.py +99 -0
  41. rxfoundry/clients/swifty_api/models/patient_name_data.py +108 -0
  42. rxfoundry/clients/swifty_api/models/patient_phone_number.py +89 -0
  43. rxfoundry/clients/swifty_api/models/patient_phone_number_data.py +98 -0
  44. rxfoundry/clients/swifty_api/models/patient_task.py +115 -0
  45. rxfoundry/clients/swifty_api/models/patient_task_status.py +105 -0
  46. rxfoundry/clients/swifty_api/models/patient_task_type.py +45 -0
  47. rxfoundry/clients/swifty_api/models/prescription.py +35 -30
  48. rxfoundry/clients/swifty_api/models/prescription_change_request.py +24 -36
  49. rxfoundry/clients/swifty_api/models/prescription_change_request_and_response.py +145 -0
  50. rxfoundry/clients/swifty_api/models/prescription_change_request_response.py +134 -0
  51. rxfoundry/clients/swifty_api/models/prescription_data.py +126 -0
  52. rxfoundry/clients/swifty_api/models/prescription_message.py +100 -0
  53. rxfoundry/clients/swifty_api/models/prescription_message_task.py +109 -0
  54. rxfoundry/clients/swifty_api/models/prescription_message_task_status.py +99 -0
  55. rxfoundry/clients/swifty_api/models/prescription_message_task_type.py +43 -0
  56. rxfoundry/clients/swifty_api/models/prescription_message_type.py +53 -0
  57. rxfoundry/clients/swifty_api/models/prescription_patch.py +6 -2
  58. rxfoundry/clients/swifty_api/models/prescription_status_type.py +40 -0
  59. rxfoundry/clients/swifty_api/models/prescription_task.py +14 -12
  60. rxfoundry/clients/swifty_api/models/prescription_task_status.py +6 -2
  61. rxfoundry/clients/swifty_api/models/prescription_task_type.py +42 -0
  62. rxfoundry/clients/swifty_api/models/prescription_transfer_request_and_response.py +145 -0
  63. rxfoundry/clients/swifty_api/models/prescription_transfer_request_response.py +128 -0
  64. rxfoundry/clients/swifty_api/models/status_type.py +92 -0
  65. rxfoundry/clients/swifty_api/models/workflow.py +108 -0
  66. rxfoundry/clients/swifty_api/models/workflow_sub_task.py +96 -0
  67. rxfoundry/clients/swifty_api/models/workflow_sub_task_sub_task.py +155 -0
  68. rxfoundry/clients/swifty_api/models/workflow_task.py +111 -0
  69. rxfoundry/clients/swifty_api/models/workflow_task_task.py +155 -0
  70. rxfoundry/clients/swifty_api/models/workflow_type.py +55 -0
  71. {rxfoundry_clients_swifty_api-0.0.668.dist-info → rxfoundry_clients_swifty_api-0.1.1008.dist-info}/METADATA +1 -1
  72. rxfoundry_clients_swifty_api-0.1.1008.dist-info/RECORD +110 -0
  73. {rxfoundry_clients_swifty_api-0.0.668.dist-info → rxfoundry_clients_swifty_api-0.1.1008.dist-info}/WHEEL +1 -1
  74. rxfoundry_clients_swifty_api-0.0.668.dist-info/RECORD +0 -64
  75. {rxfoundry_clients_swifty_api-0.0.668.dist-info → rxfoundry_clients_swifty_api-0.1.1008.dist-info}/top_level.txt +0 -0
@@ -19,7 +19,7 @@ import re # noqa: F401
19
19
  import json
20
20
 
21
21
  from datetime import datetime
22
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
23
23
  from typing import Any, ClassVar, Dict, List, Optional, Union
24
24
  from rxfoundry.clients.swifty_api.models.user import User
25
25
  from typing import Optional, Set
@@ -33,14 +33,16 @@ class PrescriptionPatch(BaseModel):
33
33
  days_supply: Optional[StrictInt] = None
34
34
  quantity_value: Optional[Union[StrictFloat, StrictInt]] = None
35
35
  number_of_fills: Optional[StrictInt] = None
36
+ patient_ref: Optional[StrictStr] = Field(default=None, description="The identifier for the patient. It can be the patient uuid or the patient external identifier in the form slug:identifier")
36
37
  original_sig_text: Optional[StrictStr] = None
37
38
  original_days_supply: Optional[StrictInt] = None
38
39
  original_quantity_value: Optional[Union[StrictFloat, StrictInt]] = None
39
40
  original_number_of_fills: Optional[StrictInt] = None
41
+ original_patient_ref: Optional[StrictStr] = Field(default=None, description="The identifier for the patient. It can be the patient uuid or the patient external identifier in the form slug:identifier")
40
42
  patched_on: Optional[datetime] = None
41
43
  ignore_open_issues: Optional[StrictBool] = None
42
44
  patched_by: Optional[User] = None
43
- __properties: ClassVar[List[str]] = ["sig_text", "days_supply", "quantity_value", "number_of_fills", "original_sig_text", "original_days_supply", "original_quantity_value", "original_number_of_fills", "patched_on", "ignore_open_issues", "patched_by"]
45
+ __properties: ClassVar[List[str]] = ["sig_text", "days_supply", "quantity_value", "number_of_fills", "patient_ref", "original_sig_text", "original_days_supply", "original_quantity_value", "original_number_of_fills", "original_patient_ref", "patched_on", "ignore_open_issues", "patched_by"]
44
46
 
45
47
  model_config = ConfigDict(
46
48
  populate_by_name=True,
@@ -100,10 +102,12 @@ class PrescriptionPatch(BaseModel):
100
102
  "days_supply": obj.get("days_supply"),
101
103
  "quantity_value": obj.get("quantity_value"),
102
104
  "number_of_fills": obj.get("number_of_fills"),
105
+ "patient_ref": obj.get("patient_ref"),
103
106
  "original_sig_text": obj.get("original_sig_text"),
104
107
  "original_days_supply": obj.get("original_days_supply"),
105
108
  "original_quantity_value": obj.get("original_quantity_value"),
106
109
  "original_number_of_fills": obj.get("original_number_of_fills"),
110
+ "original_patient_ref": obj.get("original_patient_ref"),
107
111
  "patched_on": obj.get("patched_on"),
108
112
  "ignore_open_issues": obj.get("ignore_open_issues"),
109
113
  "patched_by": User.from_dict(obj["patched_by"]) if obj.get("patched_by") is not None else None
@@ -0,0 +1,40 @@
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 PrescriptionStatusType(str, Enum):
23
+ """
24
+ PrescriptionStatusType
25
+ """
26
+
27
+ """
28
+ allowed enum values
29
+ """
30
+ ON_HOLD = 'On_Hold'
31
+ TRANSFERRED = 'Transferred'
32
+ CANCELLED = 'Cancelled'
33
+ DISCONTINUED = 'Discontinued'
34
+
35
+ @classmethod
36
+ def from_json(cls, json_str: str) -> Self:
37
+ """Create an instance of PrescriptionStatusType from a JSON string"""
38
+ return cls(json.loads(json_str))
39
+
40
+
@@ -22,7 +22,6 @@ from datetime import datetime
22
22
  from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
23
23
  from typing import Any, ClassVar, Dict, List, Optional
24
24
  from rxfoundry.clients.swifty_api.models.pharmacy import Pharmacy
25
- from rxfoundry.clients.swifty_api.models.prescription_task_status import PrescriptionTaskStatus
26
25
  from typing import Optional, Set
27
26
  from typing_extensions import Self
28
27
 
@@ -30,6 +29,7 @@ class PrescriptionTask(BaseModel):
30
29
  """
31
30
  PrescriptionTask
32
31
  """ # noqa: E501
32
+ parent_task_type: Optional[StrictStr] = None
33
33
  uuid: Optional[StrictStr] = None
34
34
  created_on: Optional[datetime] = None
35
35
  task_type: Optional[StrictStr] = None
@@ -38,8 +38,17 @@ class PrescriptionTask(BaseModel):
38
38
  from_pharmacy: Optional[Pharmacy] = None
39
39
  to_pharmacy: Optional[Pharmacy] = None
40
40
  transfer_type: Optional[StrictStr] = None
41
- statuses: Optional[List[PrescriptionTaskStatus]] = None
42
- __properties: ClassVar[List[str]] = ["uuid", "created_on", "task_type", "manual_review_required", "is_completed", "from_pharmacy", "to_pharmacy", "transfer_type", "statuses"]
41
+ __properties: ClassVar[List[str]] = ["parent_task_type", "uuid", "created_on", "task_type", "manual_review_required", "is_completed", "from_pharmacy", "to_pharmacy", "transfer_type"]
42
+
43
+ @field_validator('parent_task_type')
44
+ def parent_task_type_validate_enum(cls, value):
45
+ """Validates the enum"""
46
+ if value is None:
47
+ return value
48
+
49
+ if value not in set(['prescription']):
50
+ raise ValueError("must be one of enum values ('prescription')")
51
+ return value
43
52
 
44
53
  @field_validator('transfer_type')
45
54
  def transfer_type_validate_enum(cls, value):
@@ -96,13 +105,6 @@ class PrescriptionTask(BaseModel):
96
105
  # override the default output from pydantic by calling `to_dict()` of to_pharmacy
97
106
  if self.to_pharmacy:
98
107
  _dict['to_pharmacy'] = self.to_pharmacy.to_dict()
99
- # override the default output from pydantic by calling `to_dict()` of each item in statuses (list)
100
- _items = []
101
- if self.statuses:
102
- for _item_statuses in self.statuses:
103
- if _item_statuses:
104
- _items.append(_item_statuses.to_dict())
105
- _dict['statuses'] = _items
106
108
  return _dict
107
109
 
108
110
  @classmethod
@@ -115,6 +117,7 @@ class PrescriptionTask(BaseModel):
115
117
  return cls.model_validate(obj)
116
118
 
117
119
  _obj = cls.model_validate({
120
+ "parent_task_type": obj.get("parent_task_type"),
118
121
  "uuid": obj.get("uuid"),
119
122
  "created_on": obj.get("created_on"),
120
123
  "task_type": obj.get("task_type"),
@@ -122,8 +125,7 @@ class PrescriptionTask(BaseModel):
122
125
  "is_completed": obj.get("is_completed"),
123
126
  "from_pharmacy": Pharmacy.from_dict(obj["from_pharmacy"]) if obj.get("from_pharmacy") is not None else None,
124
127
  "to_pharmacy": Pharmacy.from_dict(obj["to_pharmacy"]) if obj.get("to_pharmacy") is not None else None,
125
- "transfer_type": obj.get("transfer_type"),
126
- "statuses": [PrescriptionTaskStatus.from_dict(_item) for _item in obj["statuses"]] if obj.get("statuses") is not None else None
128
+ "transfer_type": obj.get("transfer_type")
127
129
  })
128
130
  return _obj
129
131
 
@@ -21,6 +21,7 @@ import json
21
21
  from datetime import datetime
22
22
  from pydantic import BaseModel, ConfigDict, StrictStr
23
23
  from typing import Any, ClassVar, Dict, List, Optional
24
+ from rxfoundry.clients.swifty_api.models.status_type import StatusType
24
25
  from typing import Optional, Set
25
26
  from typing_extensions import Self
26
27
 
@@ -29,7 +30,7 @@ class PrescriptionTaskStatus(BaseModel):
29
30
  PrescriptionTaskStatus
30
31
  """ # noqa: E501
31
32
  uuid: Optional[StrictStr] = None
32
- status_type: Optional[StrictStr] = None
33
+ status_type: Optional[StatusType] = None
33
34
  status_date_time: Optional[datetime] = None
34
35
  status_info: Optional[Dict[str, Any]] = None
35
36
  __properties: ClassVar[List[str]] = ["uuid", "status_type", "status_date_time", "status_info"]
@@ -73,6 +74,9 @@ class PrescriptionTaskStatus(BaseModel):
73
74
  exclude=excluded_fields,
74
75
  exclude_none=True,
75
76
  )
77
+ # override the default output from pydantic by calling `to_dict()` of status_type
78
+ if self.status_type:
79
+ _dict['status_type'] = self.status_type.to_dict()
76
80
  return _dict
77
81
 
78
82
  @classmethod
@@ -86,7 +90,7 @@ class PrescriptionTaskStatus(BaseModel):
86
90
 
87
91
  _obj = cls.model_validate({
88
92
  "uuid": obj.get("uuid"),
89
- "status_type": obj.get("status_type"),
93
+ "status_type": StatusType.from_dict(obj["status_type"]) if obj.get("status_type") is not None else None,
90
94
  "status_date_time": obj.get("status_date_time"),
91
95
  "status_info": obj.get("status_info")
92
96
  })
@@ -0,0 +1,42 @@
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 PrescriptionTaskType(str, Enum):
23
+ """
24
+ PrescriptionTaskType
25
+ """
26
+
27
+ """
28
+ allowed enum values
29
+ """
30
+ AUTO_PV0 = 'AUTO_PV0'
31
+ CHECK_SIG_TEXT = 'CHECK_SIG_TEXT'
32
+ FORMULARY_CHECK = 'FORMULARY_CHECK'
33
+ IMAGE_GENERATE = 'IMAGE_GENERATE'
34
+ NOTIFY = 'NOTIFY'
35
+ XML_GENERATE = 'XML_GENERATE'
36
+
37
+ @classmethod
38
+ def from_json(cls, json_str: str) -> Self:
39
+ """Create an instance of PrescriptionTaskType from a JSON string"""
40
+ return cls(json.loads(json_str))
41
+
42
+
@@ -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_message_task import PrescriptionMessageTask
25
+ from rxfoundry.clients.swifty_api.models.prescription_transfer_request import PrescriptionTransferRequest
26
+ from rxfoundry.clients.swifty_api.models.prescription_transfer_request_response import PrescriptionTransferRequestResponse
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 PrescriptionTransferRequestAndResponse(BaseModel):
32
+ """
33
+ PrescriptionTransferRequestAndResponse
34
+ """ # noqa: E501
35
+ transfer_request: Optional[PrescriptionTransferRequest] = None
36
+ transfer_request_tasks: Optional[List[PrescriptionMessageTask]] = None
37
+ requested_on: Optional[datetime] = None
38
+ requested_by: Optional[User] = None
39
+ response: Optional[PrescriptionTransferRequestResponse] = 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]] = ["transfer_request", "transfer_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 PrescriptionTransferRequestAndResponse 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 transfer_request
96
+ if self.transfer_request:
97
+ _dict['transfer_request'] = self.transfer_request.to_dict()
98
+ # override the default output from pydantic by calling `to_dict()` of each item in transfer_request_tasks (list)
99
+ _items = []
100
+ if self.transfer_request_tasks:
101
+ for _item_transfer_request_tasks in self.transfer_request_tasks:
102
+ if _item_transfer_request_tasks:
103
+ _items.append(_item_transfer_request_tasks.to_dict())
104
+ _dict['transfer_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 PrescriptionTransferRequestAndResponse 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
+ "transfer_request": PrescriptionTransferRequest.from_dict(obj["transfer_request"]) if obj.get("transfer_request") is not None else None,
134
+ "transfer_request_tasks": [PrescriptionMessageTask.from_dict(_item) for _item in obj["transfer_request_tasks"]] if obj.get("transfer_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": PrescriptionTransferRequestResponse.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
+
@@ -0,0 +1,128 @@
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.prescription_message_task import PrescriptionMessageTask
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class PrescriptionTransferRequestResponse(BaseModel):
29
+ """
30
+ PrescriptionTransferRequestResponse
31
+ """ # noqa: E501
32
+ message_id: Optional[StrictStr] = Field(default=None, description="The message id for this change request")
33
+ request_message_id: Optional[StrictStr] = Field(default=None, description="The message id for the original change request")
34
+ approval_type: Optional[StrictStr] = None
35
+ denial_codes: Optional[List[Code]] = None
36
+ approval_text: Optional[StrictStr] = Field(default=None, description="Any additional information about the approval.")
37
+ denial_text: Optional[StrictStr] = Field(default=None, description="Any additional information about the denial.")
38
+ pending_text: Optional[StrictStr] = Field(default=None, description="Any additional information about the pending request.")
39
+ tasks: Optional[List[PrescriptionMessageTask]] = None
40
+ __properties: ClassVar[List[str]] = ["message_id", "request_message_id", "approval_type", "denial_codes", "approval_text", "denial_text", "pending_text", "tasks"]
41
+
42
+ @field_validator('approval_type')
43
+ def approval_type_validate_enum(cls, value):
44
+ """Validates the enum"""
45
+ if value is None:
46
+ return value
47
+
48
+ if value not in set(['approved', 'denied', 'pending']):
49
+ raise ValueError("must be one of enum values ('approved', 'denied', 'pending')")
50
+ return value
51
+
52
+ model_config = ConfigDict(
53
+ populate_by_name=True,
54
+ validate_assignment=True,
55
+ protected_namespaces=(),
56
+ )
57
+
58
+
59
+ def to_str(self) -> str:
60
+ """Returns the string representation of the model using alias"""
61
+ return pprint.pformat(self.model_dump(by_alias=True))
62
+
63
+ def to_json(self) -> str:
64
+ """Returns the JSON representation of the model using alias"""
65
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
66
+ return json.dumps(self.to_dict())
67
+
68
+ @classmethod
69
+ def from_json(cls, json_str: str) -> Optional[Self]:
70
+ """Create an instance of PrescriptionTransferRequestResponse from a JSON string"""
71
+ return cls.from_dict(json.loads(json_str))
72
+
73
+ def to_dict(self) -> Dict[str, Any]:
74
+ """Return the dictionary representation of the model using alias.
75
+
76
+ This has the following differences from calling pydantic's
77
+ `self.model_dump(by_alias=True)`:
78
+
79
+ * `None` is only added to the output dict for nullable fields that
80
+ were set at model initialization. Other fields with value `None`
81
+ are ignored.
82
+ """
83
+ excluded_fields: Set[str] = set([
84
+ ])
85
+
86
+ _dict = self.model_dump(
87
+ by_alias=True,
88
+ exclude=excluded_fields,
89
+ exclude_none=True,
90
+ )
91
+ # override the default output from pydantic by calling `to_dict()` of each item in denial_codes (list)
92
+ _items = []
93
+ if self.denial_codes:
94
+ for _item_denial_codes in self.denial_codes:
95
+ if _item_denial_codes:
96
+ _items.append(_item_denial_codes.to_dict())
97
+ _dict['denial_codes'] = _items
98
+ # override the default output from pydantic by calling `to_dict()` of each item in tasks (list)
99
+ _items = []
100
+ if self.tasks:
101
+ for _item_tasks in self.tasks:
102
+ if _item_tasks:
103
+ _items.append(_item_tasks.to_dict())
104
+ _dict['tasks'] = _items
105
+ return _dict
106
+
107
+ @classmethod
108
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
109
+ """Create an instance of PrescriptionTransferRequestResponse from a dict"""
110
+ if obj is None:
111
+ return None
112
+
113
+ if not isinstance(obj, dict):
114
+ return cls.model_validate(obj)
115
+
116
+ _obj = cls.model_validate({
117
+ "message_id": obj.get("message_id"),
118
+ "request_message_id": obj.get("request_message_id"),
119
+ "approval_type": obj.get("approval_type"),
120
+ "denial_codes": [Code.from_dict(_item) for _item in obj["denial_codes"]] if obj.get("denial_codes") is not None else None,
121
+ "approval_text": obj.get("approval_text"),
122
+ "denial_text": obj.get("denial_text"),
123
+ "pending_text": obj.get("pending_text"),
124
+ "tasks": [PrescriptionMessageTask.from_dict(_item) for _item in obj["tasks"]] if obj.get("tasks") is not None else None
125
+ })
126
+ return _obj
127
+
128
+
@@ -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, 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 StatusType(BaseModel):
27
+ """
28
+ StatusType
29
+ """ # noqa: E501
30
+ uuid: Optional[StrictStr] = None
31
+ status_type: Optional[StrictStr] = None
32
+ status_type_description: Optional[StrictStr] = None
33
+ __properties: ClassVar[List[str]] = ["uuid", "status_type", "status_type_description"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of StatusType from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of StatusType from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "uuid": obj.get("uuid"),
87
+ "status_type": obj.get("status_type"),
88
+ "status_type_description": obj.get("status_type_description")
89
+ })
90
+ return _obj
91
+
92
+