estimation service refactor
This commit is contained in:
parent
aaba8753ef
commit
18c95083c9
4 changed files with 367 additions and 62 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List, Dict, Any
|
||||
from datetime import date
|
||||
|
||||
class InsuranceChatRequest(BaseModel):
|
||||
message: str = Field(..., description="User message")
|
||||
|
|
@ -20,19 +21,90 @@ class InsuranceChatResponse(BaseModel):
|
|||
sources: List[Source] = []
|
||||
history: List[HistoryItem] = []
|
||||
|
||||
# New estimation models matching the specified format
|
||||
class Applicant(BaseModel):
|
||||
applicant: int
|
||||
firstName: str
|
||||
lastName: str
|
||||
midName: str
|
||||
phone: str
|
||||
gender: str
|
||||
dob: date
|
||||
nicotine: bool
|
||||
weight: float
|
||||
heightFt: int
|
||||
heightIn: int
|
||||
|
||||
class Plan(BaseModel):
|
||||
id: int
|
||||
coverage: int
|
||||
tier: str
|
||||
|
||||
class Medication(BaseModel):
|
||||
applicant: int
|
||||
name: str
|
||||
rxcui: str
|
||||
dosage: str
|
||||
frequency: str
|
||||
description: str
|
||||
|
||||
class IssueDetail(BaseModel):
|
||||
key: str
|
||||
description: str
|
||||
|
||||
class Issue(BaseModel):
|
||||
key: str
|
||||
details: List[IssueDetail]
|
||||
|
||||
class Condition(BaseModel):
|
||||
key: str
|
||||
description: str
|
||||
|
||||
class PHQ(BaseModel):
|
||||
treatment: bool
|
||||
invalid: bool
|
||||
pregnancy: bool
|
||||
effectiveDate: date
|
||||
disclaimer: bool
|
||||
signature: str
|
||||
medications: List[Medication]
|
||||
issues: List[Issue]
|
||||
conditions: List[Condition]
|
||||
|
||||
class Address(BaseModel):
|
||||
address1: str
|
||||
address2: str
|
||||
city: str
|
||||
state: str
|
||||
zipcode: str
|
||||
|
||||
class EstimationRequest(BaseModel):
|
||||
uid: str = Field(..., description="Application unique identifier")
|
||||
applicants: List[Dict[str, Any]] = Field(..., description="List of applicants")
|
||||
plans: List[Dict[str, Any]] = Field(..., description="List of insurance plans")
|
||||
phq: Dict[str, Any] = Field(..., description="Personal Health Questionnaire data")
|
||||
income: Optional[float] = Field(0, description="Annual income")
|
||||
address: Optional[Dict[str, Any]] = Field({}, description="Address information")
|
||||
uid: str
|
||||
applicants: List[Applicant]
|
||||
plans: List[Plan]
|
||||
phq: PHQ
|
||||
income: float
|
||||
address: Address
|
||||
|
||||
class EstimationDetails(BaseModel):
|
||||
dtq: bool
|
||||
reason: str
|
||||
tier: int
|
||||
total_price: float
|
||||
|
||||
class EstimationResult(BaseModel):
|
||||
name: str
|
||||
applicant_type: str
|
||||
age: int
|
||||
bmi: float
|
||||
tier: int
|
||||
rx_spend: float
|
||||
message: str
|
||||
|
||||
class EstimationResponse(BaseModel):
|
||||
uid: str
|
||||
status: str
|
||||
data: Dict[str, Any]
|
||||
external: Optional[Dict[str, Any]] = None
|
||||
details: EstimationDetails
|
||||
results: List[EstimationResult]
|
||||
|
||||
class SessionCreateResponse(BaseModel):
|
||||
session_id: str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue