ambition-trial / ambition-rando

Randomization class and model for Ambition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pypi travis codecov downloads

ambition-rando

Randomization class and model for Ambition

To load the randomization list:

python manage.py import_randomization_list

To rebuild the records in RandomizationList:

from django.core.exceptions import ObjectDoesNotExist
from django.contrib.sites.models import Site
from edc_registration.models import RegisteredSubject
from ambition_rando.models import RandomizationList

current_site = Site.objects.get_current()
for obj in RegisteredSubject.on_site.all():
    try:
        randobj = RandomizationList.objects.get(sid=obj.sid)
    except ObjectDoesNotExist:
        print(f'missing for {obj.subject_identifier}, {obj.sid}.')
    else:
        randobj.alocated_site=current_site
        randobj.subject_identifier=obj.subject_identifier
        randobj.allocated_datetime=obj.consent_datetime
        randobj.allocated=True
        randobj.save()

About

Randomization class and model for Ambition

License:GNU General Public License v3.0


Languages

Language:Python 98.7%Language:HTML 1.3%