class OxigenoTerapiaForm(FieldSetModelFormMixin): """Permite agregar y editar :class:`OxigenoTerapia`s""" class Meta: model = OxigenoTerapia admision = forms.ModelChoiceField(label="", queryset=Admision.objects.all(), widget=forms.HiddenInput(), required=False) usuario = forms.ModelChoiceField(label="", queryset=User.objects.all(), widget=forms.HiddenInput(), required=False) inicio = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) fin = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) cargo = ModelChoiceField(name="", model="", queryset=ItemTemplate.objects.filter( activo=True).order_by('descripcion').all()) def __init__(self, *args, **kwargs): super(OxigenoTerapiaForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Oxigeno Terapia', *self.field_names)
class DosisForm(FieldSetModelFormMixin): class Meta: model = Dosis fecha_y_hora = forms.DateTimeField(widget=DateTimeWidget(), required=False) medicamento = forms.ModelChoiceField(label="", queryset=Medicamento.objects.all(), widget=forms.HiddenInput(), required=False) usuario = forms.ModelChoiceField(label="", queryset=User.objects.all(), widget=forms.HiddenInput(), required=False) administrador = forms.ModelChoiceField(label="", queryset=User.objects.all(), widget=forms.HiddenInput(), required=False) def __init__(self, *args, **kwargs): super(DosisForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Registrar Dosis de Medicamento', *self.field_names)
class MedicamentoForm(AdmisionBaseForm): """Permite Agregar o modificar los datos de un :class:`Medicamento`""" class Meta: model = Medicamento exclude = ('proxima_dosis', 'suministrado') inicio = forms.DateTimeField(widget=DateTimeWidget(), required=False) cargo = ModelChoiceField(name='cargo', model='', queryset=ItemTemplate.objects.filter( activo=True).order_by('descripcion').all()) admision = forms.ModelChoiceField(label="", queryset=Admision.objects.all(), widget=forms.HiddenInput(), required=False) usuario = forms.ModelChoiceField(label="", queryset=User.objects.all(), widget=forms.HiddenInput(), required=False) def __init__(self, *args, **kwargs): super(MedicamentoForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Recetar Medicamento', *self.field_names)
class IngresarForm(FieldSetModelFormMixin): """Muestra un formulario que permite ingresar a una :class:`Persona` al :class:`Hospital`""" class Meta: model = Admision fields = ('habitacion', 'ingreso', 'hospitalizacion') ingreso = forms.DateTimeField(widget=DateTimeWidget(), required=True, initial=timezone.now) hospitalizacion = forms.DateTimeField(widget=DateTimeWidget(), required=True, initial=timezone.now) def __init__(self, *args, **kwargs): super(IngresarForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Hospitalizar Paciente', *self.field_names)
class TurnoCajaForm(HiddenUserForm): class Meta: model = TurnoCaja exclude = ('finalizado', 'fin') inicio = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(TurnoCajaForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Iniciar un Turno', *self.field_names)
class BeneficiarioForm(ContratoMixin): class Meta: model = Beneficiario inscripcion = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(BeneficiarioForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Formulario de Registro de Beneficiario', *self.field_names)
class EsperaForm(BasePersonaForm, ConsultorioFormMixin, FieldSetModelFormMixin): class Meta: model = Espera fecha = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(EsperaForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Agregar Persona a la Sala de Espera', *self.field_names)
class DepositoForm(FieldSetModelFormMixin): class Meta: model = Deposito fecha = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(DepositoForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Agregar Deposito', *self.field_names)
class TurnoCajaCierreForm(FieldSetModelFormMixin): class Meta: model = TurnoCaja fields = ('finalizado', 'fin',) fin = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(TurnoCajaCierreForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Cerrar Turno', *self.field_names)
class CargoForm(AdmisionBaseForm): """Muestra un formulario que permite agregar :class:`Cargo`s a una :class:`Persona` durante una :class:`Admision`""" class Meta: model = Cargo exclude = ('facturada', ) cargo = ModelChoiceField(queryset=ItemTemplate.objects.filter( activo=True).order_by('descripcion').all(), name="nombre", model="") inicio = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) fin = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(CargoForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Agregar Cargo', *self.field_names)
class CitaForm(ConsultorioFormMixin): class Meta: model = Cita exclude = ('ausente', 'atendida',) persona = ModelChoiceField(queryset=Persona.objects.all(), name="", model="") fecha = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(CitaForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Agregar una Cita', *self.field_names)
class BeneficiarioPersonaForm(FieldSetModelFormMixin): class Meta: model = Beneficiario contrato = ModelChoiceField( queryset=Contrato.objects.filter(vencimiento__lte=timezone.now()), name="nombre", model="") inscripcion = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(BeneficiarioPersonaForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Formulario de Registro de Beneficiario', *self.field_names)
class ContratoEmpresarialForm(FieldSetModelFormMixin): class Meta: model = Contrato exclude = ('cancelado',) vencimiento = forms.DateField(widget=FutureDateWidget) ultimo_pago = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) inicio = forms.DateField(widget=FutureDateWidget()) def __init__(self, *args, **kwargs): super(ContratoEmpresarialForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Formulario de Contrato', *self.field_names)
class DosificarForm(forms.Form): """Permite indicar el momento en el que se efectua la dosificación de un :class:`Medicamento`""" hora = forms.DateTimeField(widget=DateTimeWidget(), required=False) def __init__(self, *args, **kwargs): super(DosificarForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.html5_required = True self.field_names = self.fields.keys() self.helper.layout = Fieldset(u'Dosificar Medicamento', *self.field_names) self.helper.add_input(Submit('submit', 'Guardar'))
class SumarioForm(AdmisionBaseForm): """Muestra un formulario que permite agregar :class:`Cargo`s a una :class:`Persona` durante una :class:`Admision`""" fecha = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) class Meta: model = Sumario def __init__(self, *args, **kwargs): super(SumarioForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Ingresar Sumario Médico', *self.field_names)
class BaseForm(FieldSetModelFormMixin): """Formulario base para los distintos ingresos de información de parte de los diversos modelos de enfermeria""" fecha_y_hora = forms.DateTimeField(widget=DateTimeWidget(), required=False) admision = forms.ModelChoiceField(label="", queryset=Admision.objects.all(), widget=forms.HiddenInput(), required=False) usuario = forms.ModelChoiceField(label="", queryset=User.objects.all(), widget=forms.HiddenInput(), required=False)
class BeneficiarioPersonaForm(BasePersonaForm): class Meta: model = Beneficiario exclude =('activo', 'dependiente',) contrato = ModelChoiceField( queryset=Contrato.objects.all(), name="nombre", model="") inscripcion = forms.DateTimeField(widget=DateTimeWidget(), required=False, initial=timezone.now) def __init__(self, *args, **kwargs): super(BeneficiarioPersonaForm, self).__init__(*args, **kwargs) self.helper.layout = Fieldset(u'Formulario de Registro de Beneficiario', *self.field_names)