meta-edc 1.3.0__py3-none-any.whl → 1.4.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 meta-edc might be problematic. Click here for more details.

@@ -7,6 +7,7 @@ CASE_OGTT = 1
7
7
  EOS_DM_MET = "EOS - Patient developed diabetes"
8
8
  OGTT_THRESHOLD_MET = "OGTT >= 11.1"
9
9
  FBG_BEYOND_THRESHOLD = 20.0
10
+ FBG_THRESHOLD_MET = f"FBG >= {FBG_BEYOND_THRESHOLD}"
10
11
  endpoint_columns = [
11
12
  "subject_identifier",
12
13
  "site_id",
@@ -30,6 +31,6 @@ endpoint_cases = {
30
31
  CASE_FBGS_WITH_FIRST_OGTT: "FBG >= 7 x 2, first OGTT<=11.1",
31
32
  CASE_FBGS_WITH_SECOND_OGTT: "FBG >= 7 x 2, second OGTT<=11.1",
32
33
  CASE_FBG_ONLY: "FBG >= 7 x 2, OGTT not considered",
33
- # CASE_FBG_VERY_HIGH: f"FBG>={FBG_BEYOND_THRESHOLD}",
34
+ CASE_FBG_VERY_HIGH: FBG_THRESHOLD_MET,
34
35
  CASE_EOS: EOS_DM_MET,
35
36
  }
@@ -52,7 +52,16 @@ def get_glucose_df(subject_identifiers: list[str] | None = None) -> pd.DataFrame
52
52
  how="left",
53
53
  )
54
54
 
55
- df_glucose = read_frame(Glucose.objects.all(), verbose=False).rename(
55
+ if subject_identifiers:
56
+ df_glucose = read_frame(
57
+ Glucose.objects.filter(subject_visit__subject_identifier__in=subject_identifiers),
58
+ verbose=False,
59
+ ).rename(columns={"subject_visit": "subject_visit_id", "fasting": "fasted"})
60
+ else:
61
+ df_glucose = read_frame(Glucose.objects.all(), verbose=False).rename(
62
+ columns={"subject_visit": "subject_visit_id", "fasting": "fasted"}
63
+ )
64
+ df_glucose = df_glucose.rename(
56
65
  columns={"subject_visit": "subject_visit_id", "fasting": "fasted"}
57
66
  )
58
67
  df_glucose["fasting_hrs"] = np.nan
@@ -6,7 +6,7 @@ from django.utils import timezone
6
6
 
7
7
  from ..constants import (
8
8
  CASE_EOS,
9
- CASE_FBG_ONLY,
9
+ CASE_FBG_VERY_HIGH,
10
10
  CASE_FBGS_WITH_FIRST_OGTT,
11
11
  CASE_FBGS_WITH_SECOND_OGTT,
12
12
  CASE_OGTT,
@@ -76,6 +76,7 @@ class GlucoseEndpointsByDate:
76
76
  CASE_OGTT,
77
77
  CASE_FBGS_WITH_FIRST_OGTT,
78
78
  CASE_FBGS_WITH_SECOND_OGTT,
79
+ CASE_FBG_VERY_HIGH,
79
80
  CASE_EOS,
80
81
  ]
81
82
  self.endpoint_cases = {k: v for k, v in endpoint_cases.items() if k in self.case_list}
@@ -96,7 +97,7 @@ class GlucoseEndpointsByDate:
96
97
 
97
98
  def run(self):
98
99
  self.process_by_ogtt_only()
99
- # self.process_by_fbg_only()
100
+ self.process_by_fbg_only()
100
101
  subject_identifiers_df = get_unique_subject_identifiers(self.df)
101
102
  for _, row in subject_identifiers_df.iterrows():
102
103
  subject_df = self.endpoint_cls(
@@ -111,10 +112,7 @@ class GlucoseEndpointsByDate:
111
112
  self.merge_with_final_endpoints()
112
113
 
113
114
  def process_by_fbg_only(self):
114
- """Flag subjects that met endpoint by hitting the absurd FBG
115
-
116
- Not used yet. Waiting for confirmation from Anu.
117
- """
115
+ """Flag subjects that meta endpoint by hitting the absurd FBG"""
118
116
  subject_endpoint_df = self.working_df.loc[
119
117
  (self.working_df["fbg_value"] >= self.fbg_beyond_threshold)
120
118
  # & (self.working_df["fasted"] == YES)
@@ -129,8 +127,8 @@ class GlucoseEndpointsByDate:
129
127
  if not subject_endpoint_df.empty:
130
128
  # flag the selected endpoint rows as endpoints
131
129
  subject_endpoint_df["endpoint"] = 1
132
- subject_endpoint_df["endpoint_label"] = self.endpoint_cases[CASE_OGTT]
133
- subject_endpoint_df["endpoint_type"] = CASE_FBG_ONLY
130
+ subject_endpoint_df["endpoint_label"] = self.endpoint_cases[CASE_FBG_VERY_HIGH]
131
+ subject_endpoint_df["endpoint_type"] = CASE_FBG_VERY_HIGH
134
132
  subject_endpoint_df["interval_in_days"] = np.nan
135
133
 
136
134
  # add back the others rows for these subjects
@@ -356,14 +354,19 @@ class GlucoseEndpointsByDate:
356
354
  model_cls = django_apps.get_model(model)
357
355
  if self.subject_identifiers:
358
356
  model_cls.objects.filter(subject_identifier__in=self.subject_identifiers).delete()
359
- df = (
360
- self.endpoint_only_df[
361
- self.endpoint_only_df["subject_identifier"].isin(self.subject_identifiers)
362
- ]
363
- .copy()
364
- .sort_values(by=["subject_identifier"])
365
- .reset_index(drop=True)
366
- )
357
+ if self.endpoint_only_df.empty:
358
+ df = pd.DataFrame()
359
+ else:
360
+ df = (
361
+ self.endpoint_only_df[
362
+ self.endpoint_only_df["subject_identifier"].isin(
363
+ self.subject_identifiers
364
+ )
365
+ ]
366
+ .copy()
367
+ .sort_values(by=["subject_identifier"])
368
+ .reset_index(drop=True)
369
+ )
367
370
  else:
368
371
  model_cls.objects.all().delete()
369
372
  created = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meta-edc
3
- Version: 1.3.0
3
+ Version: 1.4.1
4
4
  Summary: META Trial EDC (https://www.isrctn.com/ISRCTN76157257)
5
5
  Keywords: django,clinicedc,META EDC,EDC,clinical trials,META Trial,ISRCTN76157257
6
6
  Author: Erik van Widenfelt, Jonathan Willitts
@@ -15,12 +15,12 @@ Classifier: Intended Audience :: Science/Research
15
15
  Classifier: Operating System :: OS Independent
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
- Requires-Dist: clinicedc>=2.1.0
19
- Requires-Dist: edc-he>=1.4.0
20
- Requires-Dist: edc-microscopy>=1.4.0
18
+ Requires-Dist: clinicedc>=2.2.2
19
+ Requires-Dist: edc-he>=1.5.2
20
+ Requires-Dist: edc-microscopy>=1.4.2
21
21
  Requires-Dist: edc-mnsi>=1.4.0
22
- Requires-Dist: edc-phq9>=1.3.0
23
- Requires-Dist: edc-qol>=1.3.0
22
+ Requires-Dist: edc-phq9>=1.3.1
23
+ Requires-Dist: edc-qol>=1.4.0
24
24
  Requires-Python: >=3.12, <3.14
25
25
  Description-Content-Type: text/x-rst
26
26
 
@@ -88,8 +88,8 @@ Assuming you are logged into the account ``myaccount``:
88
88
  mkdir ~/edc && \
89
89
  cd ~/edc && \
90
90
  uv venv && \
91
- uv pip install -U meta-edc==1.2.9 && \
92
- wget https://raw.githubusercontent.com/meta-trial/meta-edc/1.2.9/manage.py && \
91
+ uv pip install -U meta-edc==1.4.0 && \
92
+ wget https://raw.githubusercontent.com/meta-trial/meta-edc/1.4.0/manage.py && \
93
93
  uv pip freeze | grep meta-edc
94
94
 
95
95
  Copy your ``.env`` file to ``~/.etc``.
@@ -139,7 +139,7 @@ From the above example:
139
139
 
140
140
  cd ~/edc && \
141
141
  uv venv --clear && \
142
- uv pip install -U meta-edc==1.2.9 && \
142
+ uv pip install -U meta-edc==1.4.0 && \
143
143
  wget -O manage.py https://raw.githubusercontent.com/meta-trial/meta-edc/1.1.10/manage.py && \
144
144
  uv pip freeze | grep meta-edc && \
145
145
  python manage.py check
@@ -82,15 +82,15 @@ meta_analytics/README.rst,sha256=TRjju_9l-FoV6YU9qBwlktJDjiK3yfvrSvMo7Rd4mc8,422
82
82
  meta_analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
83
  meta_analytics/constants.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
84
  meta_analytics/dataframes/__init__.py,sha256=naGZtYGJ8BW03XslsFPZe9VZ2fWuU9ew84BB_iBLWxo,1266
85
- meta_analytics/dataframes/constants.py,sha256=AyEbvPGjZ4IVIukutRk5puzcGYLvzDtct7uvdOIqDYE,899
85
+ meta_analytics/dataframes/constants.py,sha256=oA0a9N7RzYstXuZXWclUjrbsWvNQbv1F4P9lFGlNRRg,937
86
86
  meta_analytics/dataframes/get_eos_df.py,sha256=N_7A_Io3KCGj8mrMjUfYP7w6gi7_2Dx2RSG6orQTWp4,1226
87
- meta_analytics/dataframes/get_glucose_df.py,sha256=vr0NqJ9N93d24W1UagL6PRBcMWpsXuL_GORJnmLdKfM,5477
87
+ meta_analytics/dataframes/get_glucose_df.py,sha256=eGzA7dxh3igGZdNKvMfiH7maRl2IAngWiQp9Dx8FZHU,5884
88
88
  meta_analytics/dataframes/get_glucose_fbg_df.py,sha256=yAshgtc_R6Q41p5iA9n7a_W0llp1JRsnj3NGQE6kVRk,898
89
89
  meta_analytics/dataframes/get_glucose_fbg_ogtt_df.py,sha256=BfMU1sNj1a4dVOy7yKGESARpb3SNTFxLA-BVB5oZ14Q,657
90
90
  meta_analytics/dataframes/get_last_imp_visits_df.py,sha256=N5tL6gANDr_g5AuNVv_cEN4U-QktLxJUAJaUIW2MiWs,3818
91
91
  meta_analytics/dataframes/glucose_endpoints/__init__.py,sha256=C78zm7_ebYdAQBaldn7LpKlRHvK2ufdT7nFBGZdAMFw,163
92
92
  meta_analytics/dataframes/glucose_endpoints/endpoint_by_date.py,sha256=bgbvvkeDbId_F4FWWtzHHq5TZf-YZEIJjR_p7Kjzmcw,7361
93
- meta_analytics/dataframes/glucose_endpoints/glucose_endpoints_by_date.py,sha256=nxzfoBZGQbUSChBdRaTV6Jkm-Fu1WA75prAt6VtaNQE,16369
93
+ meta_analytics/dataframes/glucose_endpoints/glucose_endpoints_by_date.py,sha256=VBEHtAcfMOOJKmf3BRg-h4qjYwJxoUvFqjza9LRm-DA,16536
94
94
  meta_analytics/dataframes/screening/__init__.py,sha256=1SegmpN-ceginLsJUADqJzfhLVpAgBmMb53gnKRQsPw,176
95
95
  meta_analytics/dataframes/screening/get_glucose_tested_only_df.py,sha256=jW8eCT2Nu2nBLwcxVg6ftnBk1SbCejSpiURORmi3Aso,648
96
96
  meta_analytics/dataframes/screening/get_screening_df.py,sha256=OU-cLE3FH7cvHoXJxR6RiMS4VcWfOGzP7whlRZ7N3Qg,6153
@@ -480,7 +480,7 @@ meta_reports/admin/dbviews/unattended_three_in_row_admin.py,sha256=eTOK8nbUDXGk4
480
480
  meta_reports/admin/dbviews/unattended_two_in_row_admin.py,sha256=xaJJYYkKCyMFd2TvNWUEKU97libnJBjTHuxmJoatD4I,1062
481
481
  meta_reports/admin/endpoints_admin.py,sha256=AX_EQEINoknVkSnr8ciLTuHd6Oa2v-gp4Ninmhhp-p4,530
482
482
  meta_reports/admin/endpoints_all_admin.py,sha256=KVw25W033Fo88x5HQtlp4Ko-vrudICQWiAVefny8Dz8,475
483
- meta_reports/admin/last_imp_refill_admin.py,sha256=NqG7UAeTMZheOwzzrgBWKOjEnEr45YubwriyIDnlxj0,6553
483
+ meta_reports/admin/last_imp_refill_admin.py,sha256=J_SuoFRTDBu6Mu0qHTWW82EblZb5VimrxCuaAyUMBvw,6493
484
484
  meta_reports/admin/list_filters.py,sha256=9OMjrCLG6W-ticvT3HAnSGhJYr4lr-Qxs5aEJMVX2mE,898
485
485
  meta_reports/admin/modeladmin_mixins.py,sha256=ntX259X7xMDqWJ4NzRHeQC0hTqrRoyMxi8GPuOWlhjg,3446
486
486
  meta_reports/admin_site.py,sha256=xoA18u9f341iLxuuhUeSEwaP-r2j6NFO2iRnagL2KR8,169
@@ -1158,7 +1158,7 @@ meta_visit_schedule/visit_schedules/phase_three/schedule.py,sha256=LU1HRaV6o1UeK
1158
1158
  meta_visit_schedule/visit_schedules/phase_three/schedule_dm_referral.py,sha256=q12p5wXc2D7lSiJVBnoSQw8Q3vL6uDx1t3PuDJO-Z-U,1735
1159
1159
  meta_visit_schedule/visit_schedules/phase_three/schedule_pregnancy.py,sha256=bEpbpCX3vfZmnsqudr0z8PU5kiaX4ws1sO5Im98Mo28,1106
1160
1160
  meta_visit_schedule/visit_schedules/phase_three/visit_schedule.py,sha256=ak4qazeKlpIlvpqrK9hDDO0fwWuWyvb4Ec-JU31IJxc,654
1161
- meta_edc-1.3.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
1162
- meta_edc-1.3.0.dist-info/WHEEL,sha256=DpNsHFUm_gffZe1FgzmqwuqiuPC6Y-uBCzibcJcdupM,78
1163
- meta_edc-1.3.0.dist-info/METADATA,sha256=ECeSXe43ycOYmUCAsWI-OJHcUUtucdCrYHGyxbAbqwE,5131
1164
- meta_edc-1.3.0.dist-info/RECORD,,
1161
+ meta_edc-1.4.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
1162
+ meta_edc-1.4.1.dist-info/WHEEL,sha256=w4ZtLaDgMAZW2MMZZwtH8zENekoQYBCeullI-zsXJQk,78
1163
+ meta_edc-1.4.1.dist-info/METADATA,sha256=aat3YZPqv-YJUOu8NjiF13qhD7kaMXEklAOFAZdAlhs,5131
1164
+ meta_edc-1.4.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.8
2
+ Generator: uv 0.9.9
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -8,7 +8,6 @@ from django.utils.safestring import mark_safe
8
8
  from edc_model_admin.dashboard import ModelAdminDashboardMixin
9
9
  from edc_model_admin.list_filters import PastDateListFilter
10
10
  from edc_model_admin.mixins import TemplatesModelAdminMixin
11
- from edc_pdutils.actions import export_to_csv
12
11
  from edc_qareports.modeladmin_mixins import QaReportModelAdminMixin
13
12
  from edc_sites.admin import SiteModelAdminMixin
14
13
  from edc_sites.admin.list_filters import SiteListFilter
@@ -87,7 +86,7 @@ class LastImpRefillAdmin(
87
86
  render_to_string("meta_reports/last_imp_refill/changelist_note.html")
88
87
  ) # nosec B308, B703
89
88
 
90
- actions = (update_report, export_to_csv)
89
+ actions = (update_report,)
91
90
 
92
91
  list_display = (
93
92
  "dashboard",