maleo-enums 0.0.28__py3-none-any.whl → 0.0.32__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.
maleo/enums/medical.py CHANGED
@@ -1,9 +1,10 @@
1
1
  from enum import StrEnum
2
- from typing import List, Optional, Sequence, TypeVar
3
- from maleo.types.string import ListOfStrings
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.string import ListOfStrs
4
5
 
5
6
 
6
- class Role(StrEnum):
7
+ class MedicalRole(StrEnum):
7
8
  # Level 1: Director category
8
9
  DIRECTOR = "director"
9
10
  PRESIDENT = "president"
@@ -72,48 +73,94 @@ class Role(StrEnum):
72
73
  NUTRITIONIST = "nutritionist"
73
74
 
74
75
  @classmethod
75
- def choices(cls) -> ListOfStrings:
76
+ def choices(cls) -> ListOfStrs:
76
77
  return [e.value for e in cls]
77
78
 
78
79
 
79
- RoleT = TypeVar("RoleT", bound=Role)
80
- OptionalRole = Optional[Role]
81
- OptionalRoleT = TypeVar("OptionalRoleT", bound=OptionalRole)
82
- ListOfRoles = List[Role]
83
- ListOfRolesT = TypeVar("ListOfRolesT", bound=ListOfRoles)
84
- OptionalListOfRoles = Optional[ListOfRoles]
85
- OptionalListOfRolesT = TypeVar("OptionalListOfRolesT", bound=OptionalListOfRoles)
86
- SequenceOfRoles = Sequence[Role]
87
- SequenceOfRolesT = TypeVar("SequenceOfRolesT", bound=SequenceOfRoles)
88
- OptionalSequenceOfRoles = Optional[SequenceOfRoles]
89
- OptionalSequenceOfRolesT = TypeVar(
90
- "OptionalSequenceOfRolesT", bound=OptionalSequenceOfRoles
91
- )
80
+ MedicalRoleT = TypeVar("MedicalRoleT", bound=MedicalRole)
81
+ OptMedicalRole = MedicalRole | None
82
+ OptMedicalRoleT = TypeVar("OptMedicalRoleT", bound=OptMedicalRole)
83
+
84
+
85
+ class SimpleMedicalRoleMixin(BaseModel, Generic[OptMedicalRoleT]):
86
+ role: Annotated[OptMedicalRoleT, Field(..., description="Medical Role")]
87
+
88
+
89
+ class FullMedicalRoleMixin(BaseModel, Generic[OptMedicalRoleT]):
90
+ medical_role: Annotated[OptMedicalRoleT, Field(..., description="Medical Role")]
91
+
92
+
93
+ ListOfMedicalRoles = list[MedicalRole]
94
+ ListOfMedicalRolesT = TypeVar("ListOfMedicalRolesT", bound=ListOfMedicalRoles)
95
+ OptListOfMedicalRoles = ListOfMedicalRoles | None
96
+ OptListOfMedicalRolesT = TypeVar("OptListOfMedicalRolesT", bound=OptListOfMedicalRoles)
97
+
98
+
99
+ class SimpleMedicalRolesMixin(BaseModel, Generic[OptListOfMedicalRolesT]):
100
+ roles: Annotated[OptListOfMedicalRolesT, Field(..., description="Medical Roles")]
101
+
102
+
103
+ class FullMedicalRolesMixin(BaseModel, Generic[OptListOfMedicalRolesT]):
104
+ medical_roles: Annotated[
105
+ OptListOfMedicalRolesT, Field(..., description="Medical Roles")
106
+ ]
107
+
108
+
109
+ SeqOfMedicalRoles = Sequence[MedicalRole]
110
+ SeqOfMedicalRolesT = TypeVar("SeqOfMedicalRolesT", bound=SeqOfMedicalRoles)
111
+ OptSeqOfMedicalRoles = SeqOfMedicalRoles | None
112
+ OptSeqOfMedicalRolesT = TypeVar("OptSeqOfMedicalRolesT", bound=OptSeqOfMedicalRoles)
92
113
 
93
114
 
94
- class Service(StrEnum):
115
+ class MedicalService(StrEnum):
95
116
  EMERGENCY = "emergency"
96
117
  INPATIENT = "inpatient"
97
118
  INTENSIVE = "intensive"
98
119
  OUTPATIENT = "outpatient"
99
120
 
100
121
  @classmethod
101
- def choices(cls) -> ListOfStrings:
122
+ def choices(cls) -> ListOfStrs:
102
123
  return [e.value for e in cls]
103
124
 
104
125
 
105
- ServiceT = TypeVar("ServiceT", bound=Service)
106
- OptionalService = Optional[Service]
107
- OptionalServiceT = TypeVar("OptionalServiceT", bound=OptionalService)
108
- ListOfServices = List[Service]
109
- ListOfServicesT = TypeVar("ListOfServicesT", bound=ListOfServices)
110
- OptionalListOfServices = Optional[ListOfServices]
111
- OptionalListOfServicesT = TypeVar(
112
- "OptionalListOfServicesT", bound=OptionalListOfServices
126
+ MedicalServiceT = TypeVar("MedicalServiceT", bound=MedicalService)
127
+ OptMedicalService = MedicalService | None
128
+ OptMedicalServiceT = TypeVar("OptMedicalServiceT", bound=OptMedicalService)
129
+
130
+
131
+ class SimpleMedicalServiceMixin(BaseModel, Generic[OptMedicalServiceT]):
132
+ service: Annotated[OptMedicalServiceT, Field(..., description="Medical Service")]
133
+
134
+
135
+ class FullMedicalServiceMixin(BaseModel, Generic[OptMedicalServiceT]):
136
+ medical_service: Annotated[
137
+ OptMedicalServiceT, Field(..., description="Medical Service")
138
+ ]
139
+
140
+
141
+ ListOfMedicalServices = list[MedicalService]
142
+ ListOfMedicalServicesT = TypeVar("ListOfMedicalServicesT", bound=ListOfMedicalServices)
143
+ OptListOfMedicalServices = ListOfMedicalServices | None
144
+ OptListOfMedicalServicesT = TypeVar(
145
+ "OptListOfMedicalServicesT", bound=OptListOfMedicalServices
113
146
  )
114
- SequenceOfServices = Sequence[Service]
115
- SequenceOfServicesT = TypeVar("SequenceOfServicesT", bound=SequenceOfServices)
116
- OptionalSequenceOfServices = Optional[SequenceOfServices]
117
- OptionalSequenceOfServicesT = TypeVar(
118
- "OptionalSequenceOfServicesT", bound=OptionalSequenceOfServices
147
+
148
+
149
+ class SimpleMedicalServicesMixin(BaseModel, Generic[OptListOfMedicalServicesT]):
150
+ services: Annotated[
151
+ OptListOfMedicalServicesT, Field(..., description="Medical Services")
152
+ ]
153
+
154
+
155
+ class FullMedicalServicesMixin(BaseModel, Generic[OptListOfMedicalServicesT]):
156
+ medical_services: Annotated[
157
+ OptListOfMedicalServicesT, Field(..., description="Medical Services")
158
+ ]
159
+
160
+
161
+ SeqOfMedicalServices = Sequence[MedicalService]
162
+ SeqOfMedicalServicesT = TypeVar("SeqOfMedicalServicesT", bound=SeqOfMedicalServices)
163
+ OptSeqOfMedicalServices = SeqOfMedicalServices | None
164
+ OptSeqOfMedicalServicesT = TypeVar(
165
+ "OptSeqOfMedicalServicesT", bound=OptSeqOfMedicalServices
119
166
  )
maleo/enums/order.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from enum import StrEnum
2
- from typing import List, Optional, Sequence, TypeVar
3
- from maleo.types.string import ListOfStrings
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.string import ListOfStrs
4
5
 
5
6
 
6
7
  class Order(StrEnum):
@@ -8,20 +9,30 @@ class Order(StrEnum):
8
9
  DESC = "desc"
9
10
 
10
11
  @classmethod
11
- def choices(cls) -> ListOfStrings:
12
+ def choices(cls) -> ListOfStrs:
12
13
  return [e.value for e in cls]
13
14
 
14
15
 
15
16
  OrderT = TypeVar("OrderT", bound=Order)
16
- OptionalOrder = Optional[Order]
17
- OptionalOrderT = TypeVar("OptionalOrderT", bound=OptionalOrder)
18
- ListOfOrders = List[Order]
17
+ OptOrder = Order | None
18
+ OptOrderT = TypeVar("OptOrderT", bound=OptOrder)
19
+
20
+
21
+ class OrderMixin(BaseModel, Generic[OptOrderT]):
22
+ order: Annotated[OptOrderT, Field(..., description="Order")]
23
+
24
+
25
+ ListOfOrders = list[Order]
19
26
  ListOfOrdersT = TypeVar("ListOfOrdersT", bound=ListOfOrders)
20
- OptionalListOfOrders = Optional[ListOfOrders]
21
- OptionalListOfOrdersT = TypeVar("OptionalListOfOrdersT", bound=OptionalListOfOrders)
22
- SequenceOfOrders = Sequence[Order]
23
- SequenceOfOrdersT = TypeVar("SequenceOfOrdersT", bound=SequenceOfOrders)
24
- OptionalSequenceOfOrders = Optional[SequenceOfOrders]
25
- OptionalSequenceOfOrdersT = TypeVar(
26
- "OptionalSequenceOfOrdersT", bound=OptionalSequenceOfOrders
27
- )
27
+ OptListOfOrders = ListOfOrders | None
28
+ OptListOfOrdersT = TypeVar("OptListOfOrdersT", bound=OptListOfOrders)
29
+
30
+
31
+ class OrdersMixin(BaseModel, Generic[OptListOfOrdersT]):
32
+ orders: Annotated[OptListOfOrdersT, Field(..., description="Orders")]
33
+
34
+
35
+ SeqOfOrders = Sequence[Order]
36
+ SeqOfOrdersT = TypeVar("SeqOfOrdersT", bound=SeqOfOrders)
37
+ OptSeqOfOrders = SeqOfOrders | None
38
+ OptSeqOfOrdersT = TypeVar("OptSeqOfOrdersT", bound=OptSeqOfOrders)
@@ -1,6 +1,7 @@
1
1
  from enum import StrEnum
2
- from typing import List, Optional, Sequence, TypeVar
3
- from maleo.types.string import ListOfStrings
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.string import ListOfStrs
4
5
 
5
6
 
6
7
  class OrganizationType(StrEnum):
@@ -17,7 +18,7 @@ class OrganizationType(StrEnum):
17
18
  INSURANCE_PROVIDER = "insurance_provider"
18
19
  INTERNAL = "internal"
19
20
  LABORATORY = "laboratory"
20
- MEDICAL_GROUP = "medical_group"
21
+ MEDICAL_GROUP = "organization_group"
21
22
  NETWORK = "network"
22
23
  PARTNER = "partner"
23
24
  PHARMACY = "pharmacy"
@@ -32,34 +33,58 @@ class OrganizationType(StrEnum):
32
33
  VENDOR = "vendor"
33
34
 
34
35
  @classmethod
35
- def choices(cls) -> ListOfStrings:
36
+ def choices(cls) -> ListOfStrs:
36
37
  return [e.value for e in cls]
37
38
 
38
39
 
39
40
  OrganizationTypeT = TypeVar("OrganizationTypeT", bound=OrganizationType)
40
- OptionalOrganizationType = Optional[OrganizationType]
41
- OptionalOrganizationTypeT = TypeVar(
42
- "OptionalOrganizationTypeT", bound=OptionalOrganizationType
43
- )
44
- ListOfOrganizationTypes = List[OrganizationType]
41
+ OptOrganizationType = OrganizationType | None
42
+ OptOrganizationTypeT = TypeVar("OptOrganizationTypeT", bound=OptOrganizationType)
43
+
44
+
45
+ class SimpleOrganizationTypeMixin(BaseModel, Generic[OptOrganizationTypeT]):
46
+ type: Annotated[OptOrganizationTypeT, Field(..., description="Organization Type")]
47
+
48
+
49
+ class FullOrganizationTypeMixin(BaseModel, Generic[OptOrganizationTypeT]):
50
+ organization_type: Annotated[
51
+ OptOrganizationTypeT, Field(..., description="Organization Type")
52
+ ]
53
+
54
+
55
+ ListOfOrganizationTypes = list[OrganizationType]
45
56
  ListOfOrganizationTypesT = TypeVar(
46
57
  "ListOfOrganizationTypesT", bound=ListOfOrganizationTypes
47
58
  )
48
- OptionalListOfOrganizationTypes = Optional[ListOfOrganizationTypes]
49
- OptionalListOfOrganizationTypesT = TypeVar(
50
- "OptionalListOfOrganizationTypesT", bound=OptionalListOfOrganizationTypes
59
+ OptListOfOrganizationTypes = ListOfOrganizationTypes | None
60
+ OptListOfOrganizationTypesT = TypeVar(
61
+ "OptListOfOrganizationTypesT", bound=OptListOfOrganizationTypes
51
62
  )
52
- SequenceOfOrganizationTypes = Sequence[OrganizationType]
53
- SequenceOfOrganizationTypesT = TypeVar(
54
- "SequenceOfOrganizationTypesT", bound=SequenceOfOrganizationTypes
63
+
64
+
65
+ class SimpleOrganizationTypesMixin(BaseModel, Generic[OptListOfOrganizationTypesT]):
66
+ types: Annotated[
67
+ OptListOfOrganizationTypesT, Field(..., description="Organization Types")
68
+ ]
69
+
70
+
71
+ class FullOrganizationTypesMixin(BaseModel, Generic[OptListOfOrganizationTypesT]):
72
+ organization_types: Annotated[
73
+ OptListOfOrganizationTypesT, Field(..., description="Organization Types")
74
+ ]
75
+
76
+
77
+ SeqOfOrganizationTypes = Sequence[OrganizationType]
78
+ SeqOfOrganizationTypesT = TypeVar(
79
+ "SeqOfOrganizationTypesT", bound=SeqOfOrganizationTypes
55
80
  )
56
- OptionalSequenceOfOrganizationTypes = Optional[SequenceOfOrganizationTypes]
57
- OptionalSequenceOfOrganizationTypesT = TypeVar(
58
- "OptionalSequenceOfOrganizationTypesT", bound=OptionalSequenceOfOrganizationTypes
81
+ OptSeqOfOrganizationTypes = SeqOfOrganizationTypes | None
82
+ OptSeqOfOrganizationTypesT = TypeVar(
83
+ "OptSeqOfOrganizationTypesT", bound=OptSeqOfOrganizationTypes
59
84
  )
60
85
 
61
86
 
62
- class Relation(StrEnum):
87
+ class OrganizationRelation(StrEnum):
63
88
  AFFILIATE = "affiliate"
64
89
  APPLICATION = "application"
65
90
  BRANCH = "branch"
@@ -73,47 +98,119 @@ class Relation(StrEnum):
73
98
  VENDOR = "vendor"
74
99
 
75
100
  @classmethod
76
- def choices(cls) -> ListOfStrings:
101
+ def choices(cls) -> ListOfStrs:
77
102
  return [e.value for e in cls]
78
103
 
79
104
 
80
- RelationT = TypeVar("RelationT", bound=Relation)
81
- OptionalRelation = Optional[Relation]
82
- OptionalRelationT = TypeVar("OptionalRelationT", bound=OptionalRelation)
83
- ListOfRelations = List[Relation]
84
- ListOfRelationsT = TypeVar("ListOfRelationsT", bound=ListOfRelations)
85
- OptionalListOfRelations = Optional[ListOfRelations]
86
- OptionalListOfRelationsT = TypeVar(
87
- "OptionalListOfRelationsT", bound=OptionalListOfRelations
105
+ OrganizationRelationT = TypeVar("OrganizationRelationT", bound=OrganizationRelation)
106
+ OptOrganizationRelation = OrganizationRelation | None
107
+ OptOrganizationRelationT = TypeVar(
108
+ "OptOrganizationRelationT", bound=OptOrganizationRelation
88
109
  )
89
- SequenceOfRelations = Sequence[Relation]
90
- SequenceOfRelationsT = TypeVar("SequenceOfRelationsT", bound=SequenceOfRelations)
91
- OptionalSequenceOfRelations = Optional[SequenceOfRelations]
92
- OptionalSequenceOfRelationsT = TypeVar(
93
- "OptionalSequenceOfRelationsT", bound=OptionalSequenceOfRelations
110
+
111
+
112
+ class SimpleOrganizationRelationMixin(BaseModel, Generic[OptOrganizationRelationT]):
113
+ relation: Annotated[
114
+ OptOrganizationRelationT, Field(..., description="Organization Relation")
115
+ ]
116
+
117
+
118
+ class FullOrganizationRelationMixin(BaseModel, Generic[OptOrganizationRelationT]):
119
+ organization_relation: Annotated[
120
+ OptOrganizationRelationT, Field(..., description="Organization Relation")
121
+ ]
122
+
123
+
124
+ ListOfOrganizationRelations = list[OrganizationRelation]
125
+ ListOfOrganizationRelationsT = TypeVar(
126
+ "ListOfOrganizationRelationsT", bound=ListOfOrganizationRelations
127
+ )
128
+ OptListOfOrganizationRelations = ListOfOrganizationRelations | None
129
+ OptListOfOrganizationRelationsT = TypeVar(
130
+ "OptListOfOrganizationRelationsT", bound=OptListOfOrganizationRelations
94
131
  )
95
132
 
96
133
 
97
- class Role(StrEnum):
134
+ class SimpleOrganizationRelationsMixin(
135
+ BaseModel, Generic[OptListOfOrganizationRelationsT]
136
+ ):
137
+ relations: Annotated[
138
+ OptListOfOrganizationRelationsT,
139
+ Field(..., description="Organization Relations"),
140
+ ]
141
+
142
+
143
+ class FullOrganizationRelationsMixin(
144
+ BaseModel, Generic[OptListOfOrganizationRelationsT]
145
+ ):
146
+ organization_relations: Annotated[
147
+ OptListOfOrganizationRelationsT,
148
+ Field(..., description="Organization Relations"),
149
+ ]
150
+
151
+
152
+ SeqOfOrganizationRelations = Sequence[OrganizationRelation]
153
+ SeqOfOrganizationRelationsT = TypeVar(
154
+ "SeqOfOrganizationRelationsT", bound=SeqOfOrganizationRelations
155
+ )
156
+ OptSeqOfOrganizationRelations = SeqOfOrganizationRelations | None
157
+ OptSeqOfOrganizationRelationsT = TypeVar(
158
+ "OptSeqOfOrganizationRelationsT", bound=OptSeqOfOrganizationRelations
159
+ )
160
+
161
+
162
+ class OrganizationRole(StrEnum):
98
163
  OWNER = "owner"
99
164
  ADMINISTRATOR = "administrator"
100
165
  USER = "user"
101
166
 
102
167
  @classmethod
103
- def choices(cls) -> ListOfStrings:
168
+ def choices(cls) -> ListOfStrs:
104
169
  return [e.value for e in cls]
105
170
 
106
171
 
107
- RoleT = TypeVar("RoleT", bound=Role)
108
- OptionalRole = Optional[Role]
109
- OptionalRoleT = TypeVar("OptionalRoleT", bound=OptionalRole)
110
- ListOfRoles = List[Role]
111
- ListOfRolesT = TypeVar("ListOfRolesT", bound=ListOfRoles)
112
- OptionalListOfRoles = Optional[ListOfRoles]
113
- OptionalListOfRolesT = TypeVar("OptionalListOfRolesT", bound=OptionalListOfRoles)
114
- SequenceOfRoles = Sequence[Role]
115
- SequenceOfRolesT = TypeVar("SequenceOfRolesT", bound=SequenceOfRoles)
116
- OptionalSequenceOfRoles = Optional[SequenceOfRoles]
117
- OptionalSequenceOfRolesT = TypeVar(
118
- "OptionalSequenceOfRolesT", bound=OptionalSequenceOfRoles
172
+ OrganizationRoleT = TypeVar("OrganizationRoleT", bound=OrganizationRole)
173
+ OptOrganizationRole = OrganizationRole | None
174
+ OptOrganizationRoleT = TypeVar("OptOrganizationRoleT", bound=OptOrganizationRole)
175
+
176
+
177
+ class SimpleOrganizationRoleMixin(BaseModel, Generic[OptOrganizationRoleT]):
178
+ role: Annotated[OptOrganizationRoleT, Field(..., description="Organization Role")]
179
+
180
+
181
+ class FullOrganizationRoleMixin(BaseModel, Generic[OptOrganizationRoleT]):
182
+ organization_role: Annotated[
183
+ OptOrganizationRoleT, Field(..., description="Organization Role")
184
+ ]
185
+
186
+
187
+ ListOfOrganizationRoles = list[OrganizationRole]
188
+ ListOfOrganizationRolesT = TypeVar(
189
+ "ListOfOrganizationRolesT", bound=ListOfOrganizationRoles
190
+ )
191
+ OptListOfOrganizationRoles = ListOfOrganizationRoles | None
192
+ OptListOfOrganizationRolesT = TypeVar(
193
+ "OptListOfOrganizationRolesT", bound=OptListOfOrganizationRoles
194
+ )
195
+
196
+
197
+ class SimpleOrganizationRolesMixin(BaseModel, Generic[OptListOfOrganizationRolesT]):
198
+ roles: Annotated[
199
+ OptListOfOrganizationRolesT, Field(..., description="Organization Roles")
200
+ ]
201
+
202
+
203
+ class FullOrganizationRolesMixin(BaseModel, Generic[OptListOfOrganizationRolesT]):
204
+ organization_roles: Annotated[
205
+ OptListOfOrganizationRolesT, Field(..., description="Organization Roles")
206
+ ]
207
+
208
+
209
+ SeqOfOrganizationRoles = Sequence[OrganizationRole]
210
+ SeqOfOrganizationRolesT = TypeVar(
211
+ "SeqOfOrganizationRolesT", bound=SeqOfOrganizationRoles
212
+ )
213
+ OptSeqOfOrganizationRoles = SeqOfOrganizationRoles | None
214
+ OptSeqOfOrganizationRolesT = TypeVar(
215
+ "OptSeqOfOrganizationRolesT", bound=OptSeqOfOrganizationRoles
119
216
  )