Medial Code Documentation
|
MedCohort - a vector of CohortRec's. More...
#include <MedCohort.h>
Public Member Functions | |
void | insert (int pid, int from, int to, int outcome_date, float outcome) |
Add a record. | |
int | read_from_file (string fname) |
Read to tab-delimited file. | |
int | write_to_file (string fname) |
Write from tab-delimited file. | |
int | read_from_bin_file (string fname) |
Read to binary file. | |
int | write_to_bin_file (string fname) |
Write from binary file. | |
void | get_pids (vector< int > &pids) |
Get all pids. | |
int | create_incidence_file (IncidenceParams &i_params, string out_file, const string &debug_file="") |
Generate an incidence file from cohort + incidence-params Check all patient-years within cohort that fit to IncidenceParams and count positive outcomes within i_params.incidence_years_window Outcome - incidence per age-bin - is written to file. | |
int | create_sampling_file (SamplingParams &s_params, string out_sample_file) |
Generate a samples file from cohort + sampling-params Generate samples within cohort times that fit SampleingParams criteria and windows. | |
int | create_samples (MedRepository &rep, SamplingParams &s_params, MedSamples &samples) |
int | create_sampling_file_sticked (SamplingParams &s_params, string out_sample_file) |
Generate a samples file from cohort + sampling-params Generate samples within cohort times that fit SampleingParams criteria and windows. | |
int | create_samples_sticked (MedRepository &rep, SamplingParams &s_params, MedSamples &samples) |
Data Fields | |
vector< CohortRec > | recs |
Cohort information. | |
int MedCohort::create_incidence_file | ( | IncidenceParams & | i_params, |
string | out_file, | ||
const string & | debug_file = "" |
||
) |
Generate an incidence file from cohort + incidence-params
Check all patient-years within cohort that fit to IncidenceParams and count positive outcomes within i_params.incidence_years_window
Outcome - incidence per age-bin - is written to file.
int MedCohort::create_sampling_file | ( | SamplingParams & | s_params, |
string | out_sample_file | ||
) |
Generate a samples file from cohort + sampling-params
Generate samples within cohort times that fit SampleingParams criteria and windows.
Sample dates are selected randomly for each window of s_params.jump_days in the legal period, and written to file
int MedCohort::create_sampling_file_sticked | ( | SamplingParams & | s_params, |
string | out_sample_file | ||
) |
Generate a samples file from cohort + sampling-params
Generate samples within cohort times that fit SampleingParams criteria and windows.
Sample dates are those with the required signals for each window of s_params.jump_days in the legal period (if existing), and written to file
|
inline |
Read to binary file.
int MedCohort::read_from_file | ( | string | fname | ) |
Read to tab-delimited file.
|
inline |
Write from binary file.
int MedCohort::write_to_file | ( | string | fname | ) |
Write from tab-delimited file.