from django.contrib import messages
from diagnoses.models import diagnose,condition,disease_details
from  diagnoses.forms import  form_condition,form_condition_search,form_diagnose,form_diagnose_search,form_disease_details,form_disease_details_search
from baseapp.views import formview_base,view_base,formview_base_patient,view_base_patient
# Create your views here.



def formview_diagnose(request,pid=1, id = 0):    return formview_base_patient(request,form_diagnose,diagnose,'Diagnosis',pid,id,'add_diagnosis')

def view_diagnose(request,pid,viewtype ='tbl',*args, **kwargs):
    return view_base_patient(request,diagnose,form_diagnose_search,pid,form_diagnose.Meta.fields ,form_diagnose.Meta.fields,'Diagnosis',viewtype,'view_diagnosis','diag')



def formview_condition(request,pid=1, id = 0):    return formview_base_patient(request,form_condition,condition,'Condition',pid,id,'add_condition')

def view_condition(request,pid,viewtype ='tbl',*args, **kwargs):
    return view_base_patient(request,condition,form_condition_search,pid,form_condition.Meta.fields ,form_condition.Meta.fields,'Condition',viewtype,'view_condition','condi')


def formview_disease_details(request,pid=1, id = 0):    return formview_base_patient(request,form_disease_details,disease_details,'Disease details',pid,id,'add_disease')

def view_disease_details(request,pid,viewtype ='tbl',*args, **kwargs):
    return view_base_patient(request,disease_details,form_disease_details_search,pid,form_disease_details.Meta.fields ,form_disease_details.Meta.fields,'Disease details',viewtype,'view_disease','disease_notes')

