Exemplo n.º 1
0
	def test_smr(self):

		admission_dictionary = summaries.total_year_admissions(year="2016")

		# get the list for june and assert we have 2 entries
		smr = admission_dictionary['totals'].get('smr')
		self.assertEquals(8.601906960467891, smr)
Exemplo n.º 2
0
	def test_expected_deaths(self):

		admission_dictionary = summaries.total_year_admissions(year="2016")

		# get the list for june and assert we have 2 entries
		expected_deaths = admission_dictionary['totals'].get('expected_deaths')
		self.assertEquals('0.46501316724104913', str(expected_deaths))
Exemplo n.º 3
0
	def test_mortality_rate(self):

		admission_dictionary = summaries.total_year_admissions(year="2016")

		# get the list for june and assert we have 2 entries
		mortality_rate = admission_dictionary['totals'].get('mortality_rate')
		self.assertEquals('80.0%', mortality_rate)
Exemplo n.º 4
0
	def test_total_admissions(self):

		admission_dictionary = summaries.total_year_admissions(year="2016")

		# get the list for june and assert we have 2 entries
		total_admissions = admission_dictionary['totals'].get('total_admissions')
		self.assertEquals(5, total_admissions)
Exemplo n.º 5
0
def summary_reports(request, year=None):

    years = get_valid_years_list()

    year = extract_year(request, year, years[0])
    results = summaries.total_year_admissions(year)
    monthly_admission_list = results['admissions']
    totals_summary = results['totals']
    boys = results['boys']
    girls = results['girls']
    deaths = results['deaths']
    discharges = results['discharges']
    ventilations = results['ventialtions']

    return render(
        request, 'picu/summary_reports.html', {
            'admissions': monthly_admission_list.items(),
            'totals': totals_summary.items(),
            'year': int(year),
            'boys': boys.items(),
            'girls': girls.items(),
            'deaths': deaths.items(),
            'discharges': discharges.items(),
            'ventilations': ventilations.items(),
            'total_days': results['total_days'].items(),
            'hospital': 'needs to go into the session',
            'years': years,
            'sum_admissions': results['sum_admissions'],
            'sum_discharges': results['sum_discharges'],
            'sum_girls': results['sum_girls'],
            'sum_boys': results['sum_boys'],
            'sum_ventilated': results['sum_ventilated'],
            'sum_deaths': results['sum_deaths'],
            'sum_patient_days': results['sum_patient_days']
        })
Exemplo n.º 6
0
	def test_total_year_admissions(self):

		admission_dictionary = summaries.total_year_admissions(year="2016")

		self.assertEquals(12, len(admission_dictionary['admissions']))

		# get the list for june and assert we have 2 entries
		list_values = admission_dictionary['admissions'].get(5)
		self.assertEquals(2, len(list_values))