def write_to_files(self, base="."):
        
        base = os.path.join(base, "records")
        
        try:
            os.mkdir(base)
        except __HOLE__: pass        
        
        f = open(os.path.join(base, "%s"%self.id), "w")

        self.model = bound_graph()
        
        for m in self.meds:
            self.add_all(self.rdf_med(m))
            
        for p in self.problems:
            self.add_all(self.rdf_problem(p))

        for l in self.labs:
            try:
                self.add_all(self.rdf_lab(l))
            except: pass

        for v in self.vitals:
            self.add_all(self.rdf_vital(v))


        self.add_all(self.rdf_demographics())

        f.write(serialize_rdf(self.model))
        f.close()
dataset/ETHPy150Open smart-classic/smart_server/smart/lib/i2b2_export.py/i2b2Patient.write_to_files