AMP-SCZ / eeg-qc-dash

Plotly/Dash based web application for checking quality of EEGs
Apache License 2.0
2 stars 1 forks source link

Download PDF run sheets #20

Closed tashrifbillah closed 1 year ago

tashrifbillah commented 2 years ago
DATA="token=XYZABC123&content=pdf&record=LA04513&event=baseline_arm_1&instrument=eeg_run_sheet&returnFormat=json"
CURL=`which curl`
$CURL -H "Content-Type: application/x-www-form-urlencoded" \
      -H "Accept: application/json" \
      -X POST \
      -d $DATA \
      -o /tmp/export.pdf \
      https://redcap.partners.org/redcap/api/
tashrifbillah commented 2 years ago

https://github.com/AMP-SCZ/eeg-qc-dash/blob/4b1120b32b6984455271a8c48f762bc53b1cb500/app.py#L393-L395

Under session hyperlink, add a PDF hyperlink:

html.Td([html.A(ses,
            href=d.replace(ROOTDIR,URL_PREFIX)+f'/{sub}_{ses}_runSheet.txt'
            target='_blank'),
         html.Br(),
         html.A('PDF',
         href=d.replace(ROOTDIR,URL_PREFIX)+f'/{sub}_{ses}_runSheet.pdf'
            target='_blank')
        ])