Ali2206 commited on
Commit
4b74521
·
verified ·
1 Parent(s): 89b066e

Update models/entities.py

Browse files
Files changed (1) hide show
  1. models/entities.py +43 -25
models/entities.py CHANGED
@@ -1,31 +1,49 @@
1
- from pydantic import BaseModel, Field
2
- from typing import Optional, Dict
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 = Field(..., example="cond123")
12
- code: str = Field(..., example="Hypertension")
13
- status: str = Field(..., example="Active")
14
- onset_date: str = Field(..., example="2020-05-15")
15
- recorded_date: Optional[str] = Field(None, example="2020-05-16")
16
- verification_status: Optional[str] = Field(None, example="Confirmed")
17
 
18
  class Medication(BaseModel):
19
- id: str = Field(..., example="med123")
20
- name: str = Field(..., example="Lisinopril 10mg")
21
- status: str = Field(..., example="Active")
22
- prescribed_date: str = Field(..., example="2021-02-10")
23
- requester: Optional[str] = Field(None, example="Dr. Smith")
24
- dosage: Optional[str] = Field(None, example="10mg daily")
25
 
26
  class Encounter(BaseModel):
27
- id: str = Field(..., example="enc123")
28
- type: str = Field(..., example="Outpatient Visit")
29
- status: str = Field(..., example="Finished")
30
- period: Dict = Field(..., example={"start": "2023-01-01T10:00:00Z"})
31
- service_provider: Optional[str] = Field(None, example="City Hospital")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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]] = []