Skip to content

Commit

Permalink
#34: Add count
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Aug 29, 2019
1 parent cfc9b8d commit 127e6be
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,3 +539,14 @@ def get_investigations_for_instrument_in_facility_cycle(instrument_id, facility_

finally:
session.close()


def get_investigations_for_instrument_in_facility_cycle_count(instrument_id, facility_cycle_id):
"""
Given an instrument id and facility cycle id, get the count of the investigations that use the given instrument in
the given cycle
:param instrument_id: The id of the instrument
:param facility_cycle_id: the ID of the facility cycle
:return: The investigations count
"""
return len(get_investigations_for_instrument_in_facility_cycle(instrument_id, facility_cycle_id))

0 comments on commit 127e6be

Please sign in to comment.