pat2vec 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pat2vec/__init__.py +463 -0
- pat2vec/main_pat2vec.py +720 -0
- pat2vec/pat2vec_get_methods/__init__.py +4 -0
- pat2vec/pat2vec_get_methods/get_method_appointments.py +220 -0
- pat2vec/pat2vec_get_methods/get_method_bed.py +177 -0
- pat2vec/pat2vec_get_methods/get_method_bloods.py +388 -0
- pat2vec/pat2vec_get_methods/get_method_bmi.py +281 -0
- pat2vec/pat2vec_get_methods/get_method_core02.py +250 -0
- pat2vec/pat2vec_get_methods/get_method_core_resus.py +239 -0
- pat2vec/pat2vec_get_methods/get_method_current_pat_annotations_mrc_cs.py +126 -0
- pat2vec/pat2vec_get_methods/get_method_demo.py +196 -0
- pat2vec/pat2vec_get_methods/get_method_demographics.py +389 -0
- pat2vec/pat2vec_get_methods/get_method_diagnostics.py +354 -0
- pat2vec/pat2vec_get_methods/get_method_drugs.py +330 -0
- pat2vec/pat2vec_get_methods/get_method_hosp_site.py +169 -0
- pat2vec/pat2vec_get_methods/get_method_news.py +152 -0
- pat2vec/pat2vec_get_methods/get_method_pat_annotations.py +128 -0
- pat2vec/pat2vec_get_methods/get_method_report_annotations.py +116 -0
- pat2vec/pat2vec_get_methods/get_method_smoking.py +224 -0
- pat2vec/pat2vec_get_methods/get_method_textual_obs_annotations.py +141 -0
- pat2vec/pat2vec_get_methods/get_method_vte_status.py +229 -0
- pat2vec/pat2vec_main_methods/__init__.py +0 -0
- pat2vec/pat2vec_main_methods/main_batch.py +341 -0
- pat2vec/pat2vec_pat_list/__init__.py +0 -0
- pat2vec/pat2vec_pat_list/get_patient_treatment_list.py +437 -0
- pat2vec/pat2vec_search/cogstack_search_methods.py +1356 -0
- pat2vec/pat2vec_search/data_helper_functions.py +105 -0
- pat2vec/pat2vec_search/matcher.py +94 -0
- pat2vec/pat2vec_search/nearest.py +50 -0
- pat2vec/pat2vec_search/search_helper_functions.py +160 -0
- pat2vec/pat2vec_search/search_multiprocess.py +100 -0
- pat2vec/patvec_get_batch_methods/__init__.py +0 -0
- pat2vec/patvec_get_batch_methods/get_merged_batches.py +1456 -0
- pat2vec/patvec_get_batch_methods/get_prefetch_batches.py +225 -0
- pat2vec/patvec_get_batch_methods/main.py +1370 -0
- pat2vec/tests/config_pat2vec.py +0 -0
- pat2vec/tests/test_calculate_interval.py +146 -0
- pat2vec/tests/test_config_class.py +221 -0
- pat2vec/tests/test_filter_dataframe_by_timestamp_extended.py +164 -0
- pat2vec/tests/test_generate_date_list.py +223 -0
- pat2vec/tests/test_get_dummy_data_cohort_searcher_get_date.py +95 -0
- pat2vec/tests/test_get_method_bloods.py +0 -0
- pat2vec/tests/test_get_start_end_year_month.py +173 -0
- pat2vec/tests/test_global_date_validation.py +126 -0
- pat2vec/tests/test_individual_patient_window.py +297 -0
- pat2vec/tests/test_methods_annotation_filter_annot_dataframe.py +139 -0
- pat2vec/tests/test_methods_annotation_multi_annots_to_df.py +259 -0
- pat2vec/tests/test_methods_get.py +229 -0
- pat2vec/tests/test_parse_date.py +139 -0
- pat2vec/tests/test_post_processing_build_ipw_dataframe.py +318 -0
- pat2vec/tests/test_post_processing_get_pat_ipw_record.py +484 -0
- pat2vec/tests/test_post_processing_process_csv_files.py +169 -0
- pat2vec/util/__init__.py +0 -0
- pat2vec/util/anonymisation_data_methods.py +243 -0
- pat2vec/util/anonymisation_deid_documents.py +616 -0
- pat2vec/util/calculate_interval.py +50 -0
- pat2vec/util/clinical_note_splitter.py +327 -0
- pat2vec/util/compile_requirements.py +97 -0
- pat2vec/util/config_pat2vec.py +1216 -0
- pat2vec/util/credentials.py +34 -0
- pat2vec/util/current_pat_batch_path_methods.py +84 -0
- pat2vec/util/dummy_data_files/__init__.py +0 -0
- pat2vec/util/dummy_data_files/dummy_lists.py +1899 -0
- pat2vec/util/elasticsearch_methods.py +284 -0
- pat2vec/util/ethnicity_abstractor.py +730 -0
- pat2vec/util/evaluation_methods.py +232 -0
- pat2vec/util/evaluation_methods_ploting.py +116 -0
- pat2vec/util/filter_dataframe_by_timestamp.py +86 -0
- pat2vec/util/filter_methods.py +213 -0
- pat2vec/util/generate_date_list.py +145 -0
- pat2vec/util/get_best_gpu.py +31 -0
- pat2vec/util/get_dummy_data_cohort_searcher.py +1864 -0
- pat2vec/util/get_dummy_data_medcat_annotation.py +104 -0
- pat2vec/util/get_start_end_year_month.py +51 -0
- pat2vec/util/helper_functions.py +70 -0
- pat2vec/util/impute_data_for_pipe.py +148 -0
- pat2vec/util/logger_setup.py +122 -0
- pat2vec/util/medcat_misc_methods.py +668 -0
- pat2vec/util/methods_annotation.py +527 -0
- pat2vec/util/methods_annotation_filter_annot_dataframe.py +71 -0
- pat2vec/util/methods_annotation_get_pat_document_annotation_batch.py +243 -0
- pat2vec/util/methods_annotation_json_to_dataframe.py +240 -0
- pat2vec/util/methods_annotation_multi_annots_to_df.py +164 -0
- pat2vec/util/methods_annotation_regex.py +39 -0
- pat2vec/util/methods_get.py +995 -0
- pat2vec/util/methods_get_medcat.py +121 -0
- pat2vec/util/methods_post_get.py +190 -0
- pat2vec/util/parse_date.py +74 -0
- pat2vec/util/post_processing.py +1485 -0
- pat2vec/util/post_processing_build_ipw_dataframe.py +80 -0
- pat2vec/util/post_processing_build_methods.py +683 -0
- pat2vec/util/post_processing_get_pat_ipw_record.py +379 -0
- pat2vec/util/post_processing_medcat.py +230 -0
- pat2vec/util/post_processing_process_csv_files.py +293 -0
- pat2vec/util/pre_get_drug_treatment_docs.py +465 -0
- pat2vec/util/pre_processing.py +457 -0
- pat2vec/util/presentation_methods.py +106 -0
- pat2vec/util/testing_helpers.py +29 -0
- pat2vec-0.1.1.dist-info/METADATA +391 -0
- pat2vec-0.1.1.dist-info/RECORD +103 -0
- pat2vec-0.1.1.dist-info/WHEEL +5 -0
- pat2vec-0.1.1.dist-info/top_level.txt +2 -0
- pat2vec_env/bin/vba_extract.py +79 -0
pat2vec/__init__.py
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
"""
|
|
2
|
+
pat2vec: A package for processing patient data.
|
|
3
|
+
|
|
4
|
+
This file is auto-generated by `generate_init.py`.
|
|
5
|
+
It exposes the main functions and methods of the pat2vec library for easy access.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .main_pat2vec import (
|
|
9
|
+
main
|
|
10
|
+
)
|
|
11
|
+
from .pat2vec_get_methods.get_method_appointments import (
|
|
12
|
+
get_appointments, search_appointments
|
|
13
|
+
)
|
|
14
|
+
from .pat2vec_get_methods.get_method_bed import (
|
|
15
|
+
get_bed, search_bed_data
|
|
16
|
+
)
|
|
17
|
+
from .pat2vec_get_methods.get_method_bloods import (
|
|
18
|
+
get_current_pat_bloods, search_bloods_data
|
|
19
|
+
)
|
|
20
|
+
from .pat2vec_get_methods.get_method_bmi import (
|
|
21
|
+
calculate_bmi_features, get_bmi_features, search_bmi_observations
|
|
22
|
+
)
|
|
23
|
+
from .pat2vec_get_methods.get_method_core02 import (
|
|
24
|
+
calculate_core_o2_features, clean_observation_value, get_core_02,
|
|
25
|
+
search_core_o2_observations
|
|
26
|
+
)
|
|
27
|
+
from .pat2vec_get_methods.get_method_core_resus import (
|
|
28
|
+
calculate_core_resus_features, get_core_resus, search_core_resus_observations
|
|
29
|
+
)
|
|
30
|
+
from .pat2vec_get_methods.get_method_current_pat_annotations_mrc_cs import (
|
|
31
|
+
get_current_pat_annotations_mrc_cs
|
|
32
|
+
)
|
|
33
|
+
from .pat2vec_get_methods.get_method_demo import (
|
|
34
|
+
get_demographics3, process_demographics_data, search_demographics
|
|
35
|
+
)
|
|
36
|
+
from .pat2vec_get_methods.get_method_demographics import (
|
|
37
|
+
get_demo, get_demographics3_batch
|
|
38
|
+
)
|
|
39
|
+
from .pat2vec_get_methods.get_method_diagnostics import (
|
|
40
|
+
calculate_diagnostic_features, create_diagnostic_features_dataframe,
|
|
41
|
+
get_current_pat_diagnostics, prepare_diagnostic_datetime, search_diagnostic_orders
|
|
42
|
+
)
|
|
43
|
+
from .pat2vec_get_methods.get_method_drugs import (
|
|
44
|
+
calculate_drug_features, create_drug_features_dataframe, get_current_pat_drugs,
|
|
45
|
+
prepare_drug_datetime, search_drug_orders
|
|
46
|
+
)
|
|
47
|
+
from .pat2vec_get_methods.get_method_hosp_site import (
|
|
48
|
+
calculate_hospital_site_features, get_hosp_site, prepare_hospital_site_data,
|
|
49
|
+
search_hospital_site
|
|
50
|
+
)
|
|
51
|
+
from .pat2vec_get_methods.get_method_news import (
|
|
52
|
+
compute_feature_stats, get_news
|
|
53
|
+
)
|
|
54
|
+
from .pat2vec_get_methods.get_method_pat_annotations import (
|
|
55
|
+
get_current_pat_annotations
|
|
56
|
+
)
|
|
57
|
+
from .pat2vec_get_methods.get_method_report_annotations import (
|
|
58
|
+
get_current_pat_report_annotations
|
|
59
|
+
)
|
|
60
|
+
from .pat2vec_get_methods.get_method_smoking import (
|
|
61
|
+
calculate_smoking_features, get_smoking, prepare_smoking_data, search_smoking
|
|
62
|
+
)
|
|
63
|
+
from .pat2vec_get_methods.get_method_textual_obs_annotations import (
|
|
64
|
+
get_current_pat_textual_obs_annotations
|
|
65
|
+
)
|
|
66
|
+
from .pat2vec_get_methods.get_method_vte_status import (
|
|
67
|
+
calculate_vte_features, get_vte_status, prepare_vte_data, search_vte
|
|
68
|
+
)
|
|
69
|
+
from .pat2vec_main_methods.main_batch import (
|
|
70
|
+
main_batch
|
|
71
|
+
)
|
|
72
|
+
from .pat2vec_pat_list.get_patient_treatment_list import (
|
|
73
|
+
analyze_client_codes, extract_treatment_id_list_from_docs, generate_control_list,
|
|
74
|
+
get_all_patients_list, sanitize_hospital_ids
|
|
75
|
+
)
|
|
76
|
+
from .pat2vec_search.cogstack_search_methods import (
|
|
77
|
+
CogStack, cohort_searcher_no_terms, cohort_searcher_no_terms_fuzzy,
|
|
78
|
+
cohort_searcher_with_terms_and_search, cohort_searcher_with_terms_no_search,
|
|
79
|
+
create_credentials_file, dataframe_generator, initialize_cogstack_client,
|
|
80
|
+
iterative_multi_term_cohort_searcher_no_terms_fuzzy,
|
|
81
|
+
iterative_multi_term_cohort_searcher_no_terms_fuzzy_mct,
|
|
82
|
+
iterative_multi_term_cohort_searcher_no_terms_fuzzy_textual_obs, list_chunker,
|
|
83
|
+
set_index_safe_wrapper
|
|
84
|
+
)
|
|
85
|
+
from .pat2vec_search.data_helper_functions import (
|
|
86
|
+
appendAge, appendAgeAtRecord, append_age_at_record_series, df_column_uniquify
|
|
87
|
+
)
|
|
88
|
+
from .pat2vec_search.matcher import (
|
|
89
|
+
matcher
|
|
90
|
+
)
|
|
91
|
+
from .pat2vec_search.nearest import (
|
|
92
|
+
nearest
|
|
93
|
+
)
|
|
94
|
+
from .pat2vec_search.search_helper_functions import (
|
|
95
|
+
bulk_str_extract, bulk_str_extract_round_robin, bulk_str_findall, date_cleaner,
|
|
96
|
+
pylist2searchlist, stringlist2pylist, stringlist2searchlist, without_keys
|
|
97
|
+
)
|
|
98
|
+
from .pat2vec_search.search_multiprocess import (
|
|
99
|
+
cohort_searcher_with_terms_and_search_multi, pull_and_write
|
|
100
|
+
)
|
|
101
|
+
from .patvec_get_batch_methods.get_merged_batches import (
|
|
102
|
+
get_merged_pat_batch_appointments, get_merged_pat_batch_bloods,
|
|
103
|
+
get_merged_pat_batch_bmi, get_merged_pat_batch_demo,
|
|
104
|
+
get_merged_pat_batch_diagnostics, get_merged_pat_batch_drugs,
|
|
105
|
+
get_merged_pat_batch_epr_docs, get_merged_pat_batch_mct_docs,
|
|
106
|
+
get_merged_pat_batch_news, get_merged_pat_batch_obs, get_merged_pat_batch_reports,
|
|
107
|
+
get_merged_pat_batch_textual_obs_docs, save_group, split_and_save_csv,
|
|
108
|
+
verify_split_data_concatenated, verify_split_data_individual
|
|
109
|
+
)
|
|
110
|
+
from .patvec_get_batch_methods.get_prefetch_batches import (
|
|
111
|
+
BatchConfig, prefetch_batches
|
|
112
|
+
)
|
|
113
|
+
from .patvec_get_batch_methods.main import (
|
|
114
|
+
get_pat_batch_appointments, get_pat_batch_bloods, get_pat_batch_bmi,
|
|
115
|
+
get_pat_batch_demo, get_pat_batch_diagnostics, get_pat_batch_drugs,
|
|
116
|
+
get_pat_batch_epr_docs, get_pat_batch_epr_docs_annotations, get_pat_batch_mct_docs,
|
|
117
|
+
get_pat_batch_mct_docs_annotations, get_pat_batch_news, get_pat_batch_obs,
|
|
118
|
+
get_pat_batch_reports, get_pat_batch_reports_docs_annotations,
|
|
119
|
+
get_pat_batch_textual_obs_annotations, get_pat_batch_textual_obs_docs
|
|
120
|
+
)
|
|
121
|
+
from .tests.test_calculate_interval import (
|
|
122
|
+
TestCalculateInterval
|
|
123
|
+
)
|
|
124
|
+
from .tests.test_config_class import (
|
|
125
|
+
TestConfigClass
|
|
126
|
+
)
|
|
127
|
+
from .tests.test_filter_dataframe_by_timestamp_extended import (
|
|
128
|
+
TestFilterDataFrameByTimestampExtended
|
|
129
|
+
)
|
|
130
|
+
from .tests.test_generate_date_list import (
|
|
131
|
+
TestGenerateDateList
|
|
132
|
+
)
|
|
133
|
+
from .tests.test_get_dummy_data_cohort_searcher_get_date import (
|
|
134
|
+
TestCreateRandomDateFromGlobals
|
|
135
|
+
)
|
|
136
|
+
from .tests.test_get_start_end_year_month import (
|
|
137
|
+
MockConfig, TestGetStartEndYearMonth
|
|
138
|
+
)
|
|
139
|
+
from .tests.test_global_date_validation import (
|
|
140
|
+
TestGlobalDateValidation
|
|
141
|
+
)
|
|
142
|
+
from .tests.test_individual_patient_window import (
|
|
143
|
+
TestIndividualPatientWindow
|
|
144
|
+
)
|
|
145
|
+
from .tests.test_methods_annotation_filter_annot_dataframe import (
|
|
146
|
+
TestFilterAnnotDataframe
|
|
147
|
+
)
|
|
148
|
+
from .tests.test_methods_annotation_multi_annots_to_df import (
|
|
149
|
+
TestMultiAnnotsToDf
|
|
150
|
+
)
|
|
151
|
+
from .tests.test_methods_get import (
|
|
152
|
+
TestFilterDataFrameByTimestamp
|
|
153
|
+
)
|
|
154
|
+
from .tests.test_parse_date import (
|
|
155
|
+
TestDateValidationForElasticsearch
|
|
156
|
+
)
|
|
157
|
+
from .tests.test_post_processing_build_ipw_dataframe import (
|
|
158
|
+
TestBuildIpwDataframe
|
|
159
|
+
)
|
|
160
|
+
from .tests.test_post_processing_get_pat_ipw_record import (
|
|
161
|
+
TestGetPatIpwRecord
|
|
162
|
+
)
|
|
163
|
+
from .tests.test_post_processing_process_csv_files import (
|
|
164
|
+
TestProcessCsvFiles
|
|
165
|
+
)
|
|
166
|
+
from .util.anonymisation_data_methods import (
|
|
167
|
+
anonymize_feature_names, deanonymize_feature_names
|
|
168
|
+
)
|
|
169
|
+
from .util.anonymisation_deid_documents import (
|
|
170
|
+
DeIdAnonymizer, anonymize_dataframe_quick, anonymize_single_text
|
|
171
|
+
)
|
|
172
|
+
from .util.calculate_interval import (
|
|
173
|
+
calculate_interval
|
|
174
|
+
)
|
|
175
|
+
from .util.clinical_note_splitter import (
|
|
176
|
+
find_date, split_and_append_chunks, split_clinical_notes, split_clinical_notes_mct
|
|
177
|
+
)
|
|
178
|
+
from .util.compile_requirements import (
|
|
179
|
+
append_to_file, process_requirements, run_pip_compile
|
|
180
|
+
)
|
|
181
|
+
from .util.config_pat2vec import (
|
|
182
|
+
config_class, update_global_start_date, validate_and_fix_global_dates
|
|
183
|
+
)
|
|
184
|
+
from .util.current_pat_batch_path_methods import (
|
|
185
|
+
PathsClass
|
|
186
|
+
)
|
|
187
|
+
from .util.elasticsearch_methods import (
|
|
188
|
+
get_guess_datetime_column, guess_datetime_columns, handle_inconsistent_dtypes,
|
|
189
|
+
ingest_data_to_elasticsearch
|
|
190
|
+
)
|
|
191
|
+
from .util.ethnicity_abstractor import (
|
|
192
|
+
EthnicityAbstractor
|
|
193
|
+
)
|
|
194
|
+
from .util.evaluation_methods import (
|
|
195
|
+
CsvProfiler, compare_ipw_annotation_rows
|
|
196
|
+
)
|
|
197
|
+
from .util.evaluation_methods_ploting import (
|
|
198
|
+
generate_pie_charts
|
|
199
|
+
)
|
|
200
|
+
from .util.filter_dataframe_by_timestamp import (
|
|
201
|
+
filter_dataframe_by_timestamp
|
|
202
|
+
)
|
|
203
|
+
from .util.filter_methods import (
|
|
204
|
+
apply_bloods_data_type_filter, apply_data_type_epr_docs_filters,
|
|
205
|
+
apply_data_type_mct_docs_filters, filter_dataframe_by_fuzzy_terms
|
|
206
|
+
)
|
|
207
|
+
from .util.generate_date_list import (
|
|
208
|
+
generate_date_list
|
|
209
|
+
)
|
|
210
|
+
from .util.get_best_gpu import (
|
|
211
|
+
set_best_gpu
|
|
212
|
+
)
|
|
213
|
+
from .util.get_dummy_data_cohort_searcher import (
|
|
214
|
+
cohort_searcher_with_terms_and_search_dummy, create_random_date_from_globals,
|
|
215
|
+
extract_date_range, extract_search_term_obscatalogmasteritem_displayname,
|
|
216
|
+
generate_appointments_data, generate_basic_observations_data,
|
|
217
|
+
generate_basic_observations_textual_obs_data, generate_bmi_data,
|
|
218
|
+
generate_core_o2_data, generate_core_resus_data, generate_diagnostic_orders_data,
|
|
219
|
+
generate_drug_orders_data, generate_epr_documents_data,
|
|
220
|
+
generate_epr_documents_personal_data, generate_hospital_site_data,
|
|
221
|
+
generate_observations_MRC_text_data, generate_observations_Reports_text_data,
|
|
222
|
+
generate_observations_data, generate_patient_timeline,
|
|
223
|
+
generate_patient_timeline_faker, generate_uuid, generate_uuid_list,
|
|
224
|
+
get_patient_timeline_dummy, maybe_nan, run_generate_patient_timeline_and_append
|
|
225
|
+
)
|
|
226
|
+
from .util.get_dummy_data_medcat_annotation import (
|
|
227
|
+
dummy_CAT, dummy_medcat_annotation_generator, random_sample
|
|
228
|
+
)
|
|
229
|
+
from .util.get_start_end_year_month import (
|
|
230
|
+
get_start_end_year_month
|
|
231
|
+
)
|
|
232
|
+
from .util.helper_functions import (
|
|
233
|
+
extract_nhs_numbers, get_search_client_idcode_list_from_nhs_number_list
|
|
234
|
+
)
|
|
235
|
+
from .util.impute_data_for_pipe import (
|
|
236
|
+
mean_impute_dataframe, save_missing_percentage
|
|
237
|
+
)
|
|
238
|
+
from .util.logger_setup import (
|
|
239
|
+
setup_logger
|
|
240
|
+
)
|
|
241
|
+
from .util.medcat_misc_methods import (
|
|
242
|
+
create_ner_results_dataframe, extract_labels_from_medcat_annotation_export,
|
|
243
|
+
manually_label_annotation_df, medcat_trainer_export_to_df,
|
|
244
|
+
parse_medcat_trainer_project_json, plot_ner_results, recreate_json
|
|
245
|
+
)
|
|
246
|
+
from .util.methods_annotation import (
|
|
247
|
+
annot_pat_batch_docs, calculate_pretty_name_count_features,
|
|
248
|
+
check_pat_document_annotation_complete, multi_annots_to_df_mct,
|
|
249
|
+
multi_annots_to_df_reports, multi_annots_to_df_textual_obs
|
|
250
|
+
)
|
|
251
|
+
from .util.methods_annotation_filter_annot_dataframe import (
|
|
252
|
+
filter_annot_dataframe
|
|
253
|
+
)
|
|
254
|
+
from .util.methods_annotation_get_pat_document_annotation_batch import (
|
|
255
|
+
get_pat_batch_textual_obs_annotation_batch, get_pat_document_annotation_batch,
|
|
256
|
+
get_pat_document_annotation_batch_mct, get_pat_document_annotation_batch_reports
|
|
257
|
+
)
|
|
258
|
+
from .util.methods_annotation_json_to_dataframe import (
|
|
259
|
+
json_to_dataframe, parse_meta_anns
|
|
260
|
+
)
|
|
261
|
+
from .util.methods_annotation_multi_annots_to_df import (
|
|
262
|
+
multi_annots_to_df, temporary_file
|
|
263
|
+
)
|
|
264
|
+
from .util.methods_annotation_regex import (
|
|
265
|
+
append_regex_term_counts
|
|
266
|
+
)
|
|
267
|
+
from .util.methods_get import (
|
|
268
|
+
add_offset_column, build_patient_dict, convert_date, convert_timestamp_to_tuple,
|
|
269
|
+
create_folders, create_folders_annot_csv_wrapper, create_folders_for_pat,
|
|
270
|
+
create_local_folders, create_remote_folders, dump_results,
|
|
271
|
+
enum_exact_target_date_vector, enum_target_date_vector, exist_check,
|
|
272
|
+
filter_stripped_list, get_empty_date_vector, get_free_gpu, list_dir_wrapper,
|
|
273
|
+
read_csv_wrapper, read_remote, sftp_exists, test_datetime_formats, update_pbar,
|
|
274
|
+
write_csv_wrapper, write_remote
|
|
275
|
+
)
|
|
276
|
+
from .util.methods_get_medcat import (
|
|
277
|
+
get_cat
|
|
278
|
+
)
|
|
279
|
+
from .util.methods_post_get import (
|
|
280
|
+
check_csv_files_in_directory, check_csv_integrity,
|
|
281
|
+
copy_project_folders_with_substring_match, retrieve_pat_annotations
|
|
282
|
+
)
|
|
283
|
+
from .util.parse_date import (
|
|
284
|
+
validate_input_dates
|
|
285
|
+
)
|
|
286
|
+
from .util.post_processing import (
|
|
287
|
+
aggregate_dataframe_mean, check_list_presence, collapse_df_to_mean,
|
|
288
|
+
convert_true_to_float, copy_files_and_dirs, count_files, drop_columns_with_all_nan,
|
|
289
|
+
extract_datetime_from_binary_columns,
|
|
290
|
+
extract_datetime_from_binary_columns_chunk_reader, extract_datetime_to_column,
|
|
291
|
+
extract_types_from_csv, filter_and_select_rows, filter_and_update_csv,
|
|
292
|
+
filter_annot_dataframe2, filter_dataframe_by_cui, filter_dataframe_n_lists,
|
|
293
|
+
get_all_target_annots, impute_dataframe, impute_datetime,
|
|
294
|
+
join_icd10_OPC4S_codes_to_annot, join_icd10_codes_to_annot, missing_percentage_df,
|
|
295
|
+
plot_missing_pattern_bloods, process_chunk, produce_filtered_annotation_dataframe,
|
|
296
|
+
remove_file_from_paths, retrieve_pat_annots_mct_epr, save_missing_values_pickle
|
|
297
|
+
)
|
|
298
|
+
from .util.post_processing_build_ipw_dataframe import (
|
|
299
|
+
build_ipw_dataframe
|
|
300
|
+
)
|
|
301
|
+
from .util.post_processing_build_methods import (
|
|
302
|
+
build_merged_bloods, build_merged_epr_mct_annot_df, build_merged_epr_mct_doc_df,
|
|
303
|
+
filter_annot_dataframe, get_annots_joined_to_docs, join_docs_to_annots,
|
|
304
|
+
merge_appointments_csv, merge_bmi_csv, merge_demographics_csv,
|
|
305
|
+
merge_diagnostics_csv, merge_drugs_csv, merge_news_csv, retrieve_pat_bloods,
|
|
306
|
+
retrieve_pat_docs_mct_epr
|
|
307
|
+
)
|
|
308
|
+
from .util.post_processing_get_pat_ipw_record import (
|
|
309
|
+
get_pat_ipw_record
|
|
310
|
+
)
|
|
311
|
+
from .util.post_processing_medcat import (
|
|
312
|
+
coerce_document_df_to_medcat_trainer_input, sample_by_terms
|
|
313
|
+
)
|
|
314
|
+
from .util.post_processing_process_csv_files import (
|
|
315
|
+
process_csv_files, process_csv_files_multi
|
|
316
|
+
)
|
|
317
|
+
from .util.pre_get_drug_treatment_docs import (
|
|
318
|
+
get_treatment_records_by_drug_order_name, iterative_drug_treatment_search
|
|
319
|
+
)
|
|
320
|
+
from .util.pre_processing import (
|
|
321
|
+
calculate_age_append, demo_to_latest, draw_document_samples,
|
|
322
|
+
get_treatment_docs_by_iterative_multi_term_cohort_searcher_no_terms_fuzzy,
|
|
323
|
+
search_cohort
|
|
324
|
+
)
|
|
325
|
+
from .util.presentation_methods import (
|
|
326
|
+
create_powerpoint_from_images, create_powerpoint_from_images_group,
|
|
327
|
+
create_powerpoint_slides, create_powerpoint_slides_client_idcode_groups,
|
|
328
|
+
group_images_by_suffix
|
|
329
|
+
)
|
|
330
|
+
from .util.testing_helpers import (
|
|
331
|
+
read_test_data
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
# Define the public API of the package
|
|
336
|
+
__all__ = [
|
|
337
|
+
"BatchConfig", "CogStack", "CsvProfiler", "DeIdAnonymizer", "EthnicityAbstractor",
|
|
338
|
+
"MockConfig", "PathsClass", "TestBuildIpwDataframe", "TestCalculateInterval",
|
|
339
|
+
"TestConfigClass", "TestCreateRandomDateFromGlobals",
|
|
340
|
+
"TestDateValidationForElasticsearch", "TestFilterAnnotDataframe",
|
|
341
|
+
"TestFilterDataFrameByTimestamp", "TestFilterDataFrameByTimestampExtended",
|
|
342
|
+
"TestGenerateDateList", "TestGetPatIpwRecord", "TestGetStartEndYearMonth",
|
|
343
|
+
"TestGlobalDateValidation", "TestIndividualPatientWindow", "TestMultiAnnotsToDf",
|
|
344
|
+
"TestProcessCsvFiles", "add_offset_column", "aggregate_dataframe_mean",
|
|
345
|
+
"analyze_client_codes", "annot_pat_batch_docs", "anonymize_dataframe_quick",
|
|
346
|
+
"anonymize_feature_names", "anonymize_single_text", "appendAge",
|
|
347
|
+
"appendAgeAtRecord", "append_age_at_record_series", "append_regex_term_counts",
|
|
348
|
+
"append_to_file", "apply_bloods_data_type_filter",
|
|
349
|
+
"apply_data_type_epr_docs_filters", "apply_data_type_mct_docs_filters",
|
|
350
|
+
"build_ipw_dataframe", "build_merged_bloods", "build_merged_epr_mct_annot_df",
|
|
351
|
+
"build_merged_epr_mct_doc_df", "build_patient_dict", "bulk_str_extract",
|
|
352
|
+
"bulk_str_extract_round_robin", "bulk_str_findall", "calculate_age_append",
|
|
353
|
+
"calculate_bmi_features", "calculate_core_o2_features",
|
|
354
|
+
"calculate_core_resus_features", "calculate_diagnostic_features",
|
|
355
|
+
"calculate_drug_features", "calculate_hospital_site_features", "calculate_interval",
|
|
356
|
+
"calculate_pretty_name_count_features", "calculate_smoking_features",
|
|
357
|
+
"calculate_vte_features", "check_csv_files_in_directory", "check_csv_integrity",
|
|
358
|
+
"check_list_presence", "check_pat_document_annotation_complete",
|
|
359
|
+
"clean_observation_value", "coerce_document_df_to_medcat_trainer_input",
|
|
360
|
+
"cohort_searcher_no_terms", "cohort_searcher_no_terms_fuzzy",
|
|
361
|
+
"cohort_searcher_with_terms_and_search",
|
|
362
|
+
"cohort_searcher_with_terms_and_search_dummy",
|
|
363
|
+
"cohort_searcher_with_terms_and_search_multi",
|
|
364
|
+
"cohort_searcher_with_terms_no_search", "collapse_df_to_mean",
|
|
365
|
+
"compare_ipw_annotation_rows", "compute_feature_stats", "config_class",
|
|
366
|
+
"convert_date", "convert_timestamp_to_tuple", "convert_true_to_float",
|
|
367
|
+
"copy_files_and_dirs", "copy_project_folders_with_substring_match", "count_files",
|
|
368
|
+
"create_credentials_file", "create_diagnostic_features_dataframe",
|
|
369
|
+
"create_drug_features_dataframe", "create_folders",
|
|
370
|
+
"create_folders_annot_csv_wrapper", "create_folders_for_pat",
|
|
371
|
+
"create_local_folders", "create_ner_results_dataframe",
|
|
372
|
+
"create_powerpoint_from_images", "create_powerpoint_from_images_group",
|
|
373
|
+
"create_powerpoint_slides", "create_powerpoint_slides_client_idcode_groups",
|
|
374
|
+
"create_random_date_from_globals", "create_remote_folders", "dataframe_generator",
|
|
375
|
+
"date_cleaner", "deanonymize_feature_names", "demo_to_latest", "df_column_uniquify",
|
|
376
|
+
"draw_document_samples", "drop_columns_with_all_nan", "dummy_CAT",
|
|
377
|
+
"dummy_medcat_annotation_generator", "dump_results",
|
|
378
|
+
"enum_exact_target_date_vector", "enum_target_date_vector", "exist_check",
|
|
379
|
+
"extract_date_range", "extract_datetime_from_binary_columns",
|
|
380
|
+
"extract_datetime_from_binary_columns_chunk_reader", "extract_datetime_to_column",
|
|
381
|
+
"extract_labels_from_medcat_annotation_export", "extract_nhs_numbers",
|
|
382
|
+
"extract_search_term_obscatalogmasteritem_displayname",
|
|
383
|
+
"extract_treatment_id_list_from_docs", "extract_types_from_csv",
|
|
384
|
+
"filter_and_select_rows", "filter_and_update_csv", "filter_annot_dataframe",
|
|
385
|
+
"filter_annot_dataframe2", "filter_dataframe_by_cui",
|
|
386
|
+
"filter_dataframe_by_fuzzy_terms", "filter_dataframe_by_timestamp",
|
|
387
|
+
"filter_dataframe_n_lists", "filter_stripped_list", "find_date",
|
|
388
|
+
"generate_appointments_data", "generate_basic_observations_data",
|
|
389
|
+
"generate_basic_observations_textual_obs_data", "generate_bmi_data",
|
|
390
|
+
"generate_control_list", "generate_core_o2_data", "generate_core_resus_data",
|
|
391
|
+
"generate_date_list", "generate_diagnostic_orders_data",
|
|
392
|
+
"generate_drug_orders_data", "generate_epr_documents_data",
|
|
393
|
+
"generate_epr_documents_personal_data", "generate_hospital_site_data",
|
|
394
|
+
"generate_observations_MRC_text_data", "generate_observations_Reports_text_data",
|
|
395
|
+
"generate_observations_data", "generate_patient_timeline",
|
|
396
|
+
"generate_patient_timeline_faker", "generate_pie_charts", "generate_uuid",
|
|
397
|
+
"generate_uuid_list", "get_all_patients_list", "get_all_target_annots",
|
|
398
|
+
"get_annots_joined_to_docs", "get_appointments", "get_bed", "get_bmi_features",
|
|
399
|
+
"get_cat", "get_core_02", "get_core_resus", "get_current_pat_annotations",
|
|
400
|
+
"get_current_pat_annotations_mrc_cs", "get_current_pat_bloods",
|
|
401
|
+
"get_current_pat_diagnostics", "get_current_pat_drugs",
|
|
402
|
+
"get_current_pat_report_annotations", "get_current_pat_textual_obs_annotations",
|
|
403
|
+
"get_demo", "get_demographics3", "get_demographics3_batch", "get_empty_date_vector",
|
|
404
|
+
"get_free_gpu", "get_guess_datetime_column", "get_hosp_site",
|
|
405
|
+
"get_merged_pat_batch_appointments", "get_merged_pat_batch_bloods",
|
|
406
|
+
"get_merged_pat_batch_bmi", "get_merged_pat_batch_demo",
|
|
407
|
+
"get_merged_pat_batch_diagnostics", "get_merged_pat_batch_drugs",
|
|
408
|
+
"get_merged_pat_batch_epr_docs", "get_merged_pat_batch_mct_docs",
|
|
409
|
+
"get_merged_pat_batch_news", "get_merged_pat_batch_obs",
|
|
410
|
+
"get_merged_pat_batch_reports", "get_merged_pat_batch_textual_obs_docs", "get_news",
|
|
411
|
+
"get_pat_batch_appointments", "get_pat_batch_bloods", "get_pat_batch_bmi",
|
|
412
|
+
"get_pat_batch_demo", "get_pat_batch_diagnostics", "get_pat_batch_drugs",
|
|
413
|
+
"get_pat_batch_epr_docs", "get_pat_batch_epr_docs_annotations",
|
|
414
|
+
"get_pat_batch_mct_docs", "get_pat_batch_mct_docs_annotations",
|
|
415
|
+
"get_pat_batch_news", "get_pat_batch_obs", "get_pat_batch_reports",
|
|
416
|
+
"get_pat_batch_reports_docs_annotations",
|
|
417
|
+
"get_pat_batch_textual_obs_annotation_batch",
|
|
418
|
+
"get_pat_batch_textual_obs_annotations", "get_pat_batch_textual_obs_docs",
|
|
419
|
+
"get_pat_document_annotation_batch", "get_pat_document_annotation_batch_mct",
|
|
420
|
+
"get_pat_document_annotation_batch_reports", "get_pat_ipw_record",
|
|
421
|
+
"get_patient_timeline_dummy", "get_search_client_idcode_list_from_nhs_number_list",
|
|
422
|
+
"get_smoking", "get_start_end_year_month",
|
|
423
|
+
"get_treatment_docs_by_iterative_multi_term_cohort_searcher_no_terms_fuzzy",
|
|
424
|
+
"get_treatment_records_by_drug_order_name", "get_vte_status",
|
|
425
|
+
"group_images_by_suffix", "guess_datetime_columns", "handle_inconsistent_dtypes",
|
|
426
|
+
"impute_dataframe", "impute_datetime", "ingest_data_to_elasticsearch",
|
|
427
|
+
"initialize_cogstack_client", "iterative_drug_treatment_search",
|
|
428
|
+
"iterative_multi_term_cohort_searcher_no_terms_fuzzy",
|
|
429
|
+
"iterative_multi_term_cohort_searcher_no_terms_fuzzy_mct",
|
|
430
|
+
"iterative_multi_term_cohort_searcher_no_terms_fuzzy_textual_obs",
|
|
431
|
+
"join_docs_to_annots", "join_icd10_OPC4S_codes_to_annot",
|
|
432
|
+
"join_icd10_codes_to_annot", "json_to_dataframe", "list_chunker",
|
|
433
|
+
"list_dir_wrapper", "main", "main_batch", "manually_label_annotation_df", "matcher",
|
|
434
|
+
"maybe_nan", "mean_impute_dataframe", "medcat_trainer_export_to_df",
|
|
435
|
+
"merge_appointments_csv", "merge_bmi_csv", "merge_demographics_csv",
|
|
436
|
+
"merge_diagnostics_csv", "merge_drugs_csv", "merge_news_csv",
|
|
437
|
+
"missing_percentage_df", "multi_annots_to_df", "multi_annots_to_df_mct",
|
|
438
|
+
"multi_annots_to_df_reports", "multi_annots_to_df_textual_obs", "nearest",
|
|
439
|
+
"parse_medcat_trainer_project_json", "parse_meta_anns",
|
|
440
|
+
"plot_missing_pattern_bloods", "plot_ner_results", "prefetch_batches",
|
|
441
|
+
"prepare_diagnostic_datetime", "prepare_drug_datetime",
|
|
442
|
+
"prepare_hospital_site_data", "prepare_smoking_data", "prepare_vte_data",
|
|
443
|
+
"process_chunk", "process_csv_files", "process_csv_files_multi",
|
|
444
|
+
"process_demographics_data", "process_requirements",
|
|
445
|
+
"produce_filtered_annotation_dataframe", "pull_and_write", "pylist2searchlist",
|
|
446
|
+
"random_sample", "read_csv_wrapper", "read_remote", "read_test_data",
|
|
447
|
+
"recreate_json", "remove_file_from_paths", "retrieve_pat_annotations",
|
|
448
|
+
"retrieve_pat_annots_mct_epr", "retrieve_pat_bloods", "retrieve_pat_docs_mct_epr",
|
|
449
|
+
"run_generate_patient_timeline_and_append", "run_pip_compile", "sample_by_terms",
|
|
450
|
+
"sanitize_hospital_ids", "save_group", "save_missing_percentage",
|
|
451
|
+
"save_missing_values_pickle", "search_appointments", "search_bed_data",
|
|
452
|
+
"search_bloods_data", "search_bmi_observations", "search_cohort",
|
|
453
|
+
"search_core_o2_observations", "search_core_resus_observations",
|
|
454
|
+
"search_demographics", "search_diagnostic_orders", "search_drug_orders",
|
|
455
|
+
"search_hospital_site", "search_smoking", "search_vte", "set_best_gpu",
|
|
456
|
+
"set_index_safe_wrapper", "setup_logger", "sftp_exists", "split_and_append_chunks",
|
|
457
|
+
"split_and_save_csv", "split_clinical_notes", "split_clinical_notes_mct",
|
|
458
|
+
"stringlist2pylist", "stringlist2searchlist", "temporary_file",
|
|
459
|
+
"test_datetime_formats", "update_global_start_date", "update_pbar",
|
|
460
|
+
"validate_and_fix_global_dates", "validate_input_dates",
|
|
461
|
+
"verify_split_data_concatenated", "verify_split_data_individual", "without_keys",
|
|
462
|
+
"write_csv_wrapper", "write_remote"
|
|
463
|
+
]
|