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'
registered_subject_tbl = 'edc_registration_registeredsubject'
appointment_tbl = 'edc_appointment_appointment'
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'
registered_subject_tbl = 'edc_registration_registeredsubject'
appointment_tbl = 'edc_appointment_appointment'
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.3.macosx-10.13-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b79bb6097ea47a19bef6639f40d1599fcf269079917163ffc3d63a2447ab1184 |
|
MD5 | 30bb5cca09d0767625ffcd1fcc5baf14 |
|
BLAKE2b-256 | 4a6bd8d050e59bb5da01385668b1f3b176f7be95c666a6a1f9edc6693252c22e |
Close
Hashes for edc_pdutils-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0776fed19b0521842368d230707ac9656b067f51fbe64d1359ceb99c5aa988f |
|
MD5 | 0e502bf88c8efd1beaeb6c97dbeb0a98 |
|
BLAKE2b-256 | 796749d69daac4cbda1694b8156bff55acc4edc59e59b25d7690df66d1fdd8e2 |