Changes between Initial Version and Version 1 of BRICCS CRLN Recruitment Report


Ignore:
Timestamp:
06/02/15 14:42:23 (9 years ago)
Author:
Richard Bramley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BRICCS CRLN Recruitment Report

    v1 v1  
     1= BRICCS CRLN Recruitment Report
     2
     3Tags: [[BRICCS Study]] [[Reporting]] [[CRLN]]
     4
     5== Summary
     6
     7Report run at the start of each month summarizing all participants recruited into the [[BRICCS Study]] in the previous month.  Report does not include participants with a stus of {{{CANCELLED}}}.
     8
     9== Format
     10
     11Tab delimited files for Northampton, Leicester and External REDCap sites (i.e., 3 files), with the columns:
     12
     13- Study ID (BPt Number)
     14- Site name
     15- Date Recruited
     16
     17Ordered by date recruited.
     18
     19== Details
     20
     21 Recipient:: angel.christian@uhl-tr.nhs.uk
     22 Server:: {{{uhlbriccsapp01.xuhl-tr.nhs.uk}}}
     23 Working Directory:: {{{/home/nick/briccs_enrollment_reports/}}}
     24 Archive Directory:: {{{V:\BRICCS data requests\BRICCS recruitment data for CLRN}}}
     25 SQL Account:: Auditor
     26
     27== Procedure
     28
     29=== Create Participant Extracts
     30
     311. Log onto the server and create the required extracts using the following MySql commands:
     32
     33==== Northampton
     34
     35{{{
     36#!sh
     37mysql -h briccsdb -u auditor -p briccs_northampton -e "SELECT barcode, site_no, start_date, status FROM participant ptone, interview WHERE NOT EXISTS (SELECT 1 FROM participant pttwo WHERE pttwo.enrollment_id = ptone.enrollment_id LIMIT 1, 1 ) AND barcode is not null AND status <> 'CANCELLED' AND start_date > '2014-01-01 00:00:00' AND start_date < '2014-02-01 00:00:00' AND ptone.id = interview.participant_id order by start_date;" > briccs_enrollment_northampton_2014_01.txt
     38}}}
     39
     40**Change dates in query and file name for the current month.**
     41
     42==== Leicester
     43
     44{{{
     45#!sh
     46mysql -h briccsdb -u auditor -p redcap -e "SELECT pk,project_id,ts from redcap_log_event where event = 'INSERT' and object_type = 'redcap_data' and project_id = '24' and ts > '20141101000000' and ts < '20141201000000' order by ts;" > briccs_enrolment_leicester_2014_11.txt
     47}}}
     48
     49**Change dates in query and file name for the current month.**
     50
     51==== External REDCap sites
     52
     53{{{
     54#!sh
     55mysql -h briccsdb -u auditor -p redcap_briccsext -e "SELECT pk,project_id,ts from redcap_log_event where event = 'INSERT' and object_type = 'redcap_data' and project_id <> '12' and ts > '20141101000000' and ts < '20141201000000' order by ts;" > briccs_enrolment_external_sites_2014_11.txt
     56}}}
     57
     58**Change dates in query and file name for the current month.**
     59
     60[[ToDo]]: Reference the required projects, as opposed to excluding the not required ones.
     61
     62== Post Process Files
     63
     641. Copy the files from the working directory to the archive directory.
     652. Open the file {{{datetime conversion file.ods}}} from the archive directory in Libre Office.
     663. Open the Leicester and REDCap external extract files from the archive directory in Libre Office.
     674. Replace the existing data in the {{{datetime conversion file.ods}}} spreadsheet with the data from each file in turn. 
     685. Copy the list of data spreadsheet creates containing the site name and formatted date back into the extract file and save.
     696. Email the file to the recipient
     70
     71[[BackLinks]]