14.3.20. crate_anon.crateweb.consent.lookup_common

crate_anon/crateweb/consent/lookup_common.py


Copyright (C) 2015, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).

This file is part of CRATE.

CRATE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CRATE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CRATE. If not, see <https://www.gnu.org/licenses/>.


Helper functions for consent-for-contact lookup processes.

class crate_anon.crateweb.consent.lookup_common.SignatoryTitles[source]

Standard signatory titles for clinicians of various kinds.

crate_anon.crateweb.consent.lookup_common.get_team_details(team_name: str, start_date: date | datetime, end_date: date | datetime | None, decisions: List[str]) ClinicianInfoHolder[source]

Modify team_info if possible to add a team representative’s details.

Parameters:
  • team_name – Name of the team to look up.

  • start_date – Start date for the team’s involvement.

  • end_date – Optional end date for the team’s involvement.

  • decisions – Log of decisions made. Will be written to.

crate_anon.crateweb.consent.lookup_common.pick_best_clinician(lookup: PatientLookup, clinicians: List[ClinicianInfoHolder], decisions: List[str]) None[source]

By now we know all relevant recent clinicians, including (potentially) ones from which the patient has been discharged, and ones that are active.

Work through possible clinicians and see who’s the best to pick (e.g. is contactable!). Store that information back in the lookup,

Parameters:
  • lookup – Patient being looked up. Will be modified.

  • clinicians – Candidate clinicians.

  • decisions – Log of decisions made. Will be written to.