def gen(t, i):
	desc = genDiagnosis()
	noevent = int(random.random()*nb_event)
	dateA = genAction.genDates(noevent)
	no = i+1
	values = u''.join(("  VALUES (", str(no),", ", \
		     		"", str(noevent + 1) ,", " , str(int(random.random()*nb_doc + 1)), ", ", \
					"'", dateA.isoformat(), "', ", \
					"'", desc,"');")).encode('utf-8').strip()
	print "INSERT INTO " + t
	print values
	print
def gen(t, i):
	med = genMed()
	noevent = int(random.random()*nb_event)
	dateA = genAction.genDates(noevent)
	no = i+1
	values = u''.join(("  VALUES (", str(no),", ", \
		     		"", str(noevent + 1) ,", " , str(int(random.random()*nb_doc + 1))\
					, ", '", genDate(2005) , "'"\
					, ", '", med[0] , "' ,'", med[1], "' , '", med[2], "' , '" \
					, med[3],"');")).encode('utf-8').strip()
	print "INSERT INTO " + t
	print values
	print
Exemple #3
0
def gen(t, i):
	desc = genDesc()
	noevent = int(random.random()*nb_event)
	dateA = genAction.genDates(noevent)
	no = i+1
	prob = int(random.random()*2)
	if( prob == 1) :
		values = u''.join(("  VALUES (", str(no),", ", \
		     		"", str(noevent + 1) ,", '" , str(Nurses[int(random.random()*nb_nur)]), "', ", \
					"'", dateA.isoformat(), "', ", \
					"'", desc,"', '');")).encode('utf-8').strip()
	else :
		values = u''.join(("  VALUES (", str(no),", ", \
		     		"", str(noevent + 1) ,", '" , str(Doctors[int(random.random()*nb_doc)]), "', ", \
					"'", dateA.isoformat(), "', ", \
					"'", desc,"', '');")).encode('utf-8').strip()
	print "INSERT INTO " + t
	print values
	print