def initData(): """Load data and mappings from Raw data files and mapping files""" Patient.generate() Patient.load() VitalSigns.load() Lab.load() Procedure.load() Immunization.load() FamilyHistory.load() SocialHistory.load() Condition.load() Med.load() Refill.load() Document.load() Allergy.load() ClinicalNote.load() Practitioner.load()
# Show progress with '.' characters print ".", sys.stdout.flush() parser.exit(0,"\nDone writing %d patient RDF files!"%len(Patient.mpi)) # Write all patient RDF files out to a directory if args.writeIndivo: print "Writing files to %s:"%args.writeIndivo initData() path = args.writeIndivo if not os.path.exists(path): parser.error("Invalid path: '%s'.Path must already exist."%path) if not path.endswith('/'): path = path+'/' # Works with DOS? Who cares?? import indivo for pid in Patient.mpi: f = open(path+"p%s.py"%pid,'w') indivo.writePatientFile(f, pid) f.close() # Show progress with '.' characters print ".", sys.stdout.flush() parser.exit(0,"\nDone writing %d patient RDF files!"%len(Patient.mpi)) # Generate a new patients data file, re-randomizing old names, dob, etc: Patient.generate() parser.exit(0,"Patient data written to: %s\n"%PATIENTS_FILE) parser.error("No arguments given")