def form_valid(self, form): appointment = form.save(commit=False) appointment.author = self.request.user.provider appointment.author_type = get_current_provider_type(self.request) appointment.save() return HttpResponseRedirect(reverse("appointment-list"))
def form_valid(self, form): pnote = form.save(commit=False) pt = get_object_or_404(Patient, pk=self.kwargs['pt_id']) pnote.patient = pt pnote.author = self.request.user.provider pnote.author_type = get_current_provider_type(self.request) pnote.save() return HttpResponseRedirect(reverse("patient-detail", args=(pt.id, )))
def form_valid(self, form): pnote = form.save(commit=False) pt = get_object_or_404(Patient, pk=self.kwargs['pt_id']) pnote.patient = pt pnote.author = self.request.user.provider pnote.author_type = get_current_provider_type(self.request) pnote.save() return HttpResponseRedirect(reverse("patient-detail", args=(pt.id,)))
def dispatch(self, *args, **kwargs): ''' Intercept dispatch for NoteUpdate and verify that the user has permission to modify this Workup. ''' current_user_type = get_current_provider_type(self.request) wu = get_object_or_404(models.Workup, pk=kwargs['pk']) # if it's an attending, we allow updates. if current_user_type.signs_charts or not wu.signed(): return super(WorkupUpdate, self).dispatch(*args, **kwargs) else: return HttpResponseRedirect( reverse('workup', args=(kwargs['pk'], )))
def dispatch(self, *args, **kwargs): ''' Intercept dispatch for NoteUpdate and verify that the user has permission to modify this Workup. ''' current_user_type = get_current_provider_type(self.request) wu = get_object_or_404(models.Workup, pk=kwargs['pk']) # if it's an attending, we allow updates. if current_user_type.signs_charts or not wu.signed(): return super(WorkupUpdate, self).dispatch(*args, **kwargs) else: return HttpResponseRedirect(reverse('workup', args=(kwargs['pk'],)))
def form_valid(self, form): pnote = form.save(commit=False) active_provider_type = get_object_or_404( ProviderType, pk=self.request.session['clintype_pk']) pt = get_object_or_404(Patient, pk=self.kwargs['pt_id']) pnote.patient = pt pnote.author = self.request.user.provider pnote.author_type = get_current_provider_type(self.request) if pnote.author_type.signs_charts: pnote.sign(self.request.user, active_provider_type) pnote.save() form.save_m2m() return HttpResponseRedirect(reverse("patient-detail", args=(pt.id, )))
def form_valid(self, form): pt = get_object_or_404(Patient, pk=self.kwargs['pt_id']) fu = form.save(commit=False) fu.patient = pt fu.author = self.request.user.provider fu.author_type = get_current_provider_type(self.request) fu.save() form.save_m2m() if 'followup_create' in self.request.POST: return HttpResponseRedirect( reverse('new-action-item', args=(pt.id, ))) else: return HttpResponseRedirect( reverse("patient-detail", args=(pt.id, )))
def form_valid(self, form): pt = get_object_or_404(Patient, pk=self.kwargs['pt_id']) active_provider_type = get_object_or_404( ProviderType, pk=self.request.session['clintype_pk']) wu = form.save(commit=False) wu.patient = pt wu.author = self.request.user.provider wu.author_type = get_current_provider_type(self.request) wu.clinic_day = get_clindates()[0] if wu.author_type.signs_charts: wu.sign(self.request.user, active_provider_type) wu.save() form.save_m2m() return HttpResponseRedirect(reverse("new-action-item", args=(pt.id, )))
def form_valid(self, form): pt = get_object_or_404(Patient, pk=self.kwargs['pt_id']) fu = form.save(commit=False) fu.patient = pt fu.author = self.request.user.provider fu.author_type = get_current_provider_type(self.request) fu.save() form.save_m2m() if 'followup_create' in self.request.POST: return HttpResponseRedirect(reverse('new-action-item', args=(pt.id,))) else: return HttpResponseRedirect(reverse("patient-detail", args=(pt.id,)))
def form_valid(self, form): pt = get_object_or_404(Patient, pk=self.kwargs['pt_id']) active_provider_type = get_object_or_404( ProviderType, pk=self.request.session['clintype_pk']) wu = form.save(commit=False) wu.patient = pt wu.author = self.request.user.provider wu.author_type = get_current_provider_type(self.request) if wu.author_type.signs_charts: wu.sign(self.request.user, active_provider_type) wu.save() form.save_m2m() return HttpResponseRedirect(reverse("patient-detail", args=(pt.id,)))