models package

Submodules

models.exam_models module

Pydantic models for medical exam generation.

This module defines the data structures used for requesting and representing laboratory exam results. The models ensure that data passed to and from the exam generation service is well-structured and validated.

Version: 1.1

class models.exam_models.LabCategory(*, categoria: str, test: List[LabTest])[source]

Bases: BaseModel

Represents a category of laboratory exams.

categoria

The name of the lab category in Italian (e.g., ‘Ematologia’).

Type:

str

test

A list of individual lab tests belonging to this category.

Type:

List[models.exam_models.LabTest]

categoria: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

test: List[LabTest]
class models.exam_models.LabExamRequest(*, descrizione_scenario: str, tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro'], esame_obiettivo: str, patologia: str | None = None)[source]

Bases: BaseModel

Defines the request model for generating lab exams.

descrizione_scenario

A detailed description of the clinical scenario.

Type:

str

tipologia_paziente

The type of patient to adjust reference ranges for.

Type:

Literal[‘Adulto’, ‘Pediatrico’, ‘Neonatale’, ‘Prematuro’]

esame_obiettivo

The objective physical examination findings.

Type:

str

descrizione_scenario: str
esame_obiettivo: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

patologia: str | None
tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro']
class models.exam_models.LabExamResponse(*, esami_laboratorio: List[LabCategory])[source]

Bases: BaseModel

Defines the structure for the final lab exams response.

esami_laboratorio

A list of laboratory exam categories.

Type:

List[models.exam_models.LabCategory]

esami_laboratorio: List[LabCategory]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class models.exam_models.LabTest(*, nome: str, valore: str, unita_misura: str | None, range_riferimento: str, referto: str)[source]

Bases: BaseModel

Represents a single laboratory test result.

nome

The name of the test in Italian (e.g., ‘Emoglobina’).

Type:

str

valore

The resulting value of the test, formatted as a string.

Type:

str

unita_misura

The unit of measurement for the test (e.g., ‘g/dL’).

Type:

str | None

range_riferimento

The reference range for the test (e.g., ‘13.5 - 17.5’).

Type:

str

referto

A brief textual interpretation of the result in Italian.

Type:

str

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nome: str
range_riferimento: str
referto: str
unita_misura: str | None
valore: str

models.mat_model module

Pydantic models for the Medical Assessment Tool (MAT).

This module defines the data structures for requesting and representing materials or tools generated by the MAT service. These models ensure validated and structured data for the MAT API endpoints.

class models.mat_model.MATModelRequest(*, descrizione_scenario: str, tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro'], target: str, esame_obiettivo: str)[source]

Bases: BaseModel

Defines the request model for generating a Medical Assessment Tool (MAT).

descrizione_scenario

A detailed description of the clinical scenario.

Type:

str

tipologia_paziente

The type of patient (Adult, Pediatric, etc.).

Type:

Literal[‘Adulto’, ‘Pediatrico’, ‘Neonatale’, ‘Prematuro’]

target

The target audience for the assessment tool.

Type:

str

esame_obiettivo

Detailed physical examination findings for context.

Type:

str

descrizione_scenario: str
esame_obiettivo: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

target: str
tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro']
class models.mat_model.MATModelResponse(*, nome: str, descrizione: str)[source]

Bases: BaseModel

Defines the response model for a generated Medical Assessment Tool (MAT).

nome

The name of the generated material or tool.

Type:

str

descrizione

A description of the material or tool.

Type:

str

descrizione: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nome: str
class models.mat_model.MatModelListResponse(*, materials: list[MATModelResponse])[source]

Bases: BaseModel

Defines the response model for a list of generated Medical Assessment Tools (MAT).

materials

A list of generated materials or tools.

Type:

list[models.mat_model.MATModelResponse]

materials: list[MATModelResponse]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

models.medical_report_models module

Pydantic models for medical report generation.

This module defines the data structures for requesting and representing medical reports. These models ensure that data for the report generation service is well-structured and validated.

Version: 1.0

class models.medical_report_models.MedicalReportRequest(*, descrizione_scenario: str, tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro'], tipologia_esame: Literal['ECG (Elettrocardiogramma)', 'RX Torace', 'TC Torace (con mdc)', 'TC Torace (senza mdc)', 'TC Addome (con mdc)', 'TC Addome (senza mdc)', 'Ecografia addominale', 'Ecografia polmonare', 'Ecocardio (Transtoracico)', 'Ecocardio (Transesofageo)', 'Spirometria', 'EEG (Elettroencefalogramma)', 'RM Encefalo', 'TC Cranio (con mdc)', 'TC Cranio (senza mdc)', 'Doppler TSA (Tronchi Sovraortici)', 'Angio-TC Polmonare', 'Fundus oculi'], esame_obiettivo: str)[source]

Bases: BaseModel

Defines the request model for generating a medical report.

descrizione_scenario

A detailed description of the clinical scenario.

Type:

str

tipologia_paziente

The type of patient (e.g., Adult, Pediatric).

Type:

Literal[‘Adulto’, ‘Pediatrico’, ‘Neonatale’, ‘Prematuro’]

tipologia_esame

The specific type of medical examination to report on.

Type:

Literal[‘ECG (Elettrocardiogramma)’, ‘RX Torace’, ‘TC Torace (con mdc)’, ‘TC Torace (senza mdc)’, ‘TC Addome (con mdc)’, ‘TC Addome (senza mdc)’, ‘Ecografia addominale’, ‘Ecografia polmonare’, ‘Ecocardio (Transtoracico)’, ‘Ecocardio (Transesofageo)’, ‘Spirometria’, ‘EEG (Elettroencefalogramma)’, ‘RM Encefalo’, ‘TC Cranio (con mdc)’, ‘TC Cranio (senza mdc)’, ‘Doppler TSA (Tronchi Sovraortici)’, ‘Angio-TC Polmonare’, ‘Fundus oculi’]

esame_obiettivo

Objective physical examination findings for context.

Type:

str

descrizione_scenario: str
esame_obiettivo: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

tipologia_esame: Literal['ECG (Elettrocardiogramma)', 'RX Torace', 'TC Torace (con mdc)', 'TC Torace (senza mdc)', 'TC Addome (con mdc)', 'TC Addome (senza mdc)', 'Ecografia addominale', 'Ecografia polmonare', 'Ecocardio (Transtoracico)', 'Ecocardio (Transesofageo)', 'Spirometria', 'EEG (Elettroencefalogramma)', 'RM Encefalo', 'TC Cranio (con mdc)', 'TC Cranio (senza mdc)', 'Doppler TSA (Tronchi Sovraortici)', 'Angio-TC Polmonare', 'Fundus oculi']
tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro']
class models.medical_report_models.MedicalReportResponse(*, tipologia_esame: str, referto: str)[source]

Bases: BaseModel

Defines the response model for a generated medical report.

tipologia_esame

The type of examination that was performed.

Type:

str

referto

The complete medical report text in Italian.

Type:

str

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

referto: str
tipologia_esame: str

models.presidi_medici module

models.scenario_models module

Pydantic models for medical simulation scenarios.

This module defines the data structures used throughout the Medical Simulation Suite for creating, validating, and managing clinical scenarios. The models cover everything from patient state and physical exams to scenario timelines and request parameters.

Version: 4.2

class models.scenario_models.AccessoArterioso(*, tipologia: Literal['Radiale', 'Femorale', 'Omerale', 'Brachiale', 'Ascellare', 'Pedidia', 'Altro'], posizione: str, lato: Literal['DX', 'SX'], misura: int)[source]

Bases: BaseModel

Represents a single arterial access point on a patient.

tipologia

The type of arterial access.

Type:

Literal[‘Radiale’, ‘Femorale’, ‘Omerale’, ‘Brachiale’, ‘Ascellare’, ‘Pedidia’, ‘Altro’]

posizione

The anatomical location of the access point.

Type:

str

lato

The side of the body (DX for right, SX for left).

Type:

Literal[‘DX’, ‘SX’]

misura

The gauge size of the access device (e.g., 20G).

Type:

int

lato: Literal['DX', 'SX']
misura: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

posizione: str
tipologia: Literal['Radiale', 'Femorale', 'Omerale', 'Brachiale', 'Ascellare', 'Pedidia', 'Altro']
class models.scenario_models.AccessoVenosso(*, tipologia: Literal['Periferico', 'Centrale', 'CVC a breve termine', 'CVC tunnellizzato', 'PICC', 'Midline', 'Intraosseo', 'PORT', 'Dialysis catheter', 'Altri'], posizione: str, lato: Literal['DX', 'SX'], misura: int)[source]

Bases: BaseModel

Represents a single venous access point on a patient.

tipologia

The type of venous access.

Type:

Literal[‘Periferico’, ‘Centrale’, ‘CVC a breve termine’, ‘CVC tunnellizzato’, ‘PICC’, ‘Midline’, ‘Intraosseo’, ‘PORT’, ‘Dialysis catheter’, ‘Altri’]

posizione

The anatomical location of the access point.

Type:

str

lato

The side of the body (DX for right, SX for left).

Type:

Literal[‘DX’, ‘SX’]

misura

The gauge size of the access device (e.g., 18G).

Type:

int

lato: Literal['DX', 'SX']
misura: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

posizione: str
tipologia: Literal['Periferico', 'Centrale', 'CVC a breve termine', 'CVC tunnellizzato', 'PICC', 'Midline', 'Intraosseo', 'PORT', 'Dialysis catheter', 'Altri']
class models.scenario_models.BaseScenario(*, azioniChiave: List[str], tipo: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario'], scenario: ScenarioInfo, presidi: List[str], esameFisico: EsameFisico, pazienteT0: PazienteT0)[source]

Bases: BaseModel

Defines the foundational components of a medical scenario.

azioniChiave

A list of key actions or learning objectives.

Type:

List[str]

tipo

The type of scenario (e.g., Quick, Advanced).

Type:

Literal[‘Quick Scenario’, ‘Advanced Scenario’, ‘Patient Simulated Scenario’]

scenario

General information and metadata about the scenario.

Type:

models.scenario_models.ScenarioInfo

presidi

A list of required medical equipment.

Type:

List[str]

esameFisico

The structured physical examination findings.

Type:

models.scenario_models.EsameFisico

pazienteT0

The initial state of the patient.

Type:

models.scenario_models.PazienteT0

azioniChiave: List[str]
esameFisico: EsameFisico
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pazienteT0: PazienteT0
presidi: List[str]
scenario: ScenarioInfo
tipo: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario']
class models.scenario_models.EsameFisico(*, sections: EsameFisicoSections)[source]

Bases: BaseModel

A container for the structured physical examination findings.

sections

An object containing the detailed findings for each part of the physical exam.

Type:

models.scenario_models.EsameFisicoSections

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sections: EsameFisicoSections
class models.scenario_models.EsameFisicoSections(*, Generale: str, Pupille: str, Cute: str, Collo: str, Torace: str, Cuore: str, Addome: str, Estremità: str, Neurologico: str, Retto: str, FAST: str)[source]

Bases: BaseModel

Contains the detailed findings for each section of a physical exam.

Each attribute holds HTML-formatted text describing the findings for that specific part of the examination.

Addome: str
Collo: str
Cuore: str
Cute: str
Estremità: str
FAST: str
Generale: str
Neurologico: str
Pupille: str
Retto: str
Torace: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class models.scenario_models.FullScenario(*, azioniChiave: List[str], tipo: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario'], scenario: ScenarioInfo, presidi: List[str], esameFisico: EsameFisico, pazienteT0: PazienteT0, tempi: List[Tempo], sceneggiatura: str)[source]

Bases: BaseModel

Represents a complete, advanced scenario with all possible components.

This model combines the base scenario with a timeline and a script for a fully interactive simulation.

azioniChiave: List[str]
esameFisico: EsameFisico
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pazienteT0: PazienteT0
presidi: List[str]
scenario: ScenarioInfo
sceneggiatura: str
tempi: List[Tempo]
tipo: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario']
class models.scenario_models.ParametroAggiuntivo(*, unitaMisura: str, nome: str, valore: float)[source]

Bases: BaseModel

Represents an additional, custom vital sign or parameter.

unitaMisura

The unit of measurement for the parameter.

Type:

str

nome

The name of the parameter.

Type:

str

valore

The value of the parameter.

Type:

float

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nome: str
unitaMisura: str
valore: float
class models.scenario_models.PazienteT0(*, RR: int, SpO2: int, FiO2: float = 0, LitriO2: float = 0, EtCO2: int = 0, Monitor: str, accessiVenosi: ~typing.List[~models.scenario_models.AccessoVenosso] = <factory>, accessiArteriosi: ~typing.List[~models.scenario_models.AccessoArterioso] = <factory>, PA: str, FC: int, T: float)[source]

Bases: BaseModel

Defines the initial state and vital signs of the patient at time zero.

RR

Respiratory Rate in breaths per minute.

Type:

int

SpO2

Oxygen saturation in percent.

Type:

int

FiO2

Fraction of Inspired Oxygen.

Type:

float

LitriO2

Oxygen flow in liters per minute.

Type:

float

EtCO2

End-tidal CO2 in mmHg.

Type:

int

Monitor

Description of the initial patient monitoring setup.

Type:

str

accessiVenosi

A list of established venous access points.

Type:

List[models.scenario_models.AccessoVenosso]

accessiArteriosi

A list of established arterial access points.

Type:

List[models.scenario_models.AccessoArterioso]

PA

Blood pressure, formatted as ‘systolic/diastolic’.

Type:

str

FC

Heart rate in beats per minute.

Type:

int

T

Body temperature in Celsius.

Type:

float

EtCO2: int
FC: int
FiO2: float
LitriO2: float
Monitor: str
PA: str
RR: int
SpO2: int
T: float
accessiArteriosi: List[AccessoArterioso]
accessiVenosi: List[AccessoVenosso]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod validate_blood_pressure(v: str) str[source]

Validates that blood pressure is in the format ‘number/number’.

class models.scenario_models.ScenarioInfo(*, nome_paziente: str, patto_aula: str, obiettivo: str, timer_generale: float, infoGenitore: str | None = None, titolo: str, patologia: str, descrizione: str, briefing: str, moulage: str, liquidi: str, autori: str, tipologia: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro'], target: str)[source]

Bases: BaseModel

Holds general information and metadata about the simulation scenario.

nome_paziente

The patient’s name.

Type:

str

patto_aula

The “classroom agreement” or rules for the simulation.

Type:

str

obiettivo

The primary learning objective of the scenario.

Type:

str

timer_generale

The total duration of the scenario in minutes.

Type:

float

infoGenitore

Information provided by a parent (for pediatric cases).

Type:

str | None

titolo

The title of the scenario.

Type:

str

patologia

The primary pathology or condition being simulated.

Type:

str

descrizione

A general description of the scenario.

Type:

str

briefing

The pre-scenario briefing for participants.

Type:

str

moulage

Description of the patient manikin’s setup and appearance.

Type:

str

liquidi

Description of available fluids and drugs.

Type:

str

autori

The authors of the scenario.

Type:

str

tipologia

The patient type (e.g., Adult, Pediatric).

Type:

Literal[‘Adulto’, ‘Pediatrico’, ‘Neonatale’, ‘Prematuro’]

target

The target audience for the simulation (e.g., medical students).

Type:

str

autori: str
briefing: str
descrizione: str
infoGenitore: str | None
liquidi: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

moulage: str
nome_paziente: str
obiettivo: str
patologia: str
patto_aula: str
target: str
timer_generale: float
tipologia: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro']
titolo: str
class models.scenario_models.ScenarioRequest(*, description: str, scenario_type: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario'], target: str | None = None, difficulty: Literal['Facile', 'Medio', 'Difficile'] = 'Facile')[source]

Bases: BaseModel

Defines the request model for generating a new simulation scenario.

description

A text description of the desired clinical case.

Type:

str

scenario_type

The type of scenario to generate.

Type:

Literal[‘Quick Scenario’, ‘Advanced Scenario’, ‘Patient Simulated Scenario’]

target

The intended audience for the scenario.

Type:

str | None

difficulty

The desired difficulty level, which influences clinical complexity and potential complications.

Type:

Literal[‘Facile’, ‘Medio’, ‘Difficile’]

description: str
difficulty: Literal['Facile', 'Medio', 'Difficile']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

scenario_type: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario']
target: str | None
class models.scenario_models.Sceneggiatura(*, sceneggiatura: str)[source]

Bases: BaseModel

Contains the script for a simulated patient or actor.

sceneggiatura

An HTML-formatted string containing the script.

Type:

str

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sceneggiatura: str
class models.scenario_models.Tempo(*, idTempo: int, RR: int, SpO2: int, FiO2: float = 0, LitriO2: float = 0, EtCO2: int = 0, TSi: int = 0, TNo: int = 0, altriDettagli: str, timerTempo: int = 0, ruoloGenitore: str | None = None, PA: str, FC: int, T: float, Azione: str, parametriAggiuntivi: ~typing.List[~models.scenario_models.ParametroAggiuntivo] = <factory>)[source]

Bases: BaseModel

Represents a specific time point or event within the scenario’s timeline.

idTempo

A unique identifier for the time point (e.g., 0 for T0).

Type:

int

TSi

The ID of the next time point if the correct action is taken.

Type:

int

TNo

The ID of the next time point if the incorrect action is taken.

Type:

int

altriDettagli

Additional details about the state at this time.

Type:

str

timerTempo

A specific timer for this event in seconds.

Type:

int

ruoloGenitore

Role or actions of a parent at this time point.

Type:

str | None

Azione

The key action required to proceed to the ‘TSi’ state.

Type:

str

parametriAggiuntivi

A list of any custom parameters for this time point.

Type:

List[models.scenario_models.ParametroAggiuntivo]

Azione: str
EtCO2: int
FC: int
FiO2: float
LitriO2: float
PA: str
RR: int
SpO2: int
T: float
TNo: int
TSi: int
altriDettagli: str
idTempo: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parametriAggiuntivi: List[ParametroAggiuntivo]
ruoloGenitore: str | None
timerTempo: int
classmethod validate_blood_pressure(v: str) str[source]

Validates that blood pressure is in the format ‘number/number’.

class models.scenario_models.Timeline(*, tempi: List[Tempo])[source]

Bases: BaseModel

A container for the entire sequence of time events in a scenario.

tempi

A list of Tempo objects that define the scenario’s progression.

Type:

List[models.scenario_models.Tempo]

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

tempi: List[Tempo]

Module contents

Data models for the Medical Simulation Suite AI.

This package centralizes all Pydantic data models used for structuring data within the application. It aggregates models from various sub-packages, including those for scenarios, medical exams, and reports, providing a single, consistent access point.

The __all__ variable explicitly defines the public API of this package, making it clear which models are intended for external use.

class models.AccessoArterioso(*, tipologia: Literal['Radiale', 'Femorale', 'Omerale', 'Brachiale', 'Ascellare', 'Pedidia', 'Altro'], posizione: str, lato: Literal['DX', 'SX'], misura: int)[source]

Bases: BaseModel

Represents a single arterial access point on a patient.

tipologia

The type of arterial access.

Type:

Literal[‘Radiale’, ‘Femorale’, ‘Omerale’, ‘Brachiale’, ‘Ascellare’, ‘Pedidia’, ‘Altro’]

posizione

The anatomical location of the access point.

Type:

str

lato

The side of the body (DX for right, SX for left).

Type:

Literal[‘DX’, ‘SX’]

misura

The gauge size of the access device (e.g., 20G).

Type:

int

lato: Literal['DX', 'SX']
misura: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

posizione: str
tipologia: Literal['Radiale', 'Femorale', 'Omerale', 'Brachiale', 'Ascellare', 'Pedidia', 'Altro']
class models.AccessoVenosso(*, tipologia: Literal['Periferico', 'Centrale', 'CVC a breve termine', 'CVC tunnellizzato', 'PICC', 'Midline', 'Intraosseo', 'PORT', 'Dialysis catheter', 'Altri'], posizione: str, lato: Literal['DX', 'SX'], misura: int)[source]

Bases: BaseModel

Represents a single venous access point on a patient.

tipologia

The type of venous access.

Type:

Literal[‘Periferico’, ‘Centrale’, ‘CVC a breve termine’, ‘CVC tunnellizzato’, ‘PICC’, ‘Midline’, ‘Intraosseo’, ‘PORT’, ‘Dialysis catheter’, ‘Altri’]

posizione

The anatomical location of the access point.

Type:

str

lato

The side of the body (DX for right, SX for left).

Type:

Literal[‘DX’, ‘SX’]

misura

The gauge size of the access device (e.g., 18G).

Type:

int

lato: Literal['DX', 'SX']
misura: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

posizione: str
tipologia: Literal['Periferico', 'Centrale', 'CVC a breve termine', 'CVC tunnellizzato', 'PICC', 'Midline', 'Intraosseo', 'PORT', 'Dialysis catheter', 'Altri']
class models.BaseScenario(*, azioniChiave: List[str], tipo: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario'], scenario: ScenarioInfo, presidi: List[str], esameFisico: EsameFisico, pazienteT0: PazienteT0)[source]

Bases: BaseModel

Defines the foundational components of a medical scenario.

azioniChiave

A list of key actions or learning objectives.

Type:

List[str]

tipo

The type of scenario (e.g., Quick, Advanced).

Type:

Literal[‘Quick Scenario’, ‘Advanced Scenario’, ‘Patient Simulated Scenario’]

scenario

General information and metadata about the scenario.

Type:

ScenarioInfo

presidi

A list of required medical equipment.

Type:

List[str]

esameFisico

The structured physical examination findings.

Type:

EsameFisico

pazienteT0

The initial state of the patient.

Type:

PazienteT0

azioniChiave: List[str]
esameFisico: EsameFisico
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pazienteT0: PazienteT0
presidi: List[str]
scenario: ScenarioInfo
tipo: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario']
class models.EsameFisico(*, sections: EsameFisicoSections)[source]

Bases: BaseModel

A container for the structured physical examination findings.

sections

An object containing the detailed findings for each part of the physical exam.

Type:

EsameFisicoSections

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sections: EsameFisicoSections
class models.EsameFisicoSections(*, Generale: str, Pupille: str, Cute: str, Collo: str, Torace: str, Cuore: str, Addome: str, Estremità: str, Neurologico: str, Retto: str, FAST: str)[source]

Bases: BaseModel

Contains the detailed findings for each section of a physical exam.

Each attribute holds HTML-formatted text describing the findings for that specific part of the examination.

Addome: str
Collo: str
Cuore: str
Cute: str
Estremità: str
FAST: str
Generale: str
Neurologico: str
Pupille: str
Retto: str
Torace: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class models.FullScenario(*, azioniChiave: List[str], tipo: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario'], scenario: ScenarioInfo, presidi: List[str], esameFisico: EsameFisico, pazienteT0: PazienteT0, tempi: List[Tempo], sceneggiatura: str)[source]

Bases: BaseModel

Represents a complete, advanced scenario with all possible components.

This model combines the base scenario with a timeline and a script for a fully interactive simulation.

azioniChiave: List[str]
esameFisico: EsameFisico
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pazienteT0: PazienteT0
presidi: List[str]
scenario: ScenarioInfo
sceneggiatura: str
tempi: List[Tempo]
tipo: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario']
class models.LabCategory(*, categoria: str, test: List[LabTest])[source]

Bases: BaseModel

Represents a category of laboratory exams.

categoria

The name of the lab category in Italian (e.g., ‘Ematologia’).

Type:

str

test

A list of individual lab tests belonging to this category.

Type:

List[LabTest]

categoria: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

test: List[LabTest]
class models.LabExamRequest(*, descrizione_scenario: str, tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro'], esame_obiettivo: str, patologia: str | None = None)[source]

Bases: BaseModel

Defines the request model for generating lab exams.

descrizione_scenario

A detailed description of the clinical scenario.

Type:

str

tipologia_paziente

The type of patient to adjust reference ranges for.

Type:

Literal[‘Adulto’, ‘Pediatrico’, ‘Neonatale’, ‘Prematuro’]

esame_obiettivo

The objective physical examination findings.

Type:

str

descrizione_scenario: str
esame_obiettivo: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

patologia: str | None
tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro']
class models.LabExamResponse(*, esami_laboratorio: List[LabCategory])[source]

Bases: BaseModel

Defines the structure for the final lab exams response.

esami_laboratorio

A list of laboratory exam categories.

Type:

List[LabCategory]

esami_laboratorio: List[LabCategory]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class models.LabTest(*, nome: str, valore: str, unita_misura: str | None, range_riferimento: str, referto: str)[source]

Bases: BaseModel

Represents a single laboratory test result.

nome

The name of the test in Italian (e.g., ‘Emoglobina’).

Type:

str

valore

The resulting value of the test, formatted as a string.

Type:

str

unita_misura

The unit of measurement for the test (e.g., ‘g/dL’).

Type:

Optional[str]

range_riferimento

The reference range for the test (e.g., ‘13.5 - 17.5’).

Type:

str

referto

A brief textual interpretation of the result in Italian.

Type:

str

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nome: str
range_riferimento: str
referto: str
unita_misura: str | None
valore: str
class models.MATModelRequest(*, descrizione_scenario: str, tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro'], target: str, esame_obiettivo: str)[source]

Bases: BaseModel

Defines the request model for generating a Medical Assessment Tool (MAT).

descrizione_scenario

A detailed description of the clinical scenario.

Type:

str

tipologia_paziente

The type of patient (Adult, Pediatric, etc.).

Type:

Literal[‘Adulto’, ‘Pediatrico’, ‘Neonatale’, ‘Prematuro’]

target

The target audience for the assessment tool.

Type:

str

esame_obiettivo

Detailed physical examination findings for context.

Type:

str

descrizione_scenario: str
esame_obiettivo: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

target: str
tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro']
class models.MATModelResponse(*, nome: str, descrizione: str)[source]

Bases: BaseModel

Defines the response model for a generated Medical Assessment Tool (MAT).

nome

The name of the generated material or tool.

Type:

str

descrizione

A description of the material or tool.

Type:

str

descrizione: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nome: str
class models.MatModelListResponse(*, materials: list[MATModelResponse])[source]

Bases: BaseModel

Defines the response model for a list of generated Medical Assessment Tools (MAT).

materials

A list of generated materials or tools.

Type:

list[MATModelResponse]

materials: list[MATModelResponse]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class models.MedicalReportRequest(*, descrizione_scenario: str, tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro'], tipologia_esame: Literal['ECG (Elettrocardiogramma)', 'RX Torace', 'TC Torace (con mdc)', 'TC Torace (senza mdc)', 'TC Addome (con mdc)', 'TC Addome (senza mdc)', 'Ecografia addominale', 'Ecografia polmonare', 'Ecocardio (Transtoracico)', 'Ecocardio (Transesofageo)', 'Spirometria', 'EEG (Elettroencefalogramma)', 'RM Encefalo', 'TC Cranio (con mdc)', 'TC Cranio (senza mdc)', 'Doppler TSA (Tronchi Sovraortici)', 'Angio-TC Polmonare', 'Fundus oculi'], esame_obiettivo: str)[source]

Bases: BaseModel

Defines the request model for generating a medical report.

descrizione_scenario

A detailed description of the clinical scenario.

Type:

str

tipologia_paziente

The type of patient (e.g., Adult, Pediatric).

Type:

Literal[‘Adulto’, ‘Pediatrico’, ‘Neonatale’, ‘Prematuro’]

tipologia_esame

The specific type of medical examination to report on.

Type:

Literal[‘ECG (Elettrocardiogramma)’, ‘RX Torace’, ‘TC Torace (con mdc)’, ‘TC Torace (senza mdc)’, ‘TC Addome (con mdc)’, ‘TC Addome (senza mdc)’, ‘Ecografia addominale’, ‘Ecografia polmonare’, ‘Ecocardio (Transtoracico)’, ‘Ecocardio (Transesofageo)’, ‘Spirometria’, ‘EEG (Elettroencefalogramma)’, ‘RM Encefalo’, ‘TC Cranio (con mdc)’, ‘TC Cranio (senza mdc)’, ‘Doppler TSA (Tronchi Sovraortici)’, ‘Angio-TC Polmonare’, ‘Fundus oculi’]

esame_obiettivo

Objective physical examination findings for context.

Type:

str

descrizione_scenario: str
esame_obiettivo: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

tipologia_esame: Literal['ECG (Elettrocardiogramma)', 'RX Torace', 'TC Torace (con mdc)', 'TC Torace (senza mdc)', 'TC Addome (con mdc)', 'TC Addome (senza mdc)', 'Ecografia addominale', 'Ecografia polmonare', 'Ecocardio (Transtoracico)', 'Ecocardio (Transesofageo)', 'Spirometria', 'EEG (Elettroencefalogramma)', 'RM Encefalo', 'TC Cranio (con mdc)', 'TC Cranio (senza mdc)', 'Doppler TSA (Tronchi Sovraortici)', 'Angio-TC Polmonare', 'Fundus oculi']
tipologia_paziente: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro']
class models.MedicalReportResponse(*, tipologia_esame: str, referto: str)[source]

Bases: BaseModel

Defines the response model for a generated medical report.

tipologia_esame

The type of examination that was performed.

Type:

str

referto

The complete medical report text in Italian.

Type:

str

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

referto: str
tipologia_esame: str
class models.ParametroAggiuntivo(*, unitaMisura: str, nome: str, valore: float)[source]

Bases: BaseModel

Represents an additional, custom vital sign or parameter.

unitaMisura

The unit of measurement for the parameter.

Type:

str

nome

The name of the parameter.

Type:

str

valore

The value of the parameter.

Type:

float

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nome: str
unitaMisura: str
valore: float
class models.PazienteT0(*, RR: int, SpO2: int, FiO2: float = 0, LitriO2: float = 0, EtCO2: int = 0, Monitor: str, accessiVenosi: ~typing.List[~models.scenario_models.AccessoVenosso] = <factory>, accessiArteriosi: ~typing.List[~models.scenario_models.AccessoArterioso] = <factory>, PA: str, FC: int, T: float)[source]

Bases: BaseModel

Defines the initial state and vital signs of the patient at time zero.

RR

Respiratory Rate in breaths per minute.

Type:

int

SpO2

Oxygen saturation in percent.

Type:

int

FiO2

Fraction of Inspired Oxygen.

Type:

float

LitriO2

Oxygen flow in liters per minute.

Type:

float

EtCO2

End-tidal CO2 in mmHg.

Type:

int

Monitor

Description of the initial patient monitoring setup.

Type:

str

accessiVenosi

A list of established venous access points.

Type:

List[AccessoVenosso]

accessiArteriosi

A list of established arterial access points.

Type:

List[AccessoArterioso]

PA

Blood pressure, formatted as ‘systolic/diastolic’.

Type:

str

FC

Heart rate in beats per minute.

Type:

int

T

Body temperature in Celsius.

Type:

float

EtCO2: int
FC: int
FiO2: float
LitriO2: float
Monitor: str
PA: str
RR: int
SpO2: int
T: float
accessiArteriosi: List[AccessoArterioso]
accessiVenosi: List[AccessoVenosso]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod validate_blood_pressure(v: str) str[source]

Validates that blood pressure is in the format ‘number/number’.

class models.ScenarioInfo(*, nome_paziente: str, patto_aula: str, obiettivo: str, timer_generale: float, infoGenitore: str | None = None, titolo: str, patologia: str, descrizione: str, briefing: str, moulage: str, liquidi: str, autori: str, tipologia: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro'], target: str)[source]

Bases: BaseModel

Holds general information and metadata about the simulation scenario.

nome_paziente

The patient’s name.

Type:

str

patto_aula

The “classroom agreement” or rules for the simulation.

Type:

str

obiettivo

The primary learning objective of the scenario.

Type:

str

timer_generale

The total duration of the scenario in minutes.

Type:

float

infoGenitore

Information provided by a parent (for pediatric cases).

Type:

Optional[str]

titolo

The title of the scenario.

Type:

str

patologia

The primary pathology or condition being simulated.

Type:

str

descrizione

A general description of the scenario.

Type:

str

briefing

The pre-scenario briefing for participants.

Type:

str

moulage

Description of the patient manikin’s setup and appearance.

Type:

str

liquidi

Description of available fluids and drugs.

Type:

str

autori

The authors of the scenario.

Type:

str

tipologia

The patient type (e.g., Adult, Pediatric).

Type:

Literal[‘Adulto’, ‘Pediatrico’, ‘Neonatale’, ‘Prematuro’]

target

The target audience for the simulation (e.g., medical students).

Type:

str

autori: str
briefing: str
descrizione: str
infoGenitore: str | None
liquidi: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

moulage: str
nome_paziente: str
obiettivo: str
patologia: str
patto_aula: str
target: str
timer_generale: float
tipologia: Literal['Adulto', 'Pediatrico', 'Neonatale', 'Prematuro']
titolo: str
class models.ScenarioRequest(*, description: str, scenario_type: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario'], target: str | None = None, difficulty: Literal['Facile', 'Medio', 'Difficile'] = 'Facile')[source]

Bases: BaseModel

Defines the request model for generating a new simulation scenario.

description

A text description of the desired clinical case.

Type:

str

scenario_type

The type of scenario to generate.

Type:

Literal[‘Quick Scenario’, ‘Advanced Scenario’, ‘Patient Simulated Scenario’]

target

The intended audience for the scenario.

Type:

Optional[str]

difficulty

The desired difficulty level, which influences clinical complexity and potential complications.

Type:

Literal[‘Facile’, ‘Medio’, ‘Difficile’]

description: str
difficulty: Literal['Facile', 'Medio', 'Difficile']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

scenario_type: Literal['Quick Scenario', 'Advanced Scenario', 'Patient Simulated Scenario']
target: str | None
class models.Sceneggiatura(*, sceneggiatura: str)[source]

Bases: BaseModel

Contains the script for a simulated patient or actor.

sceneggiatura

An HTML-formatted string containing the script.

Type:

str

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sceneggiatura: str
class models.Tempo(*, idTempo: int, RR: int, SpO2: int, FiO2: float = 0, LitriO2: float = 0, EtCO2: int = 0, TSi: int = 0, TNo: int = 0, altriDettagli: str, timerTempo: int = 0, ruoloGenitore: str | None = None, PA: str, FC: int, T: float, Azione: str, parametriAggiuntivi: ~typing.List[~models.scenario_models.ParametroAggiuntivo] = <factory>)[source]

Bases: BaseModel

Represents a specific time point or event within the scenario’s timeline.

idTempo

A unique identifier for the time point (e.g., 0 for T0).

Type:

int

TSi

The ID of the next time point if the correct action is taken.

Type:

int

TNo

The ID of the next time point if the incorrect action is taken.

Type:

int

altriDettagli

Additional details about the state at this time.

Type:

str

timerTempo

A specific timer for this event in seconds.

Type:

int

ruoloGenitore

Role or actions of a parent at this time point.

Type:

Optional[str]

Azione

The key action required to proceed to the ‘TSi’ state.

Type:

str

parametriAggiuntivi

A list of any custom parameters for this time point.

Type:

List[ParametroAggiuntivo]

Azione: str
EtCO2: int
FC: int
FiO2: float
LitriO2: float
PA: str
RR: int
SpO2: int
T: float
TNo: int
TSi: int
altriDettagli: str
idTempo: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

parametriAggiuntivi: List[ParametroAggiuntivo]
ruoloGenitore: str | None
timerTempo: int
classmethod validate_blood_pressure(v: str) str[source]

Validates that blood pressure is in the format ‘number/number’.

class models.Timeline(*, tempi: List[Tempo])[source]

Bases: BaseModel

A container for the entire sequence of time events in a scenario.

tempi

A list of Tempo objects that define the scenario’s progression.

Type:

List[Tempo]

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

tempi: List[Tempo]