CPS-API / models /entities.py
Ali2206's picture
Update models/entities.py
5cb3ecd verified
raw
history blame
1.4 kB
from pydantic import BaseModel, Field
from typing import Optional, Dict
class Note(BaseModel):
date: str = Field(..., example="2023-01-01T12:00:00Z")
type: str = Field(..., example="Progress Note")
text: str = Field(..., example="Patient reported improvement in symptoms")
author: Optional[str] = Field(None, example="Dr. Smith")
class Condition(BaseModel):
id: str = Field(..., example="cond123")
code: str = Field(..., example="Hypertension")
status: str = Field(..., example="Active")
onset_date: str = Field(..., example="2020-05-15")
recorded_date: Optional[str] = Field(None, example="2020-05-16")
verification_status: Optional[str] = Field(None, example="Confirmed")
class Medication(BaseModel):
id: str = Field(..., example="med123")
name: str = Field(..., example="Lisinopril 10mg")
status: str = Field(..., example="Active")
prescribed_date: str = Field(..., example="2021-02-10")
requester: Optional[str] = Field(None, example="Dr. Smith")
dosage: Optional[str] = Field(None, example="10mg daily")
class Encounter(BaseModel):
id: str = Field(..., example="enc123")
type: str = Field(..., example="Outpatient Visit")
status: str = Field(..., example="Finished")
period: Dict = Field(..., example={"start": "2023-01-01T10:00:00Z"})
service_provider: Optional[str] = Field(None, example="City Hospital")