maleo-identity 0.1.2__py3-none-any.whl → 0.1.3__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.
Potentially problematic release.
This version of maleo-identity might be problematic. Click here for more details.
- maleo/identity/dtos.py +21 -27
- maleo/identity/enums/patient.py +9 -0
- maleo/identity/mixins/organization_relation.py +2 -4
- maleo/identity/mixins/patient.py +15 -3
- maleo/identity/schemas/common.py +22 -28
- maleo/identity/schemas/organization.py +3 -3
- maleo/identity/schemas/organization_relation.py +4 -4
- maleo/identity/schemas/patient.py +10 -15
- maleo/identity/schemas/user.py +3 -3
- maleo/identity/schemas/user_profile.py +3 -3
- {maleo_identity-0.1.2.dist-info → maleo_identity-0.1.3.dist-info}/METADATA +1 -1
- {maleo_identity-0.1.2.dist-info → maleo_identity-0.1.3.dist-info}/RECORD +15 -17
- maleo/identity/validators/__init__.py +0 -0
- maleo/identity/validators/patient.py +0 -6
- {maleo_identity-0.1.2.dist-info → maleo_identity-0.1.3.dist-info}/WHEEL +0 -0
- {maleo_identity-0.1.2.dist-info → maleo_identity-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {maleo_identity-0.1.2.dist-info → maleo_identity-0.1.3.dist-info}/top_level.txt +0 -0
maleo/identity/dtos.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import date
|
|
2
|
-
from pydantic import BaseModel, Field
|
|
3
|
-
from typing import Annotated, Generic,
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from typing import Annotated, Generic, TypeVar, Type
|
|
4
4
|
from maleo.enums.identity import (
|
|
5
5
|
OptBloodType,
|
|
6
6
|
BloodTypeMixin,
|
|
@@ -27,14 +27,14 @@ from maleo.schemas.mixins.identity import (
|
|
|
27
27
|
BirthDate,
|
|
28
28
|
DateOfBirth,
|
|
29
29
|
)
|
|
30
|
-
from maleo.schemas.mixins.timestamp import
|
|
30
|
+
from maleo.schemas.mixins.timestamp import LifecycleTimestamp
|
|
31
31
|
from maleo.types.datetime import OptDate
|
|
32
32
|
from maleo.types.string import OptStr
|
|
33
33
|
from .mixins.common import IdCard, FullName, BirthPlace, PlaceOfBirth
|
|
34
34
|
from .mixins.organization_registration_code import Code, MaxUses, CurrentUses
|
|
35
|
-
from .mixins.organization_relation import IsBidirectional,
|
|
35
|
+
from .mixins.organization_relation import IsBidirectional, Meta
|
|
36
36
|
from .mixins.organization import Key as OrganizationKey, Name as OrganizationName
|
|
37
|
-
from .mixins.patient import
|
|
37
|
+
from .mixins.patient import PatientIdentifier
|
|
38
38
|
from .mixins.user_profile import (
|
|
39
39
|
LeadingTitle,
|
|
40
40
|
FirstName,
|
|
@@ -44,7 +44,6 @@ from .mixins.user_profile import (
|
|
|
44
44
|
AvatarName,
|
|
45
45
|
)
|
|
46
46
|
from .mixins.user import Username, Email, Phone
|
|
47
|
-
from .validators.patient import validate_id_card_or_passport
|
|
48
47
|
|
|
49
48
|
|
|
50
49
|
class PatientDTO(
|
|
@@ -54,17 +53,12 @@ class PatientDTO(
|
|
|
54
53
|
DateOfBirth[date],
|
|
55
54
|
PlaceOfBirth[OptStr],
|
|
56
55
|
FullName[str],
|
|
57
|
-
|
|
58
|
-
IdCard[OptStr],
|
|
59
|
-
IntOrganizationId[int],
|
|
56
|
+
PatientIdentifier,
|
|
60
57
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
61
|
-
|
|
58
|
+
LifecycleTimestamp,
|
|
62
59
|
DataIdentifier,
|
|
63
60
|
):
|
|
64
|
-
|
|
65
|
-
def chk_id_card_or_passport(self) -> Self:
|
|
66
|
-
validate_id_card_or_passport(self.id_card, self.passport)
|
|
67
|
-
return self
|
|
61
|
+
pass
|
|
68
62
|
|
|
69
63
|
|
|
70
64
|
class OrganizationRegistrationCodeDTO(
|
|
@@ -73,7 +67,7 @@ class OrganizationRegistrationCodeDTO(
|
|
|
73
67
|
Code[str],
|
|
74
68
|
IntOrganizationId[int],
|
|
75
69
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
76
|
-
|
|
70
|
+
LifecycleTimestamp,
|
|
77
71
|
DataIdentifier,
|
|
78
72
|
):
|
|
79
73
|
pass
|
|
@@ -94,7 +88,7 @@ class StandardOrganizationDTO(
|
|
|
94
88
|
OrganizationKey[str],
|
|
95
89
|
FullOrganizationTypeMixin[OrganizationType],
|
|
96
90
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
97
|
-
|
|
91
|
+
LifecycleTimestamp,
|
|
98
92
|
DataIdentifier,
|
|
99
93
|
):
|
|
100
94
|
pass
|
|
@@ -107,11 +101,11 @@ class SourceOrganizationDTOMixin(BaseModel):
|
|
|
107
101
|
|
|
108
102
|
|
|
109
103
|
class SourceOrganizationRelationDTO(
|
|
110
|
-
|
|
104
|
+
Meta,
|
|
111
105
|
IsBidirectional[bool],
|
|
112
106
|
SourceOrganizationDTOMixin,
|
|
113
107
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
114
|
-
|
|
108
|
+
LifecycleTimestamp,
|
|
115
109
|
DataIdentifier,
|
|
116
110
|
):
|
|
117
111
|
pass
|
|
@@ -131,11 +125,11 @@ class TargetOrganizationDTOMixin(BaseModel):
|
|
|
131
125
|
|
|
132
126
|
|
|
133
127
|
class TargetOrganizationRelationDTO(
|
|
134
|
-
|
|
128
|
+
Meta,
|
|
135
129
|
IsBidirectional[bool],
|
|
136
130
|
TargetOrganizationDTOMixin,
|
|
137
131
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
138
|
-
|
|
132
|
+
LifecycleTimestamp,
|
|
139
133
|
DataIdentifier,
|
|
140
134
|
):
|
|
141
135
|
pass
|
|
@@ -171,7 +165,7 @@ class UserMedicalRoleDTO(
|
|
|
171
165
|
IntOrganizationId[int],
|
|
172
166
|
IntUserId[int],
|
|
173
167
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
174
|
-
|
|
168
|
+
LifecycleTimestamp,
|
|
175
169
|
DataIdentifier,
|
|
176
170
|
):
|
|
177
171
|
pass
|
|
@@ -189,7 +183,7 @@ class UserOrganizationRoleDTO(
|
|
|
189
183
|
IntOrganizationId[int],
|
|
190
184
|
IntUserId[int],
|
|
191
185
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
192
|
-
|
|
186
|
+
LifecycleTimestamp,
|
|
193
187
|
DataIdentifier,
|
|
194
188
|
):
|
|
195
189
|
pass
|
|
@@ -217,7 +211,7 @@ class UserProfileDTO(
|
|
|
217
211
|
IdCard[OptStr],
|
|
218
212
|
IntUserId[int],
|
|
219
213
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
220
|
-
|
|
214
|
+
LifecycleTimestamp,
|
|
221
215
|
DataIdentifier,
|
|
222
216
|
):
|
|
223
217
|
pass
|
|
@@ -236,7 +230,7 @@ class UserSystemRoleDTO(
|
|
|
236
230
|
FullSystemRoleMixin[SystemRole],
|
|
237
231
|
IntUserId[int],
|
|
238
232
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
239
|
-
|
|
233
|
+
LifecycleTimestamp,
|
|
240
234
|
DataIdentifier,
|
|
241
235
|
):
|
|
242
236
|
pass
|
|
@@ -260,7 +254,7 @@ class StandardUserDTO(
|
|
|
260
254
|
Username[str],
|
|
261
255
|
FullUserTypeMixin[UserType],
|
|
262
256
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
263
|
-
|
|
257
|
+
LifecycleTimestamp,
|
|
264
258
|
DataIdentifier,
|
|
265
259
|
):
|
|
266
260
|
pass
|
|
@@ -271,7 +265,7 @@ class UserOrganizationDTO(
|
|
|
271
265
|
UserOrganizationRolesDTOMixin,
|
|
272
266
|
OrganizationDTOMixin[StandardOrganizationDTO],
|
|
273
267
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
274
|
-
|
|
268
|
+
LifecycleTimestamp,
|
|
275
269
|
DataIdentifier,
|
|
276
270
|
):
|
|
277
271
|
pass
|
|
@@ -303,7 +297,7 @@ class UserAndOrganizationDTO(
|
|
|
303
297
|
OrganizationDTOMixin[StandardOrganizationDTO],
|
|
304
298
|
UserDTOMixin[StandardUserDTO],
|
|
305
299
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
306
|
-
|
|
300
|
+
LifecycleTimestamp,
|
|
307
301
|
DataIdentifier,
|
|
308
302
|
):
|
|
309
303
|
pass
|
maleo/identity/enums/patient.py
CHANGED
|
@@ -2,6 +2,15 @@ from enum import StrEnum
|
|
|
2
2
|
from maleo.types.string import ListOfStrs
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
class Granularity(StrEnum):
|
|
6
|
+
STANDARD = "standard"
|
|
7
|
+
FULL = "full"
|
|
8
|
+
|
|
9
|
+
@classmethod
|
|
10
|
+
def choices(cls) -> ListOfStrs:
|
|
11
|
+
return [e.value for e in cls]
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
class IdentifierType(StrEnum):
|
|
6
15
|
ID = "id"
|
|
7
16
|
UUID = "uuid"
|
|
@@ -8,7 +8,5 @@ class IsBidirectional(BaseModel, Generic[OptBoolT]):
|
|
|
8
8
|
is_bidirectional: Annotated[OptBoolT, Field(..., description="Is Bidirectional")]
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
12
|
-
|
|
13
|
-
OptListOfAnyOrStrToAnyDict, Field(None, description="Metadata")
|
|
14
|
-
] = None
|
|
11
|
+
class Meta(BaseModel):
|
|
12
|
+
meta: Annotated[OptListOfAnyOrStrToAnyDict, Field(None, description="Meta")] = None
|
maleo/identity/mixins/patient.py
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
from typing import Annotated, Generic
|
|
1
|
+
from pydantic import Field, model_validator
|
|
2
|
+
from typing import Annotated, Generic, Self
|
|
3
3
|
from maleo.schemas.mixins.identity import Passport as BasePassport
|
|
4
|
-
from maleo.types.string import OptStrT
|
|
4
|
+
from maleo.types.string import OptStr, OptStrT
|
|
5
|
+
from .common import IdCard
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class Passport(BasePassport, Generic[OptStrT]):
|
|
8
9
|
passport: Annotated[OptStrT, Field(..., description="Passport", max_length=9)]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PatientIdentifier(
|
|
13
|
+
Passport[OptStr],
|
|
14
|
+
IdCard[OptStr],
|
|
15
|
+
):
|
|
16
|
+
@model_validator(mode="after")
|
|
17
|
+
def chk_id_card_or_passport(self) -> Self:
|
|
18
|
+
if self.id_card is None and self.passport is None:
|
|
19
|
+
raise ValueError("Either ID Card or Passport must exist")
|
|
20
|
+
return self
|
maleo/identity/schemas/common.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import date
|
|
2
|
-
from pydantic import BaseModel, Field
|
|
3
|
-
from typing import Annotated, Generic,
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from typing import Annotated, Generic, TypeVar, Type
|
|
4
4
|
from maleo.enums.identity import OptRhesus, RhesusMixin
|
|
5
5
|
from maleo.metadata.schemas.organization_role import (
|
|
6
6
|
FullOrganizationRoleMixin,
|
|
@@ -39,16 +39,16 @@ from maleo.schemas.mixins.identity import (
|
|
|
39
39
|
BirthDate,
|
|
40
40
|
DateOfBirth,
|
|
41
41
|
)
|
|
42
|
-
from maleo.schemas.mixins.timestamp import
|
|
42
|
+
from maleo.schemas.mixins.timestamp import LifecycleTimestamp
|
|
43
43
|
from maleo.types.datetime import OptDate
|
|
44
44
|
from maleo.types.integer import OptInt
|
|
45
45
|
from maleo.types.string import OptStr
|
|
46
46
|
from ..mixins.common import IdCard, FullName, BirthPlace, PlaceOfBirth
|
|
47
47
|
from ..mixins.api_key import APIKey
|
|
48
48
|
from ..mixins.organization_registration_code import Code, MaxUses, CurrentUses
|
|
49
|
-
from ..mixins.organization_relation import IsBidirectional,
|
|
49
|
+
from ..mixins.organization_relation import IsBidirectional, Meta
|
|
50
50
|
from ..mixins.organization import Key as OrganizationKey, Name as OrganizationName
|
|
51
|
-
from ..mixins.patient import
|
|
51
|
+
from ..mixins.patient import PatientIdentifier
|
|
52
52
|
from ..mixins.user_profile import (
|
|
53
53
|
LeadingTitle,
|
|
54
54
|
FirstName,
|
|
@@ -58,7 +58,6 @@ from ..mixins.user_profile import (
|
|
|
58
58
|
AvatarUrl,
|
|
59
59
|
)
|
|
60
60
|
from ..mixins.user import Username, Email, Phone
|
|
61
|
-
from ..validators.patient import validate_id_card_or_passport
|
|
62
61
|
|
|
63
62
|
|
|
64
63
|
class APIKeySchema(
|
|
@@ -66,7 +65,7 @@ class APIKeySchema(
|
|
|
66
65
|
IntOrganizationId[OptInt],
|
|
67
66
|
IntUserId[int],
|
|
68
67
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
69
|
-
|
|
68
|
+
LifecycleTimestamp,
|
|
70
69
|
DataIdentifier,
|
|
71
70
|
):
|
|
72
71
|
pass
|
|
@@ -79,17 +78,12 @@ class PatientSchema(
|
|
|
79
78
|
DateOfBirth[date],
|
|
80
79
|
PlaceOfBirth[OptStr],
|
|
81
80
|
FullName[str],
|
|
82
|
-
|
|
83
|
-
IdCard[OptStr],
|
|
84
|
-
IntOrganizationId[int],
|
|
81
|
+
PatientIdentifier,
|
|
85
82
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
86
|
-
|
|
83
|
+
LifecycleTimestamp,
|
|
87
84
|
DataIdentifier,
|
|
88
85
|
):
|
|
89
|
-
|
|
90
|
-
def chk_id_card_or_passport(self) -> Self:
|
|
91
|
-
validate_id_card_or_passport(self.id_card, self.passport)
|
|
92
|
-
return self
|
|
86
|
+
pass
|
|
93
87
|
|
|
94
88
|
|
|
95
89
|
class OrganizationRegistrationCodeSchema(
|
|
@@ -98,7 +92,7 @@ class OrganizationRegistrationCodeSchema(
|
|
|
98
92
|
Code[str],
|
|
99
93
|
IntOrganizationId[int],
|
|
100
94
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
101
|
-
|
|
95
|
+
LifecycleTimestamp,
|
|
102
96
|
DataIdentifier,
|
|
103
97
|
):
|
|
104
98
|
pass
|
|
@@ -119,7 +113,7 @@ class StandardOrganizationSchema(
|
|
|
119
113
|
OrganizationKey[str],
|
|
120
114
|
FullOrganizationTypeMixin[KeyOrStandardOrganizationTypeSchema],
|
|
121
115
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
122
|
-
|
|
116
|
+
LifecycleTimestamp,
|
|
123
117
|
DataIdentifier,
|
|
124
118
|
):
|
|
125
119
|
pass
|
|
@@ -132,11 +126,11 @@ class SourceOrganizationSchemaMixin(BaseModel):
|
|
|
132
126
|
|
|
133
127
|
|
|
134
128
|
class SourceOrganizationRelationSchema(
|
|
135
|
-
|
|
129
|
+
Meta,
|
|
136
130
|
IsBidirectional[bool],
|
|
137
131
|
SourceOrganizationSchemaMixin,
|
|
138
132
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
139
|
-
|
|
133
|
+
LifecycleTimestamp,
|
|
140
134
|
DataIdentifier,
|
|
141
135
|
):
|
|
142
136
|
pass
|
|
@@ -156,11 +150,11 @@ class TargetOrganizationSchemaMixin(BaseModel):
|
|
|
156
150
|
|
|
157
151
|
|
|
158
152
|
class TargetOrganizationRelationSchema(
|
|
159
|
-
|
|
153
|
+
Meta,
|
|
160
154
|
IsBidirectional[bool],
|
|
161
155
|
TargetOrganizationSchemaMixin,
|
|
162
156
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
163
|
-
|
|
157
|
+
LifecycleTimestamp,
|
|
164
158
|
DataIdentifier,
|
|
165
159
|
):
|
|
166
160
|
pass
|
|
@@ -200,7 +194,7 @@ class UserMedicalRoleSchema(
|
|
|
200
194
|
IntOrganizationId[int],
|
|
201
195
|
IntUserId[int],
|
|
202
196
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
203
|
-
|
|
197
|
+
LifecycleTimestamp,
|
|
204
198
|
DataIdentifier,
|
|
205
199
|
):
|
|
206
200
|
pass
|
|
@@ -218,7 +212,7 @@ class UserOrganizationRoleSchema(
|
|
|
218
212
|
IntOrganizationId[int],
|
|
219
213
|
IntUserId[int],
|
|
220
214
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
221
|
-
|
|
215
|
+
LifecycleTimestamp,
|
|
222
216
|
DataIdentifier,
|
|
223
217
|
):
|
|
224
218
|
pass
|
|
@@ -246,7 +240,7 @@ class UserProfileSchema(
|
|
|
246
240
|
IdCard[OptStr],
|
|
247
241
|
IntUserId[int],
|
|
248
242
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
249
|
-
|
|
243
|
+
LifecycleTimestamp,
|
|
250
244
|
DataIdentifier,
|
|
251
245
|
):
|
|
252
246
|
pass
|
|
@@ -265,7 +259,7 @@ class UserSystemRoleSchema(
|
|
|
265
259
|
FullSystemRoleMixin[KeyOrStandardSystemRoleSchema],
|
|
266
260
|
IntUserId[int],
|
|
267
261
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
268
|
-
|
|
262
|
+
LifecycleTimestamp,
|
|
269
263
|
DataIdentifier,
|
|
270
264
|
):
|
|
271
265
|
pass
|
|
@@ -289,7 +283,7 @@ class StandardUserSchema(
|
|
|
289
283
|
Username[str],
|
|
290
284
|
FullUserTypeMixin[KeyOrStandardUserTypeSchema],
|
|
291
285
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
292
|
-
|
|
286
|
+
LifecycleTimestamp,
|
|
293
287
|
DataIdentifier,
|
|
294
288
|
):
|
|
295
289
|
pass
|
|
@@ -300,7 +294,7 @@ class UserOrganizationSchema(
|
|
|
300
294
|
UserOrganizationRolesSchemaMixin,
|
|
301
295
|
OrganizationSchemaMixin[StandardOrganizationSchema],
|
|
302
296
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
303
|
-
|
|
297
|
+
LifecycleTimestamp,
|
|
304
298
|
DataIdentifier,
|
|
305
299
|
):
|
|
306
300
|
pass
|
|
@@ -332,7 +326,7 @@ class UserAndOrganizationSchema(
|
|
|
332
326
|
OrganizationSchemaMixin[StandardOrganizationSchema],
|
|
333
327
|
UserSchemaMixin[StandardUserSchema],
|
|
334
328
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
335
|
-
|
|
329
|
+
LifecycleTimestamp,
|
|
336
330
|
DataIdentifier,
|
|
337
331
|
):
|
|
338
332
|
pass
|
|
@@ -38,9 +38,9 @@ from ..types.organization import IdentifierValueType
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
class Expand(BaseModel):
|
|
41
|
-
expand: Annotated[
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
expand: Annotated[OptListOfExpandableFields, Field(None, description="Expand")] = (
|
|
42
|
+
None
|
|
43
|
+
)
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class CreateQuery(Expand):
|
|
@@ -33,12 +33,12 @@ from maleo.types.dict import StrToAnyDict
|
|
|
33
33
|
from maleo.types.integer import OptListOfInts
|
|
34
34
|
from maleo.types.uuid import OptListOfUUIDs
|
|
35
35
|
from ..enums.organization_relation import IdentifierType
|
|
36
|
-
from ..mixins.organization_relation import IsBidirectional,
|
|
36
|
+
from ..mixins.organization_relation import IsBidirectional, Meta
|
|
37
37
|
from ..types.organization_relation import IdentifierValueType
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
class CreateParameter(
|
|
41
|
-
|
|
41
|
+
Meta,
|
|
42
42
|
IsBidirectional[bool],
|
|
43
43
|
SimpleOrganizationRelationMixin[OrganizationRelation],
|
|
44
44
|
IntTargetId[int],
|
|
@@ -140,11 +140,11 @@ class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValu
|
|
|
140
140
|
)
|
|
141
141
|
|
|
142
142
|
|
|
143
|
-
class FullUpdateData(
|
|
143
|
+
class FullUpdateData(Meta, IsBidirectional[bool]):
|
|
144
144
|
pass
|
|
145
145
|
|
|
146
146
|
|
|
147
|
-
class PartialUpdateData(
|
|
147
|
+
class PartialUpdateData(Meta, IsBidirectional[OptBool]):
|
|
148
148
|
pass
|
|
149
149
|
|
|
150
150
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import date
|
|
2
|
-
from pydantic import BaseModel, Field
|
|
3
|
-
from typing import Annotated, Generic, Literal,
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
4
4
|
from uuid import UUID
|
|
5
5
|
from maleo.enums.identity import (
|
|
6
6
|
OptBloodType,
|
|
@@ -45,15 +45,14 @@ from maleo.types.string import OptStr, OptListOfStrs
|
|
|
45
45
|
from maleo.types.uuid import OptListOfUUIDs
|
|
46
46
|
from ..enums.patient import IdentifierType, OptListOfExpandableFields
|
|
47
47
|
from ..mixins.common import IdCard, FullName, PlaceOfBirth
|
|
48
|
-
from ..mixins.patient import
|
|
48
|
+
from ..mixins.patient import PatientIdentifier
|
|
49
49
|
from ..types.patient import IdentifierValueType
|
|
50
|
-
from ..validators.patient import validate_id_card_or_passport
|
|
51
50
|
|
|
52
51
|
|
|
53
52
|
class Expand(BaseModel):
|
|
54
|
-
expand: Annotated[
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
expand: Annotated[OptListOfExpandableFields, Field(None, description="Expand")] = (
|
|
54
|
+
None
|
|
55
|
+
)
|
|
57
56
|
|
|
58
57
|
|
|
59
58
|
class CreateQuery(Expand):
|
|
@@ -67,14 +66,10 @@ class CreateData(
|
|
|
67
66
|
DateOfBirth[date],
|
|
68
67
|
PlaceOfBirth[OptStr],
|
|
69
68
|
FullName[str],
|
|
70
|
-
|
|
71
|
-
IdCard[OptStr],
|
|
69
|
+
PatientIdentifier,
|
|
72
70
|
IntOrganizationId[int],
|
|
73
71
|
):
|
|
74
|
-
|
|
75
|
-
def chk_id_card_or_passport(self) -> Self:
|
|
76
|
-
validate_id_card_or_passport(self.id_card, self.passport)
|
|
77
|
-
return self
|
|
72
|
+
pass
|
|
78
73
|
|
|
79
74
|
|
|
80
75
|
class CreateParameter(CreateQuery, CreateData):
|
|
@@ -183,7 +178,7 @@ class FullUpdateData(
|
|
|
183
178
|
DateOfBirth[date],
|
|
184
179
|
PlaceOfBirth[OptStr],
|
|
185
180
|
FullName[str],
|
|
186
|
-
|
|
181
|
+
PatientIdentifier,
|
|
187
182
|
IdCard[OptStr],
|
|
188
183
|
):
|
|
189
184
|
pass
|
|
@@ -196,7 +191,7 @@ class PartialUpdateData(
|
|
|
196
191
|
DateOfBirth[OptDate],
|
|
197
192
|
PlaceOfBirth[OptStr],
|
|
198
193
|
FullName[OptStr],
|
|
199
|
-
|
|
194
|
+
PatientIdentifier,
|
|
200
195
|
IdCard[OptStr],
|
|
201
196
|
):
|
|
202
197
|
pass
|
maleo/identity/schemas/user.py
CHANGED
|
@@ -43,9 +43,9 @@ from ..types.user import IdentifierValueType
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
class Expand(BaseModel):
|
|
46
|
-
expand: Annotated[
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
expand: Annotated[OptListOfExpandableFields, Field(None, description="Expand")] = (
|
|
47
|
+
None
|
|
48
|
+
)
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
class CreateParameter(
|
|
@@ -54,9 +54,9 @@ from ..types.user_profile import IdentifierValueType
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
class Expand(BaseModel):
|
|
57
|
-
expand: Annotated[
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
expand: Annotated[OptListOfExpandableFields, Field(None, description="Expand")] = (
|
|
58
|
+
None
|
|
59
|
+
)
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
class CoreCreateData(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
maleo/identity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
maleo/identity/dtos.py,sha256=
|
|
2
|
+
maleo/identity/dtos.py,sha256=Jsvz9qIi9-ojYLp_zwByahH1_rVZ4znDP_JhFn0HT7g,7648
|
|
3
3
|
maleo/identity/models.py,sha256=aBYbkkd07BzH2zRq3q_D80xMR8DdhCiw1eQ2EYa9ZTQ,10223
|
|
4
4
|
maleo/identity/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
maleo/identity/constants/api_key.py,sha256=e7CsTodUBgyoX30SJUnYx457WBZeRFyyeaOFGsZ-7mY,264
|
|
@@ -17,7 +17,7 @@ maleo/identity/enums/api_key.py,sha256=WST6RsRrvJGeSL5ugVeZNKXReGsh9GEPDxmRy-owi
|
|
|
17
17
|
maleo/identity/enums/organization.py,sha256=6dALM4rhK9EEsSIQzanW6S0KfhzfHSZ2-VAS7AHAK28,591
|
|
18
18
|
maleo/identity/enums/organization_registration_code.py,sha256=ZkteIpOW6MOLEHBbmDUaRGalTlTWUIRlimz-FohBWiM,282
|
|
19
19
|
maleo/identity/enums/organization_relation.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
20
|
-
maleo/identity/enums/patient.py,sha256=
|
|
20
|
+
maleo/identity/enums/patient.py,sha256=ddOoy16JTzHX5n1STDnPO0U3lqxGtFmPNwd7KdDhAVI,633
|
|
21
21
|
maleo/identity/enums/user.py,sha256=Cpp3Oj_NwqF6-fHGruF16TNFProu10ybX1k0HATPcPw,767
|
|
22
22
|
maleo/identity/enums/user_medical_role.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
23
23
|
maleo/identity/enums/user_organization_role.py,sha256=jH9AIYKhxPtK-I02KVrYfZ9Wdo-KNCFk0rDBauwt-Ps,252
|
|
@@ -28,21 +28,21 @@ maleo/identity/mixins/api_key.py,sha256=btlTZkJxhLyxj0T50ZBJnSUwiDIJl4Dz7oNl7Ftc
|
|
|
28
28
|
maleo/identity/mixins/common.py,sha256=diWtUiPMI_ypHtDrmI5y8IArxCdomo9Gt6X69iFhyuw,905
|
|
29
29
|
maleo/identity/mixins/organization.py,sha256=KMl7Zz_SXu6SvF_1fTibN2vORFGWH7P22cxS_T4KXmE,574
|
|
30
30
|
maleo/identity/mixins/organization_registration_code.py,sha256=G-kgdf2IzKENEyZcV6IXT69eAemnqR1vph3hhG3l1y4,508
|
|
31
|
-
maleo/identity/mixins/organization_relation.py,sha256=
|
|
32
|
-
maleo/identity/mixins/patient.py,sha256=
|
|
31
|
+
maleo/identity/mixins/organization_relation.py,sha256=kf7vDF7-564cIy6g_scxoWaumsJW0xraK3QdyJk_-Qw,427
|
|
32
|
+
maleo/identity/mixins/patient.py,sha256=1zW6u_b8DM-7dSHfqX6HWJbQsRLKD2H1unEUnZco5MI,665
|
|
33
33
|
maleo/identity/mixins/user.py,sha256=UHoMgFJXptE9x9QsR07KG2bgp5OlCNqvYjEtP9S3TIY,1054
|
|
34
34
|
maleo/identity/mixins/user_profile.py,sha256=LFHAzGD-3wli6YJGfl9-Sy0gtQHkhgvrZ5EzOfl1vXY,1174
|
|
35
35
|
maleo/identity/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
36
|
maleo/identity/schemas/api_key.py,sha256=UnQfnoEMkFgOfWDKai6wWNyD5QsovyoOov6jN52QPKI,3713
|
|
37
|
-
maleo/identity/schemas/common.py,sha256=
|
|
38
|
-
maleo/identity/schemas/organization.py,sha256=
|
|
37
|
+
maleo/identity/schemas/common.py,sha256=h-NZ1oDYsY1vj8IyM2Ct4F5CunEHwhx2RcOdUZCx36Q,8989
|
|
38
|
+
maleo/identity/schemas/organization.py,sha256=8V1DSDMGXyF1gsfpOK0fN-djbKQxNey1Rr5YLO_ZEg0,5379
|
|
39
39
|
maleo/identity/schemas/organization_registration_code.py,sha256=jAP7MGb_28wh1WoBZDl2FSJBxKFRH56YSQvMFQ5_iyo,4731
|
|
40
|
-
maleo/identity/schemas/organization_relation.py,sha256=
|
|
41
|
-
maleo/identity/schemas/patient.py,sha256=
|
|
42
|
-
maleo/identity/schemas/user.py,sha256=
|
|
40
|
+
maleo/identity/schemas/organization_relation.py,sha256=xEdOuZ6J4r7R4heEagd_UtioYJla73LZs1qloSSEs4I,5067
|
|
41
|
+
maleo/identity/schemas/patient.py,sha256=4nBjz5K-AYJnVIIMA5PHGX7UxG0UtNEM0t6g5SP-jkY,5957
|
|
42
|
+
maleo/identity/schemas/user.py,sha256=rxMV24k0KB4FVwR9lmv1SiLNqTbzwRTUItgJie2LMJc,5273
|
|
43
43
|
maleo/identity/schemas/user_medical_role.py,sha256=YzYsjMRKIA4CWdfOlGoPqWFl4v2JTj2EBwOWhNtUKSQ,4893
|
|
44
44
|
maleo/identity/schemas/user_organization_role.py,sha256=MW1Ry1HnGrASmP2Mulk3Pfk1_mIOlLTBARerOA0TowI,4983
|
|
45
|
-
maleo/identity/schemas/user_profile.py,sha256=
|
|
45
|
+
maleo/identity/schemas/user_profile.py,sha256=saFmMuQ-TNlE--hoUxNVeXt4ZUalJaOVxqmYGkCiJ6I,6582
|
|
46
46
|
maleo/identity/schemas/user_system_role.py,sha256=CRI8KgNpcjJU9EBtEc75-vUmC64J5ZgigFO6IRWuRKM,4665
|
|
47
47
|
maleo/identity/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
48
|
maleo/identity/types/api_key.py,sha256=pjWzyAh1p0DTS6v2ImYv849iF-T0PbEM8qlrwN3c-2o,190
|
|
@@ -58,10 +58,8 @@ maleo/identity/types/user_system_role.py,sha256=6KIDk7kCWBlrloNLfIElflS5N8oBYqPe
|
|
|
58
58
|
maleo/identity/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
59
|
maleo/identity/utils/organization.py,sha256=jU-PLlxPbsRciid82p-ScdLSydspI-5ofJX7KL5qmDo,1611
|
|
60
60
|
maleo/identity/utils/user.py,sha256=Mk1NTrViz1nBJxtPZRWdQmYHjTPxxc61a02eyikEBoU,1459
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
maleo_identity-0.1.
|
|
64
|
-
maleo_identity-0.1.
|
|
65
|
-
maleo_identity-0.1.
|
|
66
|
-
maleo_identity-0.1.2.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
67
|
-
maleo_identity-0.1.2.dist-info/RECORD,,
|
|
61
|
+
maleo_identity-0.1.3.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
|
62
|
+
maleo_identity-0.1.3.dist-info/METADATA,sha256=Les5ugTSugq3zOtLB5EAEm78c3l7s_K0lYFhlFWbPNc,3583
|
|
63
|
+
maleo_identity-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
64
|
+
maleo_identity-0.1.3.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
65
|
+
maleo_identity-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|