Spaces:
Sleeping
Sleeping
Update models/entities.py
Browse files- models/entities.py +43 -25
models/entities.py
CHANGED
|
@@ -1,31 +1,49 @@
|
|
| 1 |
-
from pydantic import BaseModel
|
| 2 |
-
from typing import
|
| 3 |
-
|
| 4 |
-
class Note(BaseModel):
|
| 5 |
-
date: str = Field(..., example="2023-01-01T12:00:00Z")
|
| 6 |
-
type: str = Field(..., example="Progress Note")
|
| 7 |
-
text: str = Field(..., example="Patient reported improvement in symptoms")
|
| 8 |
-
author: Optional[str] = Field(None, example="Dr. Smith")
|
| 9 |
|
| 10 |
class Condition(BaseModel):
|
| 11 |
-
id: str
|
| 12 |
-
code: str
|
| 13 |
-
status: str =
|
| 14 |
-
onset_date: str =
|
| 15 |
-
recorded_date: Optional[str] =
|
| 16 |
-
verification_status: Optional[str] =
|
| 17 |
|
| 18 |
class Medication(BaseModel):
|
| 19 |
-
id: str
|
| 20 |
-
name: str
|
| 21 |
-
status: str
|
| 22 |
-
prescribed_date: str =
|
| 23 |
-
requester: Optional[str] =
|
| 24 |
-
dosage: Optional[str] =
|
| 25 |
|
| 26 |
class Encounter(BaseModel):
|
| 27 |
-
id: str
|
| 28 |
-
type: str
|
| 29 |
-
status: str
|
| 30 |
-
period:
|
| 31 |
-
service_provider: Optional[str] =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import BaseModel
|
| 2 |
+
from typing import List, Optional
|
| 3 |
+
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
class Condition(BaseModel):
|
| 6 |
+
id: str
|
| 7 |
+
code: str
|
| 8 |
+
status: Optional[str] = ""
|
| 9 |
+
onset_date: Optional[str] = None
|
| 10 |
+
recorded_date: Optional[str] = None
|
| 11 |
+
verification_status: Optional[str] = ""
|
| 12 |
|
| 13 |
class Medication(BaseModel):
|
| 14 |
+
id: str
|
| 15 |
+
name: str
|
| 16 |
+
status: str
|
| 17 |
+
prescribed_date: Optional[str] = None
|
| 18 |
+
requester: Optional[str] = ""
|
| 19 |
+
dosage: Optional[str] = ""
|
| 20 |
|
| 21 |
class Encounter(BaseModel):
|
| 22 |
+
id: str
|
| 23 |
+
type: str
|
| 24 |
+
status: str
|
| 25 |
+
period: dict
|
| 26 |
+
service_provider: Optional[str] = ""
|
| 27 |
+
|
| 28 |
+
class Note(BaseModel):
|
| 29 |
+
date: str
|
| 30 |
+
type: str
|
| 31 |
+
text: str
|
| 32 |
+
context: Optional[str] = ""
|
| 33 |
+
author: Optional[str] = "System"
|
| 34 |
+
|
| 35 |
+
class PatientCreate(BaseModel):
|
| 36 |
+
full_name: str
|
| 37 |
+
gender: str
|
| 38 |
+
date_of_birth: str
|
| 39 |
+
address: Optional[str] = ""
|
| 40 |
+
city: Optional[str] = ""
|
| 41 |
+
state: Optional[str] = ""
|
| 42 |
+
postal_code: Optional[str] = ""
|
| 43 |
+
country: Optional[str] = "US"
|
| 44 |
+
marital_status: Optional[str] = "Never Married"
|
| 45 |
+
language: Optional[str] = "en"
|
| 46 |
+
conditions: Optional[List[Condition]] = []
|
| 47 |
+
medications: Optional[List[Medication]] = []
|
| 48 |
+
encounters: Optional[List[Encounter]] = []
|
| 49 |
+
notes: Optional[List[Note]] = []
|