Exemple #1
0
class DRGReader:
    FIELDNAMES = [
        'id', 'ageYears', 'ageDays', 'admWeight', 'sex', 'adm', 'sep', 'los',
        'sdf', 'hmv', 'pdx'
    ]
    DRG_OUT_FIELDNAMES = [
        'id', 'drg', 'mdc', 'gage', 'gsex', 'gst', 'pccl', 'ecw', 'cflag'
    ]
    RESTKEY = 'diagproc'
    MAX_ADDITIONAL_DIAGNOSES = 99
    MAX_PROCEDURES = 100

    def __init__(self, filename):
        self.filename = filename
        self.feature_names = []
        self.drg_trainingset = DRGTrainingSet()

    def read_from_file(self):
        with open(self.filename, 'r') as csvFile:
            reader = csv.DictReader(csvFile,
                                    fieldnames=self.FIELDNAMES,
                                    restkey=self.RESTKEY,
                                    delimiter=';')
            for row in reader:
                for instance in self.get_drg_instances_from_row(row):
                    self.drg_trainingset.add_drg_training_instance(instance)
        return self.drg_trainingset
Exemple #2
0
class DRGReader:
    FIELDNAMES = ['id', 'ageYears', 'ageDays', 'admWeight', 'sex', 'adm', 'sep', 'los', 'sdf', 'hmv', 'pdx']
    DRG_OUT_FIELDNAMES = ['id', 'drg', 'mdc', 'gage', 'gsex', 'gst', 'pccl', 'ecw', 'cflag']
    RESTKEY = 'diagproc'
    MAX_ADDITIONAL_DIAGNOSES = 99
    MAX_PROCEDURES = 100 
        
    def __init__(self, filename):
        self.filename = filename
        self.feature_names = []  
        self.drg_trainingset = DRGTrainingSet()

    def read_from_file(self):
        with open(self.filename, 'r') as csvFile:
            reader = csv.DictReader(csvFile, fieldnames=self.FIELDNAMES, restkey=self.RESTKEY, delimiter=';')
            for row in reader:
                for instance in self.get_drg_instances_from_row(row):
                    self.drg_trainingset.add_drg_training_instance(instance)
        return self.drg_trainingset
Exemple #3
0
 def __init__(self, filename):
     self.filename = filename
     self.feature_names = []  
     self.drg_trainingset = DRGTrainingSet()
Exemple #4
0
 def __init__(self, filename):
     self.filename = filename
     self.feature_names = []
     self.drg_trainingset = DRGTrainingSet()