Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes
MedRegistry Class Reference

A class that holds all registry records on all patients. More...

#include <MedRegistry.h>

Inheritance diagram for MedRegistry:
SerializableObject MedRegistryCategories MedRegistryCodesList MedRegistryKeepAlive

Public Member Functions

void write_text_file (const string &file_path) const
 Writes the file to text file in tab delimeted format: PID, Start_Date, End_Date, min_allowed_date, max_allowed_date, Age, RegistryValue.
 
void read_text_file (const string &file_path)
 Reads the file in text format in tab delimeted.
 
void create_registry (MedPidRepository &dataManager, medial::repository::fix_method method=medial::repository::fix_method::none, vector< RepProcessor * > *rep_processors=NULL)
 Creates vector of registry using already initialized MedPidRepository with signals in parallel manner for each patient.
 
void get_registry_creation_codes (vector< string > &signal_codes) const
 returns the signal codes used to create the registry - to load from rep
 
void get_registry_use_codes (vector< string > &signal_codes) const
 returns the signal codes used to create the registry - to use in create_registry command as input
 
void get_pids (vector< int > &pids) const
 returns all patients ids from registry - unique patient ids
 
void merge_records ()
 Merges registry record with same registry values (and continues in time)
 
void * new_polymorphic (string dname)
 for polymorphic classes that want to be able to serialize/deserialize a pointer * to the derived class given its type one needs to implement this function to return a new to the derived class given its type (as in my_type)
 
 MedRegistry ()
 Default Ctor.
 
virtual void clear_create_variables ()
 A function to clear creation variables that are on memory if needed.
 
virtual bool get_pid_records (PidRec &rec, int bDateCode, const vector< int > &used_sigs, vector< MedRegistryRecord > &results)
 
void set_rep_for_init (MedRepository &rep)
 Sets Repository object to initialize all registry object, if not given will try to use repository path to read and initialize repository.
 
- Public Member Functions inherited from SerializableObject
virtual int version () const
 Relevant for serializations.
 
virtual string my_class_name () const
 For better handling of serializations it is highly recommended that each SerializableObject inheriting class will implement the next method.
 
virtual void serialized_fields_name (vector< string > &field_names) const
 The names of the serialized fields.
 
virtual void pre_serialization ()
 
virtual void post_deserialization ()
 
virtual size_t get_size ()
 Gets bytes sizes for serializations.
 
virtual size_t serialize (unsigned char *blob)
 Serialiazing object to blob memory. return number ob bytes wrote to memory.
 
virtual size_t deserialize (unsigned char *blob)
 Deserialiazing blob to object. returns number of bytes read.
 
size_t serialize_vec (vector< unsigned char > &blob)
 
size_t deserialize_vec (vector< unsigned char > &blob)
 
virtual size_t serialize (vector< unsigned char > &blob)
 
virtual size_t deserialize (vector< unsigned char > &blob)
 
virtual int read_from_file (const string &fname)
 read and deserialize model
 
virtual int write_to_file (const string &fname)
 serialize model and write to file
 
virtual int read_from_file_unsafe (const string &fname)
 read and deserialize model without checking version number - unsafe read
 
int init_from_string (string init_string)
 Init from string.
 
int init_params_from_file (string init_file)
 
int init_param_from_file (string file_str, string &param)
 
virtual int init (map< string, string > &map)
 Virtual to init object from parsed fields.
 
int update_from_string (const string &init_string)
 
virtual int update (map< string, string > &map)
 Virtual to update object from parsed fields.
 
virtual string object_json () const
 

Static Public Member Functions

static MedRegistrymake_registry (const string &registry_type, const string &init_str="")
 creates registry type and initialize it if init_str is not empty Use "binary" for MedRegistryCodesList and "categories" for MedRegistryCategories.
 
static MedRegistrymake_registry (const string &registry_type, MedRepository &rep, const string &init_str="")
 creates registry type and initialize it if init_str is not empty Use "binary" for MedRegistryCodesList and "categories" for MedRegistryCategories.
 
static MedRegistrycreate_registry_full (const string &registry_type, const string &init_str, const string &repository_path, MedModel &model_with_rep_processor, medial::repository::fix_method method=medial::repository::fix_method::none)
 Creates vector of registry records - handles everything for you in parallel manner for each patient - uses create_registry.
 

Data Fields

vector< MedRegistryRecordregistry_records
 the registry records vector
 
int time_unit
 The time unit.
 

Protected Attributes

vector< string > signalCodes_names
 the signals codes by name
 
bool need_bdate
 If true Bdate is also used in registry creation.
 
medial::repository::fix_method resolve_conlicts = medial::repository::fix_method::none
 resolve conflicts in registry method
 
MedRepositoryrep_for_init = NULL
 repository pointer to init dicts
 

Detailed Description

A class that holds all registry records on all patients.


It has several ways to be initialized:

  1. by reading from disk - binary format or text format
  2. by creating registry using create_registry method. need to implement get_registry_records to handle single patient records.

    the class have also the ability to create contingency table with other signal:
    for each Gender,Age_bin - the 4 stats number of the registry with the appearances or not appearances of the signal value

Member Function Documentation

◆ clear_create_variables()

virtual void MedRegistry::clear_create_variables ( )
inlinevirtual

A function to clear creation variables that are on memory if needed.

Reimplemented in MedRegistryCodesList, and MedRegistryCategories.

◆ get_pids()

void MedRegistry::get_pids ( vector< int > &  pids) const

returns all patients ids from registry - unique patient ids

Parameters
pidsthe unique patient ids result vector

◆ make_registry()

MedRegistry * MedRegistry::make_registry ( const string &  registry_type,
const string &  init_str = "" 
)
static

creates registry type and initialize it if init_str is not empty Use "binary" for MedRegistryCodesList and "categories" for MedRegistryCategories.

if (registry_type == "binary")
registry = new MedRegistryCodesList;
else if (registry_type == "categories")
registry = new MedRegistryCategories;
else if (registry_type == "keep_alive")
registry = new MedRegistryKeepAlive;
else
MTHROW_AND_ERR("Error: Unsupported type \"%s\" for MedRegistry::make_registry\n",
registry_type.c_str());
A Regsitry creator to create categoriezed outcome by signal rules.
Definition MedRegistry.h:429
A Class which creates registry based on readcode lists.
Definition MedRegistry.h:361
Keep Alive registry - use for censoring "dead" times.
Definition MedRegistry.h:467

[MedRegistry::make_registry]

[MedRegistry::make_registry]

◆ new_polymorphic()

void * MedRegistry::new_polymorphic ( string  derived_name)
virtual

for polymorphic classes that want to be able to serialize/deserialize a pointer * to the derived class given its type one needs to implement this function to return a new to the derived class given its type (as in my_type)

Reimplemented from SerializableObject.


The documentation for this class was generated from the following files: