Exemplo n.º 1
0
def plasmapheresis(patient):
    plasmapheresis = Plasmapheresis()
    plasmapheresis.patient = patient
    plasmapheresis.from_date = date(2015, 1, 1)
    plasmapheresis.to_date = date(2015, 1, 2)
    plasmapheresis.no_of_exchanges = 3
    plasmapheresis.response = PlasmapheresisResponse(id=1)
    return plasmapheresis
Exemplo n.º 2
0
Arquivo: dev.py Projeto: rclanan/radar
    def f(patient, facility, n):
        for _ in range(n):
            plasmapheresis = Plasmapheresis()
            plasmapheresis.patient = patient
            plasmapheresis.facility = facility
            plasmapheresis.from_date = random_date(date(2000, 1, 1), date.today())

            if random.random() > 0.5:
                plasmapheresis.to_date = random_date(plasmapheresis.from_date, date.today())

            plasmapheresis.no_of_exchanges = random.randint(1, 10)
            plasmapheresis.response = random.choice(plasmapheresis_responses)
            db.session.add(plasmapheresis)
def hospitalisation(patient):
    hospitalisation = Plasmapheresis()
    hospitalisation.patient = patient
    hospitalisation.date_of_admission = date(2015, 1, 1)
    hospitalisation.date_of_discharge = date(2015, 1, 2)
    return hospitalisation