Use pandas with clinicedc/edc projects
Project description
edc-pdutils
Use pandas with the Edc
To export Crf data, for example:
csv_path = '/Users/erikvw/Documents/ambition/export/'
date_format = '%Y-%m-%d'
sep = ','
class MyDfHandler(CrfDfHandler):
visit_tbl = 'ambition_subject_subjectvisit'
exclude_columns = ['form_as_json', 'survival_status','last_alive_date',
'screening_age_in_years', 'registration_datetime',
'subject_type']
class MyCsvCrfTablesExporter(CsvCrfTablesExporter):
visit_columns = ['subject_visit_id']
datetime_fields = ['randomization_datetime']
df_handler_cls = MyDfHandler
app_label = 'ambition_subject'
export_folder = csv_path
sys.stdout.write('\n')
exporter = MyCsvCrfTablesExporter()
exporter.to_csv(date_format=date_format, delimiter=sep)
To export INLINE data for any CRF configured with an inline, for example:
class MyDfHandler(CrfDfHandler):
visit_tbl = 'ambition_subject_subjectvisit'
exclude_columns = ['form_as_json', 'survival_status','last_alive_date',
'screening_age_in_years', 'registration_datetime',
'subject_type']
class MyCsvCrfInlineTablesExporter(CsvCrfInlineTablesExporter):
visit_columns = ['subject_visit_id']
df_handler_cls = MyDfHandler
app_label = 'ambition_subject'
export_folder = csv_path
exclude_inline_tables = [
'ambition_subject_radiology_abnormal_results_reason',
'ambition_subject_radiology_cxr_type']
sys.stdout.write('\n')
exporter = MyCsvCrfInlineTablesExporter()
exporter.to_csv(date_format=date_format, delimiter=sep)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for edc-pdutils-0.1.10.macosx-10.13-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc615c28dfe4ec3e5f1217a996f3c6da4a6bb0d59ce1e11a7f30bb58942ac675 |
|
MD5 | 92cb85d82e514d2fb94438171564a137 |
|
BLAKE2b-256 | ab8a0010366901881ef4c0a2f93b8b01fe5f4d29635cdffdcdf89cd7bf659e05 |
Close
Hashes for edc_pdutils-0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f99ebb655c24d910ff509fb9bd271fec4e15e549d886c54d0749e700ee8eadbb |
|
MD5 | 047c094464a2c3210d85d097040c6ee5 |
|
BLAKE2b-256 | bdc8a7c83c2bc27b9ba8e3e3fd5bdb557bc17d74bf452f644d5fc49733da56ea |