FAQ | This is a LIVE service | Changelog

Create function is_research_group_active() in database

We need a function to answer the question 'is a research group 'active' where 'active' is as defined in the ro_group_status column in hotwire3."10_View/Groups/Research_Groups_Computing"

The column is defined as

        CASE
            WHEN pi_status.status_id::text = 'Current'::text THEN 'Active'::character varying
            WHEN has_current_members.has_current_members = true THEN 'Active'::character varying
            ELSE 'Inactive'::character varying
        END AS ro_group_status,

It should take one argument, the research group id, and return a boolean. It would be nice to create a second version that takes a research group name - this one can look up the id from the name and call the first function.