-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.1.15' into main
- Loading branch information
Showing
12 changed files
with
209 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig as DjangoAppConfig | ||
|
||
|
||
class AppConfig(DjangoAppConfig): | ||
name = "microbiology_app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from datetime import date | ||
|
||
from django.db import models | ||
from django.db.models import PROTECT | ||
from edc_crf.model_mixins import CrfModelMixin | ||
from edc_identifier.managers import SubjectIdentifierManager | ||
from edc_identifier.model_mixins import NonUniqueSubjectIdentifierFieldMixin | ||
from edc_model.models import BaseUuidModel | ||
from edc_registration.model_mixins import UpdatesOrCreatesRegistrationModelMixin | ||
from edc_screening.model_mixins import ScreeningModelMixin | ||
from edc_sites.models import SiteModelMixin | ||
from edc_utils import get_utcnow | ||
from edc_visit_schedule.model_mixins import OffScheduleModelMixin, OnScheduleModelMixin | ||
from edc_visit_tracking.models import SubjectVisit | ||
|
||
|
||
class SubjectScreening(ScreeningModelMixin, BaseUuidModel): | ||
objects = SubjectIdentifierManager() | ||
|
||
|
||
class SubjectConsent( | ||
SiteModelMixin, | ||
NonUniqueSubjectIdentifierFieldMixin, | ||
UpdatesOrCreatesRegistrationModelMixin, | ||
BaseUuidModel, | ||
): | ||
report_datetime = models.DateTimeField(default=get_utcnow) | ||
|
||
consent_datetime = models.DateTimeField(default=get_utcnow) | ||
|
||
version = models.CharField(max_length=25, default="1") | ||
|
||
identity = models.CharField(max_length=25) | ||
|
||
confirm_identity = models.CharField(max_length=25) | ||
|
||
dob = models.DateField(default=date(1995, 1, 1)) | ||
|
||
|
||
class OnSchedule(SiteModelMixin, OnScheduleModelMixin, BaseUuidModel): | ||
pass | ||
|
||
|
||
class OffSchedule(SiteModelMixin, OffScheduleModelMixin, BaseUuidModel): | ||
pass | ||
|
||
|
||
class CrfOne(CrfModelMixin, BaseUuidModel): | ||
subject_visit = models.ForeignKey(SubjectVisit, on_delete=PROTECT) | ||
|
||
report_datetime = models.DateTimeField(default=get_utcnow) | ||
|
||
f1 = models.CharField(max_length=50, null=True, blank=True) | ||
|
||
f2 = models.CharField(max_length=50, null=True, blank=True) | ||
|
||
f3 = models.CharField(max_length=50, null=True, blank=True) | ||
|
||
next_appt_date = models.DateField(null=True, blank=True) | ||
|
||
next_visit_code = models.CharField(max_length=50, null=True, blank=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.contrib import admin | ||
from django.urls import include, path | ||
from django.views.generic import RedirectView | ||
|
||
app_name = "microbiology_app" | ||
|
||
|
||
urlpatterns = [] | ||
|
||
|
||
urlpatterns += [ | ||
path("admin/", admin.site.urls), | ||
path("i18n/", include("django.conf.urls.i18n")), | ||
path("", RedirectView.as_view(url="admin/"), name="logout"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
from dateutil.relativedelta import relativedelta | ||
from edc_visit_schedule.schedule import Schedule | ||
from edc_visit_schedule.visit import Crf, FormsCollection, Visit | ||
from edc_visit_schedule.visit_schedule import VisitSchedule | ||
|
||
crfs = FormsCollection(Crf(show_order=1, model="microbiology_app.crfone", required=True)) | ||
|
||
visit0 = Visit( | ||
code="1000", | ||
title="Day 1", | ||
timepoint=0, | ||
rbase=relativedelta(days=0), | ||
rlower=relativedelta(days=0), | ||
rupper=relativedelta(days=6), | ||
crfs=crfs, | ||
) | ||
|
||
visit1 = Visit( | ||
code="2000", | ||
title="Day 2", | ||
timepoint=1, | ||
rbase=relativedelta(days=1), | ||
rlower=relativedelta(days=0), | ||
rupper=relativedelta(days=6), | ||
crfs=crfs, | ||
) | ||
|
||
visit2 = Visit( | ||
code="3000", | ||
title="Day 3", | ||
timepoint=2, | ||
rbase=relativedelta(days=2), | ||
rlower=relativedelta(days=0), | ||
rupper=relativedelta(days=6), | ||
crfs=crfs, | ||
) | ||
|
||
visit3 = Visit( | ||
code="4000", | ||
title="Day 4", | ||
timepoint=3, | ||
rbase=relativedelta(days=3), | ||
rlower=relativedelta(days=0), | ||
rupper=relativedelta(days=6), | ||
crfs=crfs, | ||
) | ||
|
||
schedule = Schedule( | ||
name="schedule", | ||
onschedule_model="microbiology_app.onschedule", | ||
offschedule_model="microbiology_app.offschedule", | ||
appointment_model="edc_appointment.appointment", | ||
consent_model="microbiology_app.subjectconsent", | ||
) | ||
|
||
schedule.add_visit(visit0) | ||
schedule.add_visit(visit1) | ||
schedule.add_visit(visit2) | ||
schedule.add_visit(visit3) | ||
|
||
visit_schedule = VisitSchedule( | ||
name="visit_schedule", | ||
offstudy_model="edc_offstudy.subjectoffstudy", | ||
death_report_model="edc_adverse_event.deathreport", | ||
) | ||
|
||
visit_schedule.add_schedule(schedule) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.