rxfoundry.clients.swifty-api 0.0.681__py3-none-any.whl → 0.1.1005__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. rxfoundry/clients/swifty_api/__init__.py +37 -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 +1126 -35
  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 +34 -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/formulary.py +96 -0
  21. rxfoundry/clients/swifty_api/models/insurance.py +96 -0
  22. rxfoundry/clients/swifty_api/models/medication_instruction.py +92 -0
  23. rxfoundry/clients/swifty_api/models/medication_ref.py +100 -0
  24. rxfoundry/clients/swifty_api/models/patient.py +85 -2
  25. rxfoundry/clients/swifty_api/models/patient_activity_data.py +169 -0
  26. rxfoundry/clients/swifty_api/models/patient_activity_message.py +112 -0
  27. rxfoundry/clients/swifty_api/models/patient_activity_notification.py +9 -17
  28. rxfoundry/clients/swifty_api/models/patient_activity_notification_activity_data.py +39 -8
  29. rxfoundry/clients/swifty_api/models/patient_address_activity_notification.py +105 -0
  30. rxfoundry/clients/swifty_api/models/patient_address_data.py +25 -9
  31. rxfoundry/clients/swifty_api/models/patient_allergy.py +92 -0
  32. rxfoundry/clients/swifty_api/models/patient_condition.py +92 -0
  33. rxfoundry/clients/swifty_api/models/patient_data.py +13 -2
  34. rxfoundry/clients/swifty_api/models/patient_external_identifier.py +6 -5
  35. rxfoundry/clients/swifty_api/models/patient_health_profile_data.py +127 -0
  36. rxfoundry/clients/swifty_api/models/patient_insurance.py +106 -0
  37. rxfoundry/clients/swifty_api/models/patient_insurance_data.py +105 -0
  38. rxfoundry/clients/swifty_api/models/patient_medication.py +92 -0
  39. rxfoundry/clients/swifty_api/models/patient_name.py +99 -0
  40. rxfoundry/clients/swifty_api/models/patient_name_data.py +108 -0
  41. rxfoundry/clients/swifty_api/models/patient_phone_number.py +89 -0
  42. rxfoundry/clients/swifty_api/models/patient_phone_number_data.py +98 -0
  43. rxfoundry/clients/swifty_api/models/patient_task.py +115 -0
  44. rxfoundry/clients/swifty_api/models/patient_task_status.py +105 -0
  45. rxfoundry/clients/swifty_api/models/patient_task_type.py +45 -0
  46. rxfoundry/clients/swifty_api/models/prescription.py +35 -30
  47. rxfoundry/clients/swifty_api/models/prescription_change_request.py +24 -36
  48. rxfoundry/clients/swifty_api/models/prescription_change_request_and_response.py +145 -0
  49. rxfoundry/clients/swifty_api/models/prescription_change_request_response.py +134 -0
  50. rxfoundry/clients/swifty_api/models/prescription_data.py +126 -0
  51. rxfoundry/clients/swifty_api/models/prescription_message.py +100 -0
  52. rxfoundry/clients/swifty_api/models/prescription_message_task.py +109 -0
  53. rxfoundry/clients/swifty_api/models/prescription_message_task_status.py +99 -0
  54. rxfoundry/clients/swifty_api/models/prescription_message_task_type.py +43 -0
  55. rxfoundry/clients/swifty_api/models/prescription_message_type.py +53 -0
  56. rxfoundry/clients/swifty_api/models/prescription_patch.py +6 -2
  57. rxfoundry/clients/swifty_api/models/prescription_status_type.py +40 -0
  58. rxfoundry/clients/swifty_api/models/prescription_task.py +14 -12
  59. rxfoundry/clients/swifty_api/models/prescription_task_status.py +6 -2
  60. rxfoundry/clients/swifty_api/models/prescription_task_type.py +42 -0
  61. rxfoundry/clients/swifty_api/models/prescription_transfer_request_and_response.py +145 -0
  62. rxfoundry/clients/swifty_api/models/prescription_transfer_request_response.py +128 -0
  63. rxfoundry/clients/swifty_api/models/status_type.py +92 -0
  64. rxfoundry/clients/swifty_api/models/workflow.py +108 -0
  65. rxfoundry/clients/swifty_api/models/workflow_sub_task.py +96 -0
  66. rxfoundry/clients/swifty_api/models/workflow_sub_task_sub_task.py +155 -0
  67. rxfoundry/clients/swifty_api/models/workflow_task.py +111 -0
  68. rxfoundry/clients/swifty_api/models/workflow_task_task.py +155 -0
  69. rxfoundry/clients/swifty_api/models/workflow_type.py +55 -0
  70. {rxfoundry_clients_swifty_api-0.0.681.dist-info → rxfoundry_clients_swifty_api-0.1.1005.dist-info}/METADATA +1 -1
  71. rxfoundry_clients_swifty_api-0.1.1005.dist-info/RECORD +109 -0
  72. rxfoundry_clients_swifty_api-0.0.681.dist-info/RECORD +0 -64
  73. {rxfoundry_clients_swifty_api-0.0.681.dist-info → rxfoundry_clients_swifty_api-0.1.1005.dist-info}/WHEEL +0 -0
  74. {rxfoundry_clients_swifty_api-0.0.681.dist-info → rxfoundry_clients_swifty_api-0.1.1005.dist-info}/top_level.txt +0 -0
@@ -19,17 +19,33 @@ from rxfoundry.clients.swifty_api.models.address import Address
19
19
  from rxfoundry.clients.swifty_api.models.asynchronous_response import AsynchronousResponse
20
20
  from rxfoundry.clients.swifty_api.models.code import Code
21
21
  from rxfoundry.clients.swifty_api.models.code_qualifier_code import CodeQualifierCode
22
+ from rxfoundry.clients.swifty_api.models.code_type import CodeType
22
23
  from rxfoundry.clients.swifty_api.models.error_message import ErrorMessage
23
24
  from rxfoundry.clients.swifty_api.models.fax import Fax
25
+ from rxfoundry.clients.swifty_api.models.formulary import Formulary
26
+ from rxfoundry.clients.swifty_api.models.insurance import Insurance
24
27
  from rxfoundry.clients.swifty_api.models.medication import Medication
28
+ from rxfoundry.clients.swifty_api.models.medication_instruction import MedicationInstruction
25
29
  from rxfoundry.clients.swifty_api.models.medication_program_pricing import MedicationProgramPricing
30
+ from rxfoundry.clients.swifty_api.models.medication_ref import MedicationRef
26
31
  from rxfoundry.clients.swifty_api.models.medication_variant import MedicationVariant
27
32
  from rxfoundry.clients.swifty_api.models.patient import Patient
33
+ from rxfoundry.clients.swifty_api.models.patient_activity_data import PatientActivityData
34
+ from rxfoundry.clients.swifty_api.models.patient_activity_message import PatientActivityMessage
28
35
  from rxfoundry.clients.swifty_api.models.patient_activity_notification import PatientActivityNotification
29
- from rxfoundry.clients.swifty_api.models.patient_activity_notification_activity_data import PatientActivityNotificationActivityData
30
36
  from rxfoundry.clients.swifty_api.models.patient_address_data import PatientAddressData
37
+ from rxfoundry.clients.swifty_api.models.patient_allergy import PatientAllergy
38
+ from rxfoundry.clients.swifty_api.models.patient_condition import PatientCondition
31
39
  from rxfoundry.clients.swifty_api.models.patient_data import PatientData
32
40
  from rxfoundry.clients.swifty_api.models.patient_external_identifier import PatientExternalIdentifier
41
+ from rxfoundry.clients.swifty_api.models.patient_health_profile_data import PatientHealthProfileData
42
+ from rxfoundry.clients.swifty_api.models.patient_insurance_data import PatientInsuranceData
43
+ from rxfoundry.clients.swifty_api.models.patient_medication import PatientMedication
44
+ from rxfoundry.clients.swifty_api.models.patient_name import PatientName
45
+ from rxfoundry.clients.swifty_api.models.patient_phone_number import PatientPhoneNumber
46
+ from rxfoundry.clients.swifty_api.models.patient_task import PatientTask
47
+ from rxfoundry.clients.swifty_api.models.patient_task_status import PatientTaskStatus
48
+ from rxfoundry.clients.swifty_api.models.patient_task_type import PatientTaskType
33
49
  from rxfoundry.clients.swifty_api.models.pharmacist import Pharmacist
34
50
  from rxfoundry.clients.swifty_api.models.pharmacy import Pharmacy
35
51
  from rxfoundry.clients.swifty_api.models.pharmacy_chain import PharmacyChain
@@ -38,16 +54,32 @@ from rxfoundry.clients.swifty_api.models.pharmacy_program_pricing import Pharmac
38
54
  from rxfoundry.clients.swifty_api.models.prescriber import Prescriber
39
55
  from rxfoundry.clients.swifty_api.models.prescription import Prescription
40
56
  from rxfoundry.clients.swifty_api.models.prescription_change_request import PrescriptionChangeRequest
57
+ from rxfoundry.clients.swifty_api.models.prescription_change_request_and_response import PrescriptionChangeRequestAndResponse
58
+ from rxfoundry.clients.swifty_api.models.prescription_change_request_response import PrescriptionChangeRequestResponse
59
+ from rxfoundry.clients.swifty_api.models.prescription_data import PrescriptionData
41
60
  from rxfoundry.clients.swifty_api.models.prescription_issue import PrescriptionIssue
61
+ from rxfoundry.clients.swifty_api.models.prescription_message import PrescriptionMessage
62
+ from rxfoundry.clients.swifty_api.models.prescription_message_task import PrescriptionMessageTask
63
+ from rxfoundry.clients.swifty_api.models.prescription_message_task_status import PrescriptionMessageTaskStatus
64
+ from rxfoundry.clients.swifty_api.models.prescription_message_task_type import PrescriptionMessageTaskType
65
+ from rxfoundry.clients.swifty_api.models.prescription_message_type import PrescriptionMessageType
42
66
  from rxfoundry.clients.swifty_api.models.prescription_patch import PrescriptionPatch
67
+ from rxfoundry.clients.swifty_api.models.prescription_status_type import PrescriptionStatusType
43
68
  from rxfoundry.clients.swifty_api.models.prescription_task import PrescriptionTask
44
69
  from rxfoundry.clients.swifty_api.models.prescription_task_status import PrescriptionTaskStatus
70
+ from rxfoundry.clients.swifty_api.models.prescription_task_type import PrescriptionTaskType
45
71
  from rxfoundry.clients.swifty_api.models.prescription_transfer_request import PrescriptionTransferRequest
72
+ from rxfoundry.clients.swifty_api.models.prescription_transfer_request_and_response import PrescriptionTransferRequestAndResponse
73
+ from rxfoundry.clients.swifty_api.models.prescription_transfer_request_response import PrescriptionTransferRequestResponse
46
74
  from rxfoundry.clients.swifty_api.models.prescription_verification import PrescriptionVerification
47
75
  from rxfoundry.clients.swifty_api.models.pricing_program import PricingProgram
48
- from rxfoundry.clients.swifty_api.models.surescripts_message import SurescriptsMessage
76
+ from rxfoundry.clients.swifty_api.models.status_type import StatusType
49
77
  from rxfoundry.clients.swifty_api.models.token import Token
50
78
  from rxfoundry.clients.swifty_api.models.user import User
51
79
  from rxfoundry.clients.swifty_api.models.version import Version
52
80
  from rxfoundry.clients.swifty_api.models.virtual_pharmacy import VirtualPharmacy
81
+ from rxfoundry.clients.swifty_api.models.workflow import Workflow
53
82
  from rxfoundry.clients.swifty_api.models.workflow_request import WorkflowRequest
83
+ from rxfoundry.clients.swifty_api.models.workflow_task import WorkflowTask
84
+ from rxfoundry.clients.swifty_api.models.workflow_task_task import WorkflowTaskTask
85
+ from rxfoundry.clients.swifty_api.models.workflow_type import WorkflowType
@@ -18,8 +18,9 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from typing_extensions import Annotated
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
25
26
 
@@ -28,15 +29,15 @@ class Address(BaseModel):
28
29
  Address
29
30
  """ # noqa: E501
30
31
  uuid: Optional[StrictStr] = None
31
- address_line_one: Optional[StrictStr] = None
32
- address_line_two: Optional[StrictStr] = None
33
- city: Optional[StrictStr] = None
34
- state_province: Optional[StrictStr] = None
35
- postal_code: Optional[StrictStr] = None
36
- country_code: Optional[StrictStr] = None
37
- longitude: Optional[Union[StrictFloat, StrictInt]] = None
38
- latitude: Optional[Union[StrictFloat, StrictInt]] = None
39
- distance: Optional[Union[StrictFloat, StrictInt]] = None
32
+ address_line_one: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The first line of the address")
33
+ address_line_two: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The second line of the address")
34
+ city: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The city")
35
+ state_province: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The state or province using the two alphabetic character abbreviation (e.g. TX, CA, NY)")
36
+ postal_code: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The postal code in 5 digit format")
37
+ country_code: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The country code using the two alphabetic character abbreviation (e.g. US, CA, GB)")
38
+ longitude: Optional[Union[Annotated[float, Field(strict=True)], Annotated[int, Field(strict=True)]]] = Field(default=None, description="The longitude of the address")
39
+ latitude: Optional[Union[Annotated[float, Field(strict=True)], Annotated[int, Field(strict=True)]]] = Field(default=None, description="The latitude of the address")
40
+ distance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The distance in miles from this address to another lat/lon passed in during search. This is a derived field, not a field that is stored in the database.")
40
41
  __properties: ClassVar[List[str]] = ["uuid", "address_line_one", "address_line_two", "city", "state_province", "postal_code", "country_code", "longitude", "latitude", "distance"]
41
42
 
42
43
  model_config = ConfigDict(
@@ -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 CodeType(BaseModel):
27
+ """
28
+ CodeType
29
+ """ # noqa: E501
30
+ uuid: Optional[StrictStr] = None
31
+ type_name: Optional[StrictStr] = None
32
+ description: Optional[StrictStr] = None
33
+ __properties: ClassVar[List[str]] = ["uuid", "type_name", "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 CodeType 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 CodeType 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
+ "type_name": obj.get("type_name"),
88
+ "description": obj.get("description")
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ SwiftyRX API
5
+
6
+ API for the SwiftyRX Backend
7
+
8
+ The version of the OpenAPI document: 0.1.DEV-0
9
+ Contact: paul.tindall@rxfoundry.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, 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 Formulary(BaseModel):
27
+ """
28
+ Formulary
29
+ """ # noqa: E501
30
+ uuid: Optional[StrictStr] = None
31
+ name: Optional[StrictStr] = Field(default=None, description="The name of the formulary")
32
+ description: Optional[StrictStr] = Field(default=None, description="The description of the formulary")
33
+ is_active: Optional[StrictBool] = Field(default=None, description="Whether the formulary is active")
34
+ is_default: Optional[StrictBool] = Field(default=None, description="Whether the formulary is the default formulary")
35
+ __properties: ClassVar[List[str]] = ["uuid", "name", "description", "is_active", "is_default"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of Formulary from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of Formulary from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "uuid": obj.get("uuid"),
89
+ "name": obj.get("name"),
90
+ "description": obj.get("description"),
91
+ "is_active": obj.get("is_active"),
92
+ "is_default": obj.get("is_default")
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ SwiftyRX API
5
+
6
+ API for the SwiftyRX Backend
7
+
8
+ The version of the OpenAPI document: 0.1.DEV-0
9
+ Contact: paul.tindall@rxfoundry.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class Insurance(BaseModel):
27
+ """
28
+ Insurance
29
+ """ # noqa: E501
30
+ uuid: Optional[StrictStr] = None
31
+ member_id: Optional[StrictStr] = None
32
+ rx_bin: Optional[StrictStr] = None
33
+ rx_pcn: Optional[StrictStr] = None
34
+ rx_group: Optional[StrictStr] = None
35
+ __properties: ClassVar[List[str]] = ["uuid", "member_id", "rx_bin", "rx_pcn", "rx_group"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of Insurance from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of Insurance from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "uuid": obj.get("uuid"),
89
+ "member_id": obj.get("member_id"),
90
+ "rx_bin": obj.get("rx_bin"),
91
+ "rx_pcn": obj.get("rx_pcn"),
92
+ "rx_group": obj.get("rx_group")
93
+ })
94
+ return _obj
95
+
96
+
@@ -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, Field, StrictInt, 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 MedicationInstruction(BaseModel):
27
+ """
28
+ MedicationInstruction
29
+ """ # noqa: E501
30
+ id: Optional[StrictStr] = Field(default=None, description="The id of the instruction (in Typesense...may change over time)")
31
+ instruction_text: Optional[StrictStr] = Field(default=None, description="The instruction text for the medication")
32
+ usage_count: Optional[StrictInt] = Field(default=None, description="The number of times the instruction has been used")
33
+ __properties: ClassVar[List[str]] = ["id", "instruction_text", "usage_count"]
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 MedicationInstruction 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 MedicationInstruction 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
+ "id": obj.get("id"),
87
+ "instruction_text": obj.get("instruction_text"),
88
+ "usage_count": obj.get("usage_count")
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,100 @@
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, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class MedicationRef(BaseModel):
27
+ """
28
+ MedicationRef
29
+ """ # noqa: E501
30
+ reference: Optional[StrictStr] = 'The reference to the medication in the external system'
31
+ reference_type: Optional[StrictStr] = None
32
+ __properties: ClassVar[List[str]] = ["reference", "reference_type"]
33
+
34
+ @field_validator('reference_type')
35
+ def reference_type_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value is None:
38
+ return value
39
+
40
+ if value not in set(['UUID', 'GPI', 'NDC', 'SCD', 'SBD']):
41
+ raise ValueError("must be one of enum values ('UUID', 'GPI', 'NDC', 'SCD', 'SBD')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of MedicationRef from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of MedicationRef 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
+ "reference": obj.get("reference") if obj.get("reference") is not None else 'The reference to the medication in the external system',
96
+ "reference_type": obj.get("reference_type")
97
+ })
98
+ return _obj
99
+
100
+