pat2vec.pat2vec_get_methods.get_method_demoο
Functions
|
Gets demographics information for patients within a specified date range. |
|
Processes raw demographics data to return the most recent record per patient. |
|
Searches for demographics data for patients within a date range. |
- pat2vec.pat2vec_get_methods.get_method_demo.search_demographics(cohort_searcher_with_terms_and_search=None, client_id_codes=None, demographics_time_field='updatetime', 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 demographics data for patients within a date range.
- 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.
demographics_time_field (str) β The timestamp field for filtering demographics. Defaults to βupdatetimeβ.
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 demographics data.
- Return type:
pd.DataFrame
- Raises:
ValueError β If essential arguments are None.
- pat2vec.pat2vec_get_methods.get_method_demo.process_demographics_data(demo_data, patlist)[source]ο
Processes raw demographics data to return the most recent record per patient.
- Parameters:
demo_data (pd.DataFrame) β Raw demographics data from the search.
patlist (List[str]) β List of patient IDs that were requested.
- Returns:
- Processed demographics data containing the single most
recent record for the patient(s).
- Return type:
pd.DataFrame
- pat2vec.pat2vec_get_methods.get_method_demo.get_demographics3(patlist, target_date_range, cohort_searcher_with_terms_and_search, config_obj=None)[source]ο
Gets demographics information for patients within a specified date range.
- Parameters:
patlist (List[str]) β List of patient IDs.
target_date_range (Tuple) β A tuple representing the target date range.
cohort_searcher_with_terms_and_search (Callable) β The function for cohort searching.
config_obj (Optional[object]) β Configuration object containing settings. Defaults to None.
- Returns:
Demographics information for the specified patients.
- Return type:
pd.DataFrame
- Raises:
ValueError β If config_obj or cohort_searcher_with_terms_and_search is None, or if patlist is empty.