patient_tracker.transform_exclusion_rules package#

Submodules#

patient_tracker.transform_exclusion_rules.rules module#

class patient_tracker.transform_exclusion_rules.rules. Rule ( _typename , _fields = None , / , ** kwargs )#

Bases: dict

Description : str #
Name : str #
args : List [ str ] #
function : Callable #
source : str #
patient_tracker.transform_exclusion_rules.rules. attach_most_recent_appointment_details ( df : DataFrame , appointments : DataFrame ) DataFrame #
patient_tracker.transform_exclusion_rules.rules. drop_pathways_with_date_of_death ( df : DataFrame , demographics : DataFrame ) DataFrame #

Drop referrals where patient has a date of death

Parameters:
  • df (pd.DataFrame) – Referrals

  • demographics (pd.DataFrame) – Demographics of patients

Returns:

The referral dataframe with referrals dropped based on date of death

Return type:

pd.DataFrame

patient_tracker.transform_exclusion_rules.rules. drop_referrals_by_PTL_status ( df : DataFrame , ptl : DataFrame ) DataFrame #

Drop referrals based on PTL status

Parameters:
  • df (pd.DataFrame) – Referrals with dropped values based on status

  • ptl (pd.DataFrame) – The RTT dataframe

Returns:

The referral dataframe with referrals dropped based on RTT status

Return type:

pd.DataFrame

patient_tracker.transform_exclusion_rules.rules. drop_referrals_by_status ( df : DataFrame ) DataFrame #

Drops referrals based on status

Parameters:

df (pd.DataFrame) – The referral dataframe

Returns:

The referral dataframe with referrals dropped based on status

Return type:

pd.DataFrame

patient_tracker.transform_exclusion_rules.rules. drop_referrals_with_close_date ( df : DataFrame ) DataFrame #

Drop referrals with close date

Parameters:

df (pd.DataFrame) – Referrals

Returns:

Referrals with close date dropped

Return type:

pd.DataFrame

patient_tracker.transform_exclusion_rules.rules. drop_referrals_with_discharged_outcome ( df : DataFrame ) DataFrame #

Drop referrals with discharged outcome

Parameters:

df (pd.DataFrame) – Referrals

Returns:

Referrals with discharged outcome dropped

Return type:

pd.DataFrame

patient_tracker.transform_exclusion_rules.rules. filter_by_appointment_outcome_and_date ( df : DataFrame , appointments : DataFrame ) DataFrame #
patient_tracker.transform_exclusion_rules.rules. filter_community_dental ( df : DataFrame , appointments : DataFrame ) DataFrame #

Gets the community dental referrals. These are referrals with one OPA with a clinic code of a community dental appointment, but with no followups.

Parameters:
  • df (pd.DataFrame) – Referrals

  • appointments (pd.DataFrame) – Appointments

Returns:

The community dental referrals

Return type:

pd.DataFrame

patient_tracker.transform_exclusion_rules.rules. filter_no_appointments ( df : DataFrame , appointments : DataFrame ) DataFrame #
patient_tracker.transform_exclusion_rules.rules. remove_discharged_appointments ( df : DataFrame , appointments : DataFrame ) DataFrame #

Module contents#