Beispiel #1
0
def delete_visit(request, id):
    """
	"""
    from ocemr.models import Visit

    o = Visit.objects.get(pk=id)
    if not (o.status == 'SCHE' or o.status == 'WAIT'):
        return render(
            request, 'popup_info.html', {
                'title': 'Schedule Patient Visit',
                'info': "Cannot Delete Active Visit",
            })

    from ocemr.forms import ConfirmDeleteForm

    if request.method == 'POST':
        form = ConfirmDeleteForm(request.POST)
        if form.is_valid():
            if form.cleaned_data['doDelete']:
                o.delete()
            return HttpResponseRedirect('/close_window/')
    else:
        form = ConfirmDeleteForm()
    return render(
        request, 'popup_form.html', {
            'title': 'Delete Visit: %s' % (o),
            'form_action': '/patient/delete_visit/%s/' % (id),
            'form': form,
        })
Beispiel #2
0
def delete_visit(request, id):
	"""
	"""
	from ocemr.models import Visit

	o = Visit.objects.get(pk=id)
	if not (o.status == 'SCHE' or o.status == 'WAIT'):
		return render(request, 'popup_info.html', {
			'title': 'Schedule Patient Visit',
			'info': "Cannot Delete Active Visit",
		})


        from ocemr.forms import ConfirmDeleteForm

        if request.method == 'POST':
                form = ConfirmDeleteForm(request.POST)
                if form.is_valid():
                        if form.cleaned_data['doDelete']:
                                o.delete()
                        return HttpResponseRedirect('/close_window/')
        else:
                form = ConfirmDeleteForm()
        return render(request, 'popup_form.html', {
                'title': 'Delete Visit: %s'%(o),
                'form_action': '/patient/delete_visit/%s/'%(id),
                'form': form,
        })
Beispiel #3
0
def visit_allergy_delete(request,id, oid):
	"""
	"""
	from ocemr.models import Allergy
	o = Allergy.objects.get(pk=oid)

	from ocemr.forms import ConfirmDeleteForm

	if request.method == 'POST': 
		form = ConfirmDeleteForm(request.POST)
		if form.is_valid():
			if form.cleaned_data['doDelete']:
				o.delete()
			return HttpResponseRedirect('/close_window/')
	else:
		form = ConfirmDeleteForm()
	return render_to_response('popup_form.html', {
		'title': 'Delete Allergy: %s'%(o.to),
		'form_action': '/visit/%s/allergy/delete/%s/'%(id,oid),
		'form': form,
	},context_instance=RequestContext(request))
Beispiel #4
0
def visit_subj_delete(request,id, visitsymptomid):
	"""
	"""
	from ocemr.models import VisitSymptom
	o = VisitSymptom.objects.get(pk=visitsymptomid)

	from ocemr.forms import ConfirmDeleteForm

	if request.method == 'POST': 
		form = ConfirmDeleteForm(request.POST)
		if form.is_valid():
			if form.cleaned_data['doDelete']:
				o.delete()
			return HttpResponseRedirect('/close_window/')
	else:
		form = ConfirmDeleteForm()
	return render_to_response('popup_form.html', {
		'title': 'Delete Symptom: %s'%(o.type.title),
		'form_action': '/visit/%s/subj/delete/%s/'%(id,visitsymptomid),
		'form': form,
	},context_instance=RequestContext(request))
Beispiel #5
0
def diag_delete(request,id):
        """
        """
        from ocemr.models import Diagnosis
        o = Diagnosis.objects.get(pk=id)

        from ocemr.forms import ConfirmDeleteForm

        if request.method == 'POST':
                form = ConfirmDeleteForm(request.POST)
                if form.is_valid():
                        if form.cleaned_data['doDelete']:
                                o.delete()
                        return HttpResponseRedirect('/close_window/')
        else:
                form = ConfirmDeleteForm()
        return render(request, 'popup_form.html', {
                'title': 'Delete Diagnosis: %s'%(o),
                'form_action': '/diag/%s/delete/'%(id),
                'form': form,
        })
Beispiel #6
0
def diag_delete(request, id):
    """
        """
    from ocemr.models import Diagnosis
    o = Diagnosis.objects.get(pk=id)

    from ocemr.forms import ConfirmDeleteForm

    if request.method == 'POST':
        form = ConfirmDeleteForm(request.POST)
        if form.is_valid():
            if form.cleaned_data['doDelete']:
                o.delete()
            return HttpResponseRedirect('/close_window/')
    else:
        form = ConfirmDeleteForm()
    return render(
        request, 'popup_form.html', {
            'title': 'Delete Diagnosis: %s' % (o),
            'form_action': '/diag/%s/delete/' % (id),
            'form': form,
        })
Beispiel #7
0
def visit_allergy_delete(request, id, oid):
    """
	"""
    from ocemr.models import Allergy
    o = Allergy.objects.get(pk=oid)

    from ocemr.forms import ConfirmDeleteForm

    if request.method == 'POST':
        form = ConfirmDeleteForm(request.POST)
        if form.is_valid():
            if form.cleaned_data['doDelete']:
                o.delete()
            return HttpResponseRedirect('/close_window/')
    else:
        form = ConfirmDeleteForm()
    return render(
        request, 'popup_form.html', {
            'title': 'Delete Allergy: %s' % (o.to),
            'form_action': '/visit/%s/allergy/delete/%s/' % (id, oid),
            'form': form,
        })
Beispiel #8
0
def visit_subj_delete(request, id, visitsymptomid):
    """
	"""
    from ocemr.models import VisitSymptom
    o = VisitSymptom.objects.get(pk=visitsymptomid)

    from ocemr.forms import ConfirmDeleteForm

    if request.method == 'POST':
        form = ConfirmDeleteForm(request.POST)
        if form.is_valid():
            if form.cleaned_data['doDelete']:
                o.delete()
            return HttpResponseRedirect('/close_window/')
    else:
        form = ConfirmDeleteForm()
    return render(
        request, 'popup_form.html', {
            'title': 'Delete Symptom: %s' % (o.type.title),
            'form_action': '/visit/%s/subj/delete/%s/' % (id, visitsymptomid),
            'form': form,
        })