AdmissionViewModel class
ViewModel de ingresos hospitalarios.
Gestiona el ciclo de vida de los ingresos del médico autenticado: carga, creación, alta, actualización clínica y reasignación de médico. Mantiene en memoria la lista admissions y la actualiza tras cada operación.
- Inheritance
-
- Object
- ChangeNotifier
- AdmissionViewModel
Constructors
- AdmissionViewModel({required AdmissionRepository repository})
Properties
-
admissions
→ List<
AdmissionResponse> -
no setter
- errorMessage → String?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isLoading → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
assignDoctor(
String admissionId, String doctorId, PatientPreviewResponse patient) → Future< bool> - Reasigna un ingreso a otro médico y actualiza la lista local en memoria.
-
clinicalUpdate(
{required String admissionId, required String principalDiagnosis, required String medicalHistory, required PatientPreviewResponse patient, String? allergies, String? chronicTreatment, int? basalBarthel}) → Future< AdmissionResponse?> - Actualiza los datos clínicos de un ingreso (diagnóstico, historial, escalas).
-
createAdmission(
{required String patientId, required String serviceId, required String principalDiagnosis, required String medicalHistory, String? allergies, String? chronicTreatment, int? basalBarthel}) → Future< bool> -
Crea un nuevo ingreso y devuelve
truesi el servidor confirma la creación. -
dischargeAdmission(
String admissionId) → Future< bool> -
Tramita el alta hospitalaria del ingreso
admissionId. -
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getUserAdmissions(
String doctorId) → Future< void> -
Carga los ingresos activos asignados al médico
doctorId. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited