erDiagram
User {
int id PK
string name
string email
string phone
date birth_date
string role
string access_pin
bool is_active
datetime created_at
}
Organization {
int id PK
string name
string type
string address
string phone
int admin_user_id FK
string status
datetime created_at
}
UserDiagnosis {
int id PK
int user_id FK
date diagnosis_date
json results
json summary
datetime created_at
}
OrganizationMember {
int id PK
int org_id FK
int user_id FK
string role
datetime joined_at
}
DiagnosisKit {
int id PK
string serial_number
string pin_hash
string status
date test_date
int diagnosis_id FK
int registered_by
datetime created_at
}
HospitalPatient {
int id PK
int org_id FK
int user_id FK
string patient_number
string assigned_doctor
bool consent_signed
datetime registered_at
}
Paper {
int id PK
string title
string authors
string journal
int year
string doi
text abstract
string paper_type
string evidence_level
bool is_guideline
string guideline_org
datetime created_at
}
PaperAllergenLink {
int id PK
int paper_id FK
string allergen_code
string link_type
string item_name
float confidence
datetime created_at
}
ClinicalStatement {
int id PK
string statement_en
string statement_kr
string allergen_code
string context
string evidence_level
string recommendation
int paper_id FK
string source_location
bool is_active
datetime created_at
}
User ||--o{ UserDiagnosis : "has"
User ||--o{ OrganizationMember : "belongs to"
Organization ||--o{ OrganizationMember : "has"
Organization ||--o{ HospitalPatient : "manages"
Organization }o--|| User : "admin"
UserDiagnosis ||--o| DiagnosisKit : "from"
Paper ||--o{ PaperAllergenLink : "links"
Paper ||--o{ ClinicalStatement : "sources"
erDiagram
AllergenTrend {
int id PK
string allergen_code
string year_month
int paper_count
float mention_ratio
datetime created_at
}
KeywordTrend {
int id PK
string keyword
string year_month
int paper_count
float frequency
datetime created_at
}
TreatmentTrend {
int id PK
string allergen_code
string treatment_name
string treatment_type
string year_month
int paper_count
datetime created_at
}
EpidemiologyData {
int id PK
string allergen_code
string data_type
float value
string region
int year
int source_paper_id
datetime created_at
}
CompetitorNews {
int id PK
string title
string source
string url
datetime published_at
text summary
float relevance_score
float importance_score
json allergen_codes
int category_id FK
datetime created_at
}
NewsCategory {
int id PK
string name
string description
datetime created_at
}
CompetitorNews }o--|| NewsCategory : "categorized"
erDiagram
Subscriber {
int id PK
string email
string name
json keywords
bool is_verified
string verify_code
string status
datetime subscribed_at
datetime unsubscribed_at
datetime created_at
}
Newsletter {
int id PK
string subject
text content_html
datetime sent_at
int recipient_count
datetime created_at
}
SchedulerJob {
int id PK
string job_type
string status
datetime last_run_at
datetime next_run_at
json result
datetime created_at
}
stateDiagram-v2
[*] --> created : 키트 생성
created --> tested : 검사 수행
tested --> result_entered : 결과 입력
result_entered --> registered : 사용자 등록
created --> expired : 유효기간 초과
tested --> expired : 유효기간 초과
result_entered --> expired : 유효기간 초과