clinicedc 2.0.0__py3-none-any.whl → 2.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of clinicedc might be problematic. Click here for more details.
- {clinicedc-2.0.0.dist-info → clinicedc-2.0.1.dist-info}/METADATA +1 -1
- {clinicedc-2.0.0.dist-info → clinicedc-2.0.1.dist-info}/RECORD +72 -36
- {clinicedc-2.0.0.dist-info → clinicedc-2.0.1.dist-info}/WHEEL +1 -1
- edc_action_item/action.py +3 -2
- edc_action_item/data_fixers.py +1 -0
- edc_action_item/migrations/0038_alter_actionitem_revision_alter_actiontype_revision_and_more.py +86 -0
- edc_action_item/site_action_items.py +3 -1
- edc_adverse_event/migrations/0015_alter_aeactionclassification_revision_and_more.py +74 -0
- edc_appconfig/apps.py +3 -2
- edc_appointment/creators/appointments_creator.py +3 -2
- edc_appointment/migrations/0049_alter_appointment_revision_and_more.py +38 -0
- edc_appointment/model_mixins/appointment_model_mixin.py +5 -4
- edc_auth/auth_updater/group_updater.py +9 -3
- edc_auth/migrations/0034_alter_edcpermissions_revision_alter_role_revision.py +38 -0
- edc_consent/consent_definition.py +3 -2
- edc_consent/form_validators/subject_consent_form_validator.py +2 -1
- edc_consent/migrations/0005_alter_edcpermissions_revision.py +26 -0
- edc_consent/model_mixins/consent_extension_model_mixin.py +1 -0
- edc_consent/modelform_mixins/consent_modelform_mixin/consent_modelform_validation_mixin.py +3 -2
- edc_consent/models/signals.py +1 -0
- edc_consent/site_consents.py +1 -0
- edc_crf/crf_form_validator.py +2 -1
- edc_crf/migrations/0008_alter_crfstatus_revision.py +26 -0
- edc_dashboard/migrations/0005_alter_edcpermissions_revision.py +26 -0
- edc_data_manager/migrations/0039_alter_datadictionary_revision_and_more.py +101 -0
- edc_export/migrations/0021_alter_datarequest_revision_and_more.py +173 -0
- edc_facility/migrations/0015_alter_healthfacility_revision_and_more.py +38 -0
- edc_form_runners/migrations/0004_alter_issue_revision.py +26 -0
- edc_identifier/migrations/0010_alter_identifiermodel_revision.py +26 -0
- edc_lab/migrations/0035_alter_aliquot_revision_alter_box_revision_and_more.py +266 -0
- edc_lab_dashboard/migrations/0004_alter_edcpermissions_revision.py +26 -0
- edc_lab_results/model_mixins/insulin_model_mixin.py +1 -0
- edc_label/migrations/0006_alter_zpllabeltemplates_revision.py +29 -0
- edc_listboard/migrations/0006_alter_listboard_revision.py +29 -0
- edc_locator/migrations/0039_alter_historicalsubjectlocator_revision_and_more.py +38 -0
- edc_metadata/migrations/0030_alter_crfmetadata_revision_and_more.py +38 -0
- edc_navbar/migrations/0008_alter_edcpermissions_revision.py +26 -0
- edc_notification/migrations/0010_alter_notification_revision.py +26 -0
- edc_offstudy/migrations/0022_alter_historicalsubjectoffstudy_revision_and_more.py +41 -0
- edc_pharmacy/admin/stock/stock_request_admin.py +5 -4
- edc_pharmacy/admin/stock/stock_request_item_admin.py +5 -4
- edc_pharmacy/analytics/dataframes/get_next_scheduled_visit_for_subjects_df.py +10 -4
- edc_pharmacy/forms/stock/stock_request_form.py +15 -5
- edc_pharmacy/migrations/0088_alter_allocation_revision_alter_assignment_revision_and_more.py +794 -0
- edc_pharmacy/pdf_reports/stock_pdf_report.py +3 -2
- edc_protocol_incident/migrations/0023_alter_historicalprotocoldeviationviolation_revision_and_more.py +65 -0
- edc_pylabels/migrations/0012_alter_labelconfiguration_revision.py +26 -0
- edc_qareports/migrations/0018_alter_edcpermissions_revision_alter_note_revision.py +38 -0
- edc_qareports/utils.py +2 -1
- edc_randomization/migrations/0013_alter_edcpermissions_revision_and_more.py +50 -0
- edc_randomization/randomizer.py +2 -1
- edc_refusal/migrations/0011_alter_historicalsubjectrefusal_revision_and_more.py +38 -0
- edc_registration/migrations/0032_alter_historicalregisteredsubject_revision_and_more.py +38 -0
- edc_reportable/forms/reportables_form_validator_mixin.py +5 -4
- edc_reportable/migrations/0006_alter_gradingdata_revision_and_more.py +381 -0
- edc_reportable/utils/convert_units.py +2 -1
- edc_reportable/utils/molecular_weight_model_cls.py +1 -1
- edc_review_dashboard/migrations/0005_alter_edcpermissions_revision.py +26 -0
- edc_screening/migrations/0004_alter_edcpermissions_revision.py +26 -0
- edc_screening/screening_eligibility.py +1 -0
- edc_sites/migrations/0009_alter_edcpermissions_revision.py +26 -0
- edc_sites/single_site/single_site.py +1 -1
- edc_sites/site.py +2 -1
- edc_sites/utils/add_or_update_django_sites.py +1 -1
- edc_subject_dashboard/migrations/0004_alter_edcpermissions_revision.py +26 -0
- edc_unblinding/migrations/0013_alter_historicalunblindingrequest_revision_and_more.py +62 -0
- edc_visit_schedule/migrations/0018_alter_historicalonschedule_revision_and_more.py +86 -0
- edc_visit_schedule/schedule/schedule.py +4 -3
- edc_visit_schedule/site_visit_schedules.py +1 -1
- edc_visit_schedule/subject_schedule.py +2 -1
- edc_visit_tracking/migrations/0008_alter_historicalsubjectvisit_revision_and_more.py +65 -0
- {clinicedc-2.0.0.dist-info → clinicedc-2.0.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Generated by Django 5.2.4 on 2025-09-10 03:24
|
|
2
|
+
|
|
3
|
+
import django_revision.revision_field
|
|
4
|
+
from django.db import migrations
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
("edc_metadata", "0029_alter_crfmetadata_site_and_more"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AlterField(
|
|
15
|
+
model_name="crfmetadata",
|
|
16
|
+
name="revision",
|
|
17
|
+
field=django_revision.revision_field.RevisionField(
|
|
18
|
+
blank=True,
|
|
19
|
+
editable=False,
|
|
20
|
+
help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
|
|
21
|
+
max_length=75,
|
|
22
|
+
null=True,
|
|
23
|
+
verbose_name="Revision",
|
|
24
|
+
),
|
|
25
|
+
),
|
|
26
|
+
migrations.AlterField(
|
|
27
|
+
model_name="requisitionmetadata",
|
|
28
|
+
name="revision",
|
|
29
|
+
field=django_revision.revision_field.RevisionField(
|
|
30
|
+
blank=True,
|
|
31
|
+
editable=False,
|
|
32
|
+
help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
|
|
33
|
+
max_length=75,
|
|
34
|
+
null=True,
|
|
35
|
+
verbose_name="Revision",
|
|
36
|
+
),
|
|
37
|
+
),
|
|
38
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated by Django 5.2.4 on 2025-09-10 03:24
|
|
2
|
+
|
|
3
|
+
import django_revision.revision_field
|
|
4
|
+
from django.db import migrations
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
("edc_navbar", "0007_alter_edcpermissions_options_and_more"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AlterField(
|
|
15
|
+
model_name="edcpermissions",
|
|
16
|
+
name="revision",
|
|
17
|
+
field=django_revision.revision_field.RevisionField(
|
|
18
|
+
blank=True,
|
|
19
|
+
editable=False,
|
|
20
|
+
help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
|
|
21
|
+
max_length=75,
|
|
22
|
+
null=True,
|
|
23
|
+
verbose_name="Revision",
|
|
24
|
+
),
|
|
25
|
+
),
|
|
26
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated by Django 5.2.4 on 2025-09-10 03:24
|
|
2
|
+
|
|
3
|
+
import django_revision.revision_field
|
|
4
|
+
from django.db import migrations
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
("edc_notification", "0009_alter_notification_options_and_more"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AlterField(
|
|
15
|
+
model_name="notification",
|
|
16
|
+
name="revision",
|
|
17
|
+
field=django_revision.revision_field.RevisionField(
|
|
18
|
+
blank=True,
|
|
19
|
+
editable=False,
|
|
20
|
+
help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
|
|
21
|
+
max_length=75,
|
|
22
|
+
null=True,
|
|
23
|
+
verbose_name="Revision",
|
|
24
|
+
),
|
|
25
|
+
),
|
|
26
|
+
]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Generated by Django 5.2.4 on 2025-09-10 03:24
|
|
2
|
+
|
|
3
|
+
import django_revision.revision_field
|
|
4
|
+
from django.db import migrations
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
(
|
|
11
|
+
"edc_offstudy",
|
|
12
|
+
"0021_remove_historicalsubjectoffstudy_consent_model_and_more",
|
|
13
|
+
),
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
operations = [
|
|
17
|
+
migrations.AlterField(
|
|
18
|
+
model_name="historicalsubjectoffstudy",
|
|
19
|
+
name="revision",
|
|
20
|
+
field=django_revision.revision_field.RevisionField(
|
|
21
|
+
blank=True,
|
|
22
|
+
editable=False,
|
|
23
|
+
help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
|
|
24
|
+
max_length=75,
|
|
25
|
+
null=True,
|
|
26
|
+
verbose_name="Revision",
|
|
27
|
+
),
|
|
28
|
+
),
|
|
29
|
+
migrations.AlterField(
|
|
30
|
+
model_name="subjectoffstudy",
|
|
31
|
+
name="revision",
|
|
32
|
+
field=django_revision.revision_field.RevisionField(
|
|
33
|
+
blank=True,
|
|
34
|
+
editable=False,
|
|
35
|
+
help_text="System field. From git repository (tag:branch:commit), project metadata, project toml, project VERSION, or settings.",
|
|
36
|
+
max_length=75,
|
|
37
|
+
null=True,
|
|
38
|
+
verbose_name="Revision",
|
|
39
|
+
),
|
|
40
|
+
),
|
|
41
|
+
]
|
|
@@ -8,19 +8,20 @@ from django.urls import reverse
|
|
|
8
8
|
from django.utils.html import format_html
|
|
9
9
|
from django.utils.safestring import mark_safe
|
|
10
10
|
from django.utils.translation import gettext as _
|
|
11
|
+
from django_audit_fields import audit_fieldset_tuple
|
|
11
12
|
from rangefilter.filters import DateRangeFilterBuilder
|
|
12
13
|
|
|
13
|
-
from django_audit_fields import audit_fieldset_tuple
|
|
14
14
|
from edc_constants.constants import CANCELLED, COMPLETE, PENDING
|
|
15
15
|
from edc_model_admin.history import SimpleHistoryAdmin
|
|
16
16
|
from edc_utils.date import to_local
|
|
17
|
+
|
|
18
|
+
from ...admin_site import edc_pharmacy_admin
|
|
19
|
+
from ...forms import StockRequestForm
|
|
20
|
+
from ...models import StockRequest
|
|
17
21
|
from ..actions import allocate_stock_to_subject, prepare_stock_request_items_action
|
|
18
22
|
from ..actions.print_labels import print_labels_from_stock_request_by_code
|
|
19
23
|
from ..model_admin_mixin import ModelAdminMixin
|
|
20
24
|
from ..utils import stock_request_status_counts
|
|
21
|
-
from ...admin_site import edc_pharmacy_admin
|
|
22
|
-
from ...forms import StockRequestForm
|
|
23
|
-
from ...models import StockRequest
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
class StatusListFilter(admin.SimpleListFilter):
|
|
@@ -3,12 +3,16 @@ from django.template.loader import render_to_string
|
|
|
3
3
|
from django.urls import reverse
|
|
4
4
|
from django.utils.html import format_html
|
|
5
5
|
from django.utils.safestring import mark_safe
|
|
6
|
+
from django_audit_fields import audit_fieldset_tuple
|
|
6
7
|
from rangefilter.filters import DateRangeFilterBuilder
|
|
7
8
|
|
|
8
|
-
from django_audit_fields import audit_fieldset_tuple
|
|
9
9
|
from edc_model_admin.history import SimpleHistoryAdmin
|
|
10
10
|
from edc_model_admin.list_filters import FutureDateListFilter
|
|
11
11
|
from edc_utils.date import to_local
|
|
12
|
+
|
|
13
|
+
from ...admin_site import edc_pharmacy_admin
|
|
14
|
+
from ...forms import StockRequestItemForm
|
|
15
|
+
from ...models import StockRequestItem
|
|
12
16
|
from ..actions.print_labels import print_labels_from_stock_request_item
|
|
13
17
|
from ..list_filters import (
|
|
14
18
|
AssignmentListFilter,
|
|
@@ -18,9 +22,6 @@ from ..list_filters import (
|
|
|
18
22
|
)
|
|
19
23
|
from ..model_admin_mixin import ModelAdminMixin
|
|
20
24
|
from ..remove_fields_for_blinded_users import remove_fields_for_blinded_users
|
|
21
|
-
from ...admin_site import edc_pharmacy_admin
|
|
22
|
-
from ...forms import StockRequestItemForm
|
|
23
|
-
from ...models import StockRequestItem
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
class ApptDatetimeListFilter(FutureDateListFilter):
|
|
@@ -10,8 +10,8 @@ from edc_appointment.analytics import get_appointment_df
|
|
|
10
10
|
from edc_appointment.constants import NEW_APPT
|
|
11
11
|
from edc_registration import get_registered_subject_model_cls
|
|
12
12
|
from edc_sites.site import sites as site_sites
|
|
13
|
-
from ...models import Rx
|
|
14
13
|
|
|
14
|
+
from ...models import Rx
|
|
15
15
|
|
|
16
16
|
if TYPE_CHECKING:
|
|
17
17
|
from ...models import StockRequest
|
|
@@ -50,12 +50,16 @@ def get_next_scheduled_visit_for_subjects_df(
|
|
|
50
50
|
if stock_request.cutoff_datetime:
|
|
51
51
|
df_appt = df_appt[
|
|
52
52
|
df_appt.next_appt_datetime
|
|
53
|
-
<= pd.Timestamp(
|
|
53
|
+
<= pd.Timestamp(
|
|
54
|
+
stock_request.cutoff_datetime.date()
|
|
55
|
+
).to_datetime64()
|
|
54
56
|
]
|
|
55
57
|
df_appt = df_appt.reset_index(drop=True)
|
|
56
58
|
# get the first appointment due
|
|
57
59
|
df = (
|
|
58
|
-
df_appt[
|
|
60
|
+
df_appt[
|
|
61
|
+
(df_appt.appt_status == NEW_APPT) & (df_appt.visit_code_sequence == 0)
|
|
62
|
+
]
|
|
59
63
|
.sort_values(by=["appt_datetime"])
|
|
60
64
|
.groupby(by=["subject_identifier"])
|
|
61
65
|
.first()
|
|
@@ -66,7 +70,9 @@ def get_next_scheduled_visit_for_subjects_df(
|
|
|
66
70
|
|
|
67
71
|
# merge with registered_subject
|
|
68
72
|
df_registered_subject = read_frame(
|
|
69
|
-
get_registered_subject_model_cls().objects.values(
|
|
73
|
+
get_registered_subject_model_cls().objects.values(
|
|
74
|
+
"id", "subject_identifier"
|
|
75
|
+
),
|
|
70
76
|
verbose=False,
|
|
71
77
|
)
|
|
72
78
|
df_registered_subject = df_registered_subject.rename(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from django import forms
|
|
2
2
|
|
|
3
3
|
from edc_registration.models import RegisteredSubject
|
|
4
|
+
|
|
4
5
|
from ...models import Allocation, StockRequest
|
|
5
6
|
|
|
6
7
|
|
|
@@ -29,10 +30,16 @@ class StockRequestForm(forms.ModelForm):
|
|
|
29
30
|
raise forms.ValidationError(
|
|
30
31
|
{"subject_identifiers": "Not all subject identifiers are valid."}
|
|
31
32
|
)
|
|
32
|
-
if cleaned_data.get("excluded_subject_identifiers") and cleaned_data.get(
|
|
33
|
-
|
|
33
|
+
if cleaned_data.get("excluded_subject_identifiers") and cleaned_data.get(
|
|
34
|
+
"location"
|
|
35
|
+
):
|
|
36
|
+
subject_identifiers = cleaned_data.get(
|
|
37
|
+
"excluded_subject_identifiers"
|
|
38
|
+
).split("\n")
|
|
34
39
|
subject_identifiers = [s.strip() for s in subject_identifiers]
|
|
35
|
-
self.cleaned_data["excluded_subject_identifiers"] = "\n".join(
|
|
40
|
+
self.cleaned_data["excluded_subject_identifiers"] = "\n".join(
|
|
41
|
+
subject_identifiers
|
|
42
|
+
)
|
|
36
43
|
if RegisteredSubject.objects.values("subject_identifier").filter(
|
|
37
44
|
subject_identifier__in=subject_identifiers,
|
|
38
45
|
site_id=cleaned_data.get("location").site_id,
|
|
@@ -77,7 +84,8 @@ class StockRequestForm(forms.ModelForm):
|
|
|
77
84
|
if (
|
|
78
85
|
cleaned_data.get("request_datetime")
|
|
79
86
|
and cleaned_data.get("cutoff_datetime")
|
|
80
|
-
and cleaned_data.get("cutoff_datetime")
|
|
87
|
+
and cleaned_data.get("cutoff_datetime")
|
|
88
|
+
< cleaned_data.get("request_datetime")
|
|
81
89
|
):
|
|
82
90
|
raise forms.ValidationError(
|
|
83
91
|
{"cutoff_datetime": "Invalid. Must after the request date"}
|
|
@@ -89,7 +97,9 @@ class StockRequestForm(forms.ModelForm):
|
|
|
89
97
|
== cleaned_data.get("request_datetime").date()
|
|
90
98
|
):
|
|
91
99
|
raise forms.ValidationError(
|
|
92
|
-
{
|
|
100
|
+
{
|
|
101
|
+
"cutoff_datetime": "Invalid. Must be at least 1 day after the request date"
|
|
102
|
+
}
|
|
93
103
|
)
|
|
94
104
|
if (
|
|
95
105
|
cleaned_data.get("start_datetime")
|