File size: 2,200 Bytes
3e595a5
 
 
7828fde
 
3e595a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95243ee
3e595a5
 
95243ee
 
 
3e595a5
 
 
 
 
 
 
 
 
c2d68af
3e595a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95243ee
 
3e595a5
 
 
 
 
 
95243ee
3e595a5
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
from typing_extensions import TypedDict
from datetime import date
from typing import Annotated, Dict, Any
from langgraph.graph.message import add_messages

class PainLevels(TypedDict):
    left_head: int
    right_head: int
    left_arm: int
    left_hand: int
    right_arm: int
    right_hand: int
    left_body_trunk: int
    right_body_trunk: int
    left_leg: int
    left_foot: int
    right_leg: int
    right_foot: int

class Surgery(TypedDict):
    surgery_name: str
    time: date

class PatientID(TypedDict):
    name: str
    DOB: date
    gender: str
    contact: str
    emergency_contact: str

class MainSymptom(TypedDict):
    main_symptom: str
    symptom_length: str

class Pain(TypedDict):
    pain_location: str
    pain_side: str
    pain_intensity: int
    pain_description: str
    start_time: date
    radiation: bool
    triggers: str
    symptom: str

class MedicalHistory(TypedDict):
    medical_condition: str
    first_time: date
    surgery_history: str
    medication: str
    allergy: str

class FamilyHistory(TypedDict):
    family_history: str

class SocialHistory(TypedDict):
    occupation: str
    smoke: bool
    alcohol: bool
    drug: bool
    support_system: str
    living_condition: str

class ReviewSystem(TypedDict):
    weight_change: str
    fever: bool
    chill: bool
    night_sweats: bool
    sleep: str
    gastrointestinal: str
    urinary: str

class PainManagement(TypedDict):
    pain_medication: str
    specialist: bool
    other_therapy: str
    effectiveness: bool

class Functional(TypedDict):
    life_quality: str
    limit_activity: str
    mood: str

class Plan(TypedDict):
    goal: str
    expectation: str
    alternative_treatment_illness: str

class PatientData(TypedDict):
    ID: PatientID
    symptom: MainSymptom
    pain: Pain
    medical_hist: MedicalHistory
    family_hist: FamilyHistory
    social_hist: SocialHistory
    review_system: ReviewSystem
    pain_manage: PainManagement
    functional: Functional
    plan: Plan

class DataState(TypedDict):
    """State representing the patient's data status and conversation."""
    messages: Annotated[list, add_messages]
    data: Dict[str, PatientData]
    finished: bool