Skip to content

MedRegistry

Code documentation Methods in MedRegistry:

  • reading the object: read_text_file or read_from_file to read in text format or in binary format.
  • writing the object: write_text_file or write_from_file to writein text format or in binary format.
  • create_registry - an option to create registry records by implementing private function ** to fetch each patient registry records
  • calc_signal_stats - a method to create contingency table with other signal splited by gender and age groups.
  • create_incidence_file - a method to calc the incidence (also with kaplan meier)    A class that holds all registry records on all patients using MedRegistryRecord. very similar to MedCohort, but a more generic class to hold multiple periods for outcome on same patients. for example pregnancy, influenza, kidney stones, sofa scores...  Each record consist of those fields in MedRegistryRecord:
Parameter name description
pid patient id
start_date the start date of the outcome 
end_date the end date of the outcome
 registry_value

 the registry value. 0 for controls, 1 for cases or other value in more complex cases.

For example in diabetes it may mark the states from 0-2. 0 - no diabetes, 1- pre, 2- diabetes.

for each period we create record, or value for SOFA Score

Example records for cancer from MedCohort: A patient who is in the cohort from 01.01.2000 till 01.01.2016 and got cancer in 01.01.2012 will be presented by 2 MedRegistryRecords. one period for control outcome period and one period for the case period:

  1. control period: start_date=01.01.2000, end_date=01.01.2012, registry_value=0
  2. case period: start_date=01.01.2012, end_date=01.01.2016, registry_value=1 a patient who is always control will create 1 record with the start,end dates of the control period   It has several ways to be initialized:

  3. by reading from disk - binary format or text format

  4. 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