def count_results(self): try: total = fetch_summary(table = self.table, cnds = {'national_id = %s': self.national_id, 'keyword = %s' : 'SMR'}, cols = ['COUNT(*) AS total'], exts = {} )[0].total return total except Exception, e: pass
def fetch_deaths(cnds, cols, exts): return fetch_summary(Death._table, cnds, cols, exts)
def fetch_refusals(cnds, cols, exts): return fetch_summary(Refusal._table, cnds, cols, exts)
def fetch_riskresults(cnds, cols, exts): return fetch_summary(Riskresult._table, cnds, cols, exts)
def fetch_ancvisits(cnds, cols, exts): return fetch_summary(Ancvisit._table, cnds, cols, exts)
def fetch_nbcvisits(cnds, cols, exts): return fetch_summary(Nbcvisit._table, cnds, cols, exts)
def fetch_stock(cnds, cols, exts): return fetch_summary(Stock._table, cnds, cols, exts)
def fetch_ccms(cnds, cols, exts): return fetch_summary(CCM._table1, cnds, cols, exts)
def fetch_nutritions(cnds, cols, exts): return fetch_summary(Nutrition._table, cnds, cols, exts)
def fetch_enderrors(cnds, cols, exts): return fetch_summary(Enderror._table, cnds, cols, exts)
def fetch_departures(cnds, cols, exts): return fetch_summary(Departure._table, cnds, cols, exts)
def fetch_pregnancies(cnds, cols, exts): return fetch_summary(Pregnancy._table, cnds, cols, exts)
def fetch_births(cnds, cols, exts): return fetch_summary(Birth._table, cnds, cols, exts)
def get_ambulances_summary(cnds, cols, exts): return fetch_summary(Ambulance._table, cnds, cols, exts)
def fetch_childhealths(cnds, cols, exts): return fetch_summary(Childhealth._table, cnds, cols, exts)
def fetch_mothers(cnds, cols, exts): return fetch_summary(Mother._table, cnds, cols, exts)
def fetch_malaria(cnds, cols, exts): return fetch_summary(Malaria._table, cnds, cols, exts)
def fetch_cmrs(cnds, cols, exts): return fetch_summary(CCM._table2, cnds, cols, exts)
def fetch_downloads(cnds, cols, exts): return fetch_summary(Download._table, cnds, cols, exts)
def fetch_risks(cnds, cols, exts): return fetch_summary(Risk._table, cnds, cols, exts)
def fetch_redalerts(cnds, cols, exts): return fetch_summary(Redalert._table, cnds, cols, exts)