|
int | init (map< string, string > &mapper) |
| Init from map.
|
|
void | init_lists () |
| Required/Affected signals.
|
|
void | post_deserialization () |
|
void | init_tables (MedDictionarySections &dict, MedSignals &sigs) |
| Init required tables : Should be implemented for inheriting classes that have such tables.
|
|
int | _learn (MedPidRepository &rep, MedSamples &samples, vector< RepProcessor * > &prev_processors) |
| In this class there's never learning - we return 0 immediately.
|
|
int | _apply (PidDynamicRec &rec, vector< int > &time_points, vector< vector< float > > &attributes_mat) |
| apply processing on a single PidDynamicRec at a set of time-points : Should be implemented for all inheriting classes
|
|
void | get_required_signal_categories (unordered_map< string, vector< string > > &signal_categories_in_use) const |
| returns for each used signal it's used categories
|
|
void | make_summary () |
|
void | init_ht_registry_tables (MedDictionarySections &dict, MedSignals &sigs) |
|
void | ht_registry_apply (PidDynamicRec &rec, vector< int > &time_points, int iver, vector< UniversalSigVec > &usvs, vector< vector< float > > &all_v_vals, vector< vector< int > > &all_v_times, vector< int > &final_sizes) |
|
void | ht_init_defaults () |
|
void | fillLookupTableForHTDrugs (MedDictionary &dict, vector< char > &lut, vector< string > &sets, char val) |
|
void | buildLookupTableForHTDrugs (MedDictionary &dict, vector< char > &lut) |
|
void | init_dm_registry_tables (MedDictionarySections &dict, MedSignals &sigs) |
|
void | dm_registry_apply (PidDynamicRec &rec, vector< int > &time_points, int iver, vector< UniversalSigVec > &usvs, vector< vector< float > > &all_v_vals, vector< vector< int > > &all_v_times, vector< int > &final_sizes) |
|
void | init_proteinuria_registry_tables (MedDictionarySections &dict, MedSignals &sigs) |
|
void | proteinuria_registry_apply (PidDynamicRec &rec, vector< int > &time_points, int iver, vector< UniversalSigVec > &usvs, vector< vector< float > > &all_v_vals, vector< vector< int > > &all_v_times, vector< int > &final_sizes) |
|
void | init_ckd_registry_tables (MedDictionarySections &dict, MedSignals &sigs) |
|
void | ckd_registry_apply (PidDynamicRec &rec, vector< int > &time_points, int iver, vector< UniversalSigVec > &usvs, vector< vector< float > > &all_v_vals, vector< vector< int > > &all_v_times, vector< int > &final_sizes) |
|
void | custom_registry_apply (PidDynamicRec &rec, vector< int > &time_points, int iver, const vector< UniversalSigVec > &usvs, vector< vector< float > > &all_v_vals, vector< vector< int > > &all_v_times, vector< int > &final_sizes) |
|
virtual void | clear () |
|
virtual int | init (void *params) |
| initialize from a params object : Should be implemented for inheriting classes that have parameters
|
|
virtual void | init_defaults () |
| initialize to default values : Should be implemented for inheriting classes that have parameters
|
|
virtual void | set_signal (const string &_signalName) |
| set signal-name : Should be implemented for inheriting classes that have signalName
|
|
virtual void | set_signal_ids (MedSignals &sigs) |
| set signal-ids : Should be implemented for inheriting classes that have signalId
|
|
virtual void | get_required_signal_names (unordered_set< string > &signalNames) |
| Append required signal names to set : parent function just uses req_signals.
|
|
virtual void | get_required_signal_names (unordered_set< string > &signalNames, unordered_set< string > preReqSignals) |
| Append required signal names to set only if processor is actually required to produce any of preReqSignals : parent function just uses req_signals.
|
|
virtual void | set_required_signal_ids (MedDictionarySections &dict) |
| Fill req_signal_ids : parent function just fills from req_signals.
|
|
virtual void | add_virtual_signals (map< string, int > &_virtual_signals, map< string, string > &_virtual_signals_generic) const |
| rep processors CREATING virtual signals need to implement this: adding their signals to the pile
|
|
virtual void | get_required_signal_ids (unordered_set< int > &signalIds) |
| Append required signal names to set : parent function just uses req_signals.
|
|
virtual void | get_required_signal_ids (unordered_set< int > &signalIds, unordered_set< int > preReqSignals) |
| Append required signal names to set only if processor is actually required to produce any of preReqSignals : parent function just uses req_signals.
|
|
virtual void | set_affected_signal_ids (MedDictionarySections &dict) |
| Fill aff_signal_ids : parent function just fills from aff_signals.
|
|
bool | is_signal_affected (int signalId) |
| Check if a signal is affected by processor </summray> - Returns
- true if affected, false if not
|
|
bool | is_signal_affected (string &signalName) |
|
virtual void | fit_for_repository (MedPidRepository &rep) |
| make changes to RepProcessor according to available signals in Repository
|
|
virtual void | register_virtual_section_name_id (MedDictionarySections &dict) |
| Register section id to section name of new virtual signals.
|
|
virtual bool | filter (unordered_set< string > &reqSignals) |
| Check if processor (and 'sub'-processors within) should be applied according to set of required signals </summray> - Returns
- true if processor is not required and can be filtered, false otherwise
|
|
virtual void | init_attributes () |
| Init attributes information : Should be implemented for inheriting classes that have attributes.
|
|
virtual int | _conditional_learn (MedPidRepository &rep, MedSamples &samples, vector< RepProcessor * > &prev_processors, unordered_set< int > &neededSignalIds) |
| learn processing model on a subset of samples only if required. Apply set of preceeding processors on DynamicPidRec before learning :
|
|
int | learn (MedPidRepository &rep, MedSamples &samples, vector< RepProcessor * > &prev_processors) |
| learn processing model on a subset of ids. Apply set of preceeding processors on DynamicPidRec before learning
|
|
int | learn (MedPidRepository &rep) |
| learn on all pids in repository, using fake samples - works only for repProcessors that ignore sample dates
|
|
int | learn (MedPidRepository &rep, MedSamples &samples) |
| learn on subset of samples without preceesing processors
|
|
virtual int | conditional_learn (MedPidRepository &rep, MedSamples &samples, vector< RepProcessor * > &prev_processors, unordered_set< int > &neededSignalIds) |
| learn processing model on a subset of samples only if required. Apply set of preceeding processors on DynamicPidRec before learning :
|
|
int | conditional_learn (MedPidRepository &rep, MedSamples &samples, unordered_set< int > &neededSignalIds) |
| learn processing model on a subset of ids only if required without preceesing processors
|
|
virtual int | _conditional_apply (PidDynamicRec &rec, vector< int > &time_points, unordered_set< int > &neededSignalIds, vector< vector< float > > &attributes_vals) |
| apply processing on a single PidDynamicRec at a set of time-points only if required : May be implemented for inheriting classes
|
|
virtual int | _apply_simple (PidDynamicRec &rec, vector< int > &time_points) |
|
int | apply (PidDynamicRec &rec, vector< int > &time_points, vector< vector< float > > &attributes_vals) |
| apply processing on a single PidDynamicRec at a set of time-points
|
|
int | conditional_apply (PidDynamicRec &rec, vector< int > &time_points, unordered_set< int > &neededSignalIds, vector< vector< float > > &attributes_vals) |
| apply processing on a single PidDynamicRec at a set of time-points only if required : if any of the signals in neededSignalIds is actually affected by processor
|
|
int | apply (PidDynamicRec &rec, MedIdSamples &samples) |
| apply processing on a single PidDynamicRec at a set of time-points given by samples
|
|
int | conditional_apply (PidDynamicRec &rec, MedIdSamples &samples, unordered_set< int > &neededSignalIds) |
| apply processing on a single PidDynamicRec at a set of time-points given by samples only if required
|
|
int | conditional_apply_without_attributes (PidDynamicRec &rec, const MedIdSamples &samples, unordered_set< int > &neededSignalIds) |
| apply processing on a single PidDynamicRec at a set of time-points given by samples only if required, not affecting attributes
|
|
virtual void | dprint (const string &pref, int rp_flag) |
| used for debug prints, each inheriting class can overload this one to get a more precise debug print.
|
|
void * | new_polymorphic (string derived_class_name) |
| 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)
|
|
size_t | get_processor_size () |
| get size of processor + processor_type
|
|
size_t | processor_serialize (unsigned char *blob) |
| seialize processor + processor_type
|
|
virtual void | print () |
| optional printing of processor
|
|
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 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 ¶m) |
|
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 |
|
|
RegistryTypes | registry |
| type of registry to create
|
|
vector< string > | names |
| name(s) of registry signal(s) to create
|
|
vector< string > | signals |
| Vector of required signals, to override default ones.
|
|
vector< string > | registry_values |
| values of registry (to appear in relevant section of dictionary)
|
|
int | time_unit = -1 |
| time-unit of registry
|
|
bool | verbose = false |
| verbosity
|
|
bool | ht_systolic_first = false |
|
vector< string > | ht_identifiers |
| identifiers (ReadCodes) of HT
|
|
vector< string > | chf_identifiers |
| identifiers (ReadCodes) of CHF
|
|
vector< string > | mi_identifiers |
| identifiers (ReadCodes) of MI
|
|
vector< string > | af_identifiers |
| identifiers (ReadCodes) of AF
|
|
bool | ht_identifiers_given = false |
|
bool | chf_identifiers_given = false |
|
bool | mi_identifiers_given = false |
|
bool | af_identifiers_given = false |
|
vector< string > | ht_drugs = { "ATC_C08C____","ATC_C07B____","ATC_C07C____","ATC_C07D____","ATC_C07F____","ATC_C07A_G__","ATC_C09B____","ATC_C09D____", "ATC_C02D_A01" } |
| drugs indicative of HT
|
|
vector< string > | ht_chf_drugs = { "ATC_C03_____" } |
| drugs indicative of HT, unless CHF
|
|
vector< string > | ht_dm_drugs = { "ATC_C09A____", "ATC_C09C____" } |
| drugs indicative of HT, unless DM
|
|
vector< string > | ht_extra_drugs = { "ATC_C07A_A__", "ATC_C07A_B__" } |
| drugs indicative of HT, unless CHF/MI/AF.
|
|
int | ht_drugs_gap = 120 |
| Gap (in days) from drug input to following indication.
|
|
string | dm_drug_sig = "Drug" |
|
vector< string > | dm_drug_sets = { "ATC_A10_____" } |
|
string | dm_diagnoses_sig = "RC" |
|
vector< string > | dm_diagnoses_sets |
|
string | dm_glucose_sig = "Glucose" |
|
string | dm_hba1c_sig = "HbA1C" |
|
int | dm_diagnoses_severity = 4 |
|
int | dm_bio_mode = 0 |
|
vector< string > | urine_tests_categories |
|
string | ckd_egfr_sig = "eGFR_CKD_EPI" |
|
string | ckd_proteinuria_sig = "Proteinuria_State" |
|
string | registry_custom_type = "" |
|
string | registry_custom_args = "" |
|
ADD_SERIALIZATION_FUNCS(processor_type, registry, names, signals, time_unit, req_signals, aff_signals, virtual_signals, virtual_signals_generic, registry_values, ht_identifiers, chf_identifiers, mi_identifiers, af_identifiers, ht_identifiers_given, chf_identifiers_given, mi_identifiers_given, af_identifiers_given, ht_drugs, ht_chf_drugs, ht_dm_drugs, ht_extra_drugs, ht_drugs_gap, dm_drug_sig, dm_drug_sets, dm_diagnoses_sig, dm_diagnoses_sets, dm_glucose_sig, dm_hba1c_sig, dm_diagnoses_severity, urine_tests_categories, ckd_egfr_sig, ckd_proteinuria_sig, registry_custom_type, registry_custom_args, custom_registry, ht_systolic_first) private int | bDateCode = -1 |
|
vector< int > | create_custom_input_sigs |
|
string | registry_name |
|
int | found_op_ht = 0 |
|
int | num_ht_measurements = 0 |
|
const map< string, RegistryTypes > | name2type = { { "dm" , REP_REGISTRY_DM },{ "ht", REP_REGISTRY_HT },{ "proteinuria", REP_REGISTRY_PROTEINURIA },{ "ckd", REP_REGISTRY_CKD },{ "custom", REP_REGISTRY_CUSTOM } } |
| registry name to type
|
|
const map< RegistryTypes, vector< pair< string, string > > > | type2Virtuals |
|
const map< RegistryTypes, vector< string > > | type2reqSigs |
|
set< int > | sig_ids_s |
|
vector< int > | sig_ids |
| ids of signals used as input by the calculator (for faster usage at run time: save name conversions)
|
|
vector< int > | virtual_ids |
| ids of signals created by the calculator (for faster usage at run time: save name conversions)
|
|
int | dm_drug_idx = -1 |
|
int | dm_diagnoses_idx = -1 |
|
vector< char > | dm_drug_lut |
|
vector< char > | dm_diagnoses_lut |
|
int | dm_glucose_idx = -1 |
|
int | dm_hba1c_idx = -1 |
|
vector< string > | dm_reg_values = { "DM_Registry_Non_diabetic", "DM_Registry_Pre_diabetic", "DM_Registry_Diabetic" } |
|
vector< string > | proteinuria_reg_values = { "Proteinuria_Normal", "Proteinuria_Medium" , "Proteinuria_Severe" } |
|
vector< RegistryDecisionRanges > | proteinuria_ranges |
|
vector< string > | ckd_reg_values = { "CKD_State_Normal" , "CKD_State_Level_1", "CKD_State_Level_2", "CKD_State_Level_3", "CKD_State_Level_4" } |
|
int | ckd_egfr_idx = -1 |
|
int | ckd_proteinuria_idx = -1 |
|
vector< int > | signal_time_units |
| time-units of all signals
|
|
vector< string > | ht_def_values = { "HT_Registry_Non_Hypertensive","HT_Registry_Hypertensive" } |
|
int | bp_idx = 0 |
|
int | rc_idx = 1 |
|
int | drug_idx = 2 |
|
int | bdate_idx = 3 |
|
int | dm_registry_idx = 4 |
|
vector< char > | htLut |
|
vector< char > | chfLut |
|
vector< char > | miLut |
|
vector< char > | afLut |
|
vector< char > | htDrugLut |
|
RepProcessorTypes | processor_type = REP_PROCESS_LAST |
| type of repository processor
|
|
unordered_set< string > | req_signals |
| names of signals required for processsing
|
|
unordered_set< int > | req_signal_ids |
| ids of signals required for processing
|
|
unordered_set< string > | aff_signals |
| names of signals affected by processing
|
|
unordered_set< int > | aff_signal_ids |
| ids of signals affected by processing
|
|
bool | unconditional = false |
| indicated that processor should ALWAYS be applied
|
|
vector< string > | attributes |
| attributes generated by the processor (optional)
|
|
vector< pair< string, int > > | virtual_signals |
| virtual signals are created only in rep processors but can be used by any rep processor that comes after or any feture generator as a regular signal.
|
|
vector< pair< string, string > > | virtual_signals_generic |
|