pat2vec.pat2vec_get_methods.get_method_appointmentsο
Functions
|
Retrieves pims_apps features for a given patient within a date range. |
|
Searches for appointment data for a specific patient within a date range. |
- pat2vec.pat2vec_get_methods.get_method_appointments.search_appointments(cohort_searcher_with_terms_and_search=None, client_id_codes=None, appointments_time_field='AppointmentDateTime', start_year='1995', start_month='01', start_day='01', end_year='2025', end_month='12', end_day='12', additional_custom_search_string=None)[source]ο
Searches for appointment data for a specific patient within a date range.
Uses a cohort searcher to find appointment data.
- Parameters:
cohort_searcher_with_terms_and_search (Optional[Callable]) β The function for cohort searching. Defaults to None.
client_id_codes (Optional[Union[str, List[str]]]) β The client ID code(s) of the patient(s). Defaults to None.
appointments_time_field (str) β The timestamp field for filtering appointments. Defaults to βAppointmentDateTimeβ.
start_year (str) β Start year for the search. Defaults to β1995β.
start_month (str) β Start month for the search. Defaults to β01β.
start_day (str) β Start day for the search. Defaults to β01β.
end_year (str) β End year for the search. Defaults to β2025β.
end_month (str) β End month for the search. Defaults to β12β.
end_day (str) β End day for the search. Defaults to β12β.
additional_custom_search_string (Optional[str]) β An additional string to append to the search query. Defaults to None.
- Returns:
A DataFrame containing the raw appointment data.
- Return type:
pd.DataFrame
- pat2vec.pat2vec_get_methods.get_method_appointments.get_appointments(current_pat_client_id_code, target_date_range, pat_batch, config_obj=None, cohort_searcher_with_terms_and_search=None)[source]ο
Retrieves pims_apps features for a given patient within a date range.
This function retrieves appointment data, either from a pre-loaded batch DataFrame or by searching, and then processes it to create one-hot encoded features for consultant, clinic, and appointment type.
- Parameters:
current_pat_client_id_code (str) β The client ID code of the patient.
target_date_range (tuple) β A tuple representing the target date range.
pat_batch (pd.DataFrame) β The DataFrame containing patient data for batch mode.
config_obj (Optional[object]) β Configuration object. Defaults to None.
cohort_searcher_with_terms_and_search (Optional[Callable]) β The function for cohort searching. Defaults to None.
- Returns:
- A DataFrame containing pims_apps features for the
specified patient. If no data is found, a DataFrame with only the βclient_idcodeβ is returned.
- Return type:
pd.DataFrame