ctti-clinicaltrials / aact

Improving Public Access to Aggregate Content of ClinicalTrials.gov
http://aact.ctti-clinicaltrials.org
MIT License
123 stars 33 forks source link

AACT-613: Added participant_flow_data method #1114

Closed ievgend2 closed 6 months ago

ievgend2 commented 7 months ago

Go to rails console: run commands in order:

hash = JSON.parse(File.read('spec/support/json_data/initialize_participant_flow_data.json')) processor = StudyJsonRecord::ProcessorV2.new(hash) processor.participant_flow_data

Output:

processor.participant_flow_data
=> {:nct_id=>"NCT02299791",
      :recruitment_details=>
  "Recruitment was done at the clinic level. All patients seen in the clinics were potentially eligible for the intervention based on clinic visit and clinical criteria.",
      :pre_assignment_details=>
  "There were two additional nested substudy randomizations after initial trial enrolment (see inclusion/exclusion criteria for eligibility). From 8/2009 to 6/2010, eligible children were randomized to once vs twice daily abacavir+lamivudine. From 9/2009 to 2/2011, eligible children were randomized to stop vs continue cotrimoxazole prophylaxis.",
      :units_analyzed=>"Clinics"}

Or run command:

bundle exec rspec /Users/ievgendotsenko/ctd/aact/spec/models/study_json_record/processor_v2_spec.rb

ievgend2 commented 6 months ago

Tests added