Patients

This package contains views related to patients

Assign View

class ycms.cms.views.patients.assign_view.AssignPatientView(**kwargs)

Bases: TemplateView

View allowing to assign the bed assignment visually

context_object_name = 'bed_assignment'
dispatch(request, *args, **kwargs)
get_context_data(**kwargs)
model

alias of BedAssignment

post(request, *args, **kwargs)

This function assigns a patient to a room

template_name = 'bed_assignment/assign_bed_assignment.html'

Discharge View

class ycms.cms.views.patients.discharge_view.DischargePatientView(**kwargs)

Bases: View

View to discharge a patient

dispatch(request, *args, **kwargs)
post(request, *args, **kwargs)

This function discharges a patient

Intake Form View

class ycms.cms.views.patients.intake_form_view.IntakeFormView(**kwargs)

Bases: TemplateView

View to perform intake on new or existing patients

dispatch(request, *args, **kwargs)
get_context_data(**kwargs)

This function returns a list of all patients, as well as a form for creating a new one

Parameters:

kwargs (dict) – The supplied keyword arguments

Returns:

Response for filtered offers

Return type:

TemplateResponse

post(request, *args, **kwargs)

Submit PatientForm

Parameters:
  • request (HttpRequest) – The current request

  • *args (list) – The supplied arguments

  • **kwargs (dict) – The supplied keyword arguments

Returns:

Redirect to list of patients

Return type:

HttpResponseRedirect

template_name = 'patients/patient_intake_form.html'

Patient Details View

class ycms.cms.views.patients.patient_details_view.IntakeUpdateView(**kwargs)

Bases: UpdateView

View to update a hospital stay

dispatch(request, *args, **kwargs)
form_class

alias of RecordForm

form_invalid(form)

If the form is invalid, render the invalid form.

form_valid(form)

If the form is valid, save the associated model.

model

alias of MedicalRecord

class ycms.cms.views.patients.patient_details_view.PatientDetailsView(**kwargs)

Bases: TemplateView

View to see all information about a single patient and their medical history

dispatch(request, *args, **kwargs)
get_context_data(**kwargs)

This function returns all data about a patient.

Parameters:

kwargs (dict) – The supplied keyword arguments

Returns:

Response for filtered offers

Return type:

TemplateResponse

template_name = 'patients/patient_details.html'
class ycms.cms.views.patients.patient_details_view.PlannedStayCancelView(*args, **kwargs)

Bases: DeleteView

View to cancel (delete) a planned hospital stay

dispatch(request, *args, **kwargs)
form_invalid(form)

If the form is invalid, render the invalid form.

form_valid(_form)

If the form is valid, redirect to the supplied URL.

model

alias of BedAssignment

class ycms.cms.views.patients.patient_details_view.RecordCreateView(**kwargs)

Bases: CreateView

View to create a record

dispatch(request, *args, **kwargs)
form_class

alias of RecordForm

form_invalid(form)

If the form is invalid, render the invalid form.

form_valid(form)

If the form is valid, save the associated model.

model

alias of MedicalRecord

Patients List View

class ycms.cms.views.patients.patients_list_view.PatientCreateView(**kwargs)

Bases: CreateView

View to create a patient

dispatch(request, *args, **kwargs)
form_class

alias of PatientForm

form_invalid(form)

If the form is invalid, render the invalid form.

form_valid(form)

If the form is valid, save the associated model.

model

alias of Patient

success_url = '/patients/'
class ycms.cms.views.patients.patients_list_view.PatientDeleteView(*args, **kwargs)

Bases: DeleteView

View to delete a patient

dispatch(request, *args, **kwargs)
form_invalid(form)

If the form is invalid, render the invalid form.

form_valid(form)

If the form is valid, redirect to the supplied URL.

model

alias of Patient

success_url = '/patients/'
class ycms.cms.views.patients.patients_list_view.PatientUpdateView(**kwargs)

Bases: UpdateView

View to update a patient

dispatch(request, *args, **kwargs)
form_class

alias of PatientForm

form_invalid(form)

If the form is invalid, render the invalid form.

form_valid(form)

If the form is valid, save the associated model.

get_form_kwargs()

Return the keyword arguments for instantiating the form.

model

alias of Patient

class ycms.cms.views.patients.patients_list_view.PatientsListView(**kwargs)

Bases: TemplateView

View to see all patients and add a new one

dispatch(request, *args, **kwargs)
get_context_data(**kwargs)

This function returns a list of all patients.

Parameters:

kwargs (dict) – The supplied keyword arguments

Returns:

Response for filtered offers

Return type:

TemplateResponse

template_name = 'patients/patients_list.html'

Update Patient Stay View

class ycms.cms.views.patients.update_patient_stay_view.UpdatePatientStayView(**kwargs)

Bases: TemplateView

View to update a patient’s detail and their most recent hospital stay

dispatch(request, *args, **kwargs)
get(request, *args, **kwargs)

This function returns forms for updating a patient and their current bed assignment

Parameters:
  • request (HttpRequest) – The current request

  • args (list) – The supplied arguments

  • kwargs (dict) – The supplied keyword arguments

Returns:

Response for filtered offers

Return type:

TemplateResponse

post(request, *args, **kwargs)
Submit PatientForm

and IntakeBedAssignmentForm

Parameters:
  • request (HttpRequest) – The current request

  • *args (list) – The supplied arguments

  • **kwargs (dict) – The supplied keyword arguments

Returns:

Redirect to list of patients

Return type:

HttpResponseRedirect

template_name = 'patients/patient_card_wrapper.html'