Commit 455f6e7d authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

replace some PK test result values with booleans for availability

- Area under curve (ng.mL-1.hr)
- Clearance (mL/hr)
- Maximal concentration (ng/mL)
- Volume distribution (Vd)

become availabilities
FIX #215
parent 0c9a6c16
Pipeline #29538 passed with stages
in 13 minutes and 42 seconds
......@@ -1716,15 +1716,15 @@ class TestsForm(forms.Form):
pkRes_tolerated = forms.ChoiceField(
label="Tolerated", widget=forms.TextInput(), required=False
)
pkRes_auc = forms.IntegerField(label="AUC", initial=1, required=False)
pkRes_clearance = forms.DecimalField(label="Clearance", required=False)
pkRes_cmax = forms.DecimalField(label="C max", required=False)
pkRes_auc_av = forms.BooleanField(label="AUC available", initial=1, required=False)
pkRes_clearance_av = forms.BooleanField(label="Clearance available", required=False)
pkRes_cmax_av = forms.BooleanField(label="Maximal concentration available", required=False)
pkRes_oral_bioavailability = forms.IntegerField(
label="Oral bio-availability", initial=1, required=False
)
pkRes_t_demi = forms.IntegerField(label="T 1/2", initial=1, required=False)
pkRes_t_max = forms.IntegerField(label="T max", initial=1, required=False)
pkRes_voldistribution = forms.DecimalField(label="Voldistribution", required=False)
pkRes_voldistribution_av = forms.BooleanField(label="Volume distribution (Vd) available", required=False)
UNIT_CONCENTRATION = (("micro", "µM"), ("nano", "nM"), ("pico", "pM"))
......
# Generated by Django 2.2.1 on 2020-04-30 19:15
from django.db import migrations, models
def fill_pkresult_avail_values(apps, schema_editor):
CompoundPKResult = apps.get_model("ippidb", "CompoundPKResult")
for cpr in CompoundPKResult.objects.all():
cpr.auc_av = cpr.auc is not None
cpr.clearance_av = cpr.clearance is not None
cpr.c_max_av = cpr.c_max is not None
cpr.voldistribution_av = cpr.voldistribution is not None
cpr.save()
class Migration(migrations.Migration):
dependencies = [
('ippidb', '0057_auto_20200430_0740'),
]
operations = [
migrations.AddField(
model_name='compoundpkresult',
name='auc_av',
field=models.BooleanField(default=False, verbose_name='Area under curve available'),
preserve_default=False,
),
migrations.AddField(
model_name='compoundpkresult',
name='c_max_av',
field=models.BooleanField(default=False, verbose_name='Maximal concentration available'),
preserve_default=False,
),
migrations.AddField(
model_name='compoundpkresult',
name='clearance_av',
field=models.BooleanField(default=False, verbose_name='Clearance available'),
preserve_default=False,
),
migrations.AddField(
model_name='compoundpkresult',
name='voldistribution_av',
field=models.BooleanField(default=False, verbose_name='Volume distribution (Vd)'),
preserve_default=False,
),
migrations.RunPython(fill_pkresult_avail_values),
]
# Generated by Django 2.2.1 on 2020-04-30 19:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ippidb', '0058_auto_20200430_1915'),
]
operations = [
migrations.RemoveField(
model_name='compoundpkresult',
name='auc',
),
migrations.RemoveField(
model_name='compoundpkresult',
name='c_max',
),
migrations.RemoveField(
model_name='compoundpkresult',
name='clearance',
),
migrations.RemoveField(
model_name='compoundpkresult',
name='voldistribution',
),
]
......@@ -1262,28 +1262,20 @@ class CompoundPKResult(models.Model):
compound = models.ForeignKey(Compound, models.CASCADE)
test_pk_description = models.ForeignKey(TestPKDescription, models.CASCADE)
tolerated = models.NullBooleanField("Tolerated", null=True)
auc = models.IntegerField("Area under curve (ng.mL-1.hr)", blank=True, null=True)
clearance = models.DecimalField(
"Clearance (mL/hr)", max_digits=7, decimal_places=3, blank=True, null=True
)
c_max = models.DecimalField(
"Maximal concentration (ng/mL)",
max_digits=7,
decimal_places=3,
blank=True,
null=True,
)
oral_bioavailability = models.IntegerField(
"Oral Bioavailability (%F)", blank=True, null=True
)
t_demi = models.IntegerField("t½ (mn)", blank=True, null=True)
t_max = models.IntegerField("tmax (mn)", blank=True, null=True)
voldistribution = models.DecimalField(
"Volume distribution (Vd)",
max_digits=5,
decimal_places=2,
blank=True,
null=True,
auc_av = models.BooleanField("Area under curve available")
clearance_av = models.BooleanField(
"Clearance available"
)
c_max_av = models.BooleanField(
"Maximal concentration available"
)
voldistribution_av = models.BooleanField(
"Volume distribution (Vd) available"
)
class Meta:
......
......@@ -52,15 +52,15 @@ pharmacokinetic: true
pharmacokinetic_tests:
- administration_mode: IV
compound_pk_results:
- auc: '1'
c_max: '5.2'
clearance: '1.2'
- auc_av: True
c_max_av: True
clearance_av: True
compound_name: toto
oral_bioavailability: '22'
t_demi: '5'
t_max: '5'
tolerated: 'True'
voldistribution: '5.5'
voldistribution_av: True
concentration: '1.2'
dose: '3.5'
dose_interval: '2'
......
......@@ -43,15 +43,15 @@ pharmacokinetic: true
pharmacokinetic_tests:
- administration_mode: IV
compound_pk_results:
- auc: '1'
c_max: '5.2'
clearance: '1.2'
- auc_av: False
c_max_av: True
clearance_av: '1.2'
compound_name: toto
oral_bioavailability: '22'
t_demi: '5'
t_max: '5'
tolerated: 'True'
voldistribution: '5.5'
voldistribution_av: '5.5'
dose: '3.5'
organism: 1
test_name: test
......
......@@ -467,15 +467,15 @@ class ContributionE2ETestCase(TestCase):
data[
f"{idx}-compoundpkresult_set-pk-results-{nidx}-tolerated"
] = result["tolerated"]
data[f"{idx}-compoundpkresult_set-pk-results-{nidx}-auc"] = result[
"auc"
data[f"{idx}-compoundpkresult_set-pk-results-{nidx}-auc_av"] = result[
"auc_av"
]
data[
f"{idx}-compoundpkresult_set-pk-results-{nidx}-clearance"
] = result["clearance"]
f"{idx}-compoundpkresult_set-pk-results-{nidx}-clearance_av"
] = result["clearance_av"]
data[
f"{idx}-compoundpkresult_set-pk-results-{nidx}-c_max"
] = result["c_max"]
f"{idx}-compoundpkresult_set-pk-results-{nidx}-c_max_av"
] = result["c_max_av"]
data[
f"{idx}-compoundpkresult_set-pk-results-{nidx}-oral_bioavailability"
] = result["oral_bioavailability"]
......@@ -486,8 +486,8 @@ class ContributionE2ETestCase(TestCase):
f"{idx}-compoundpkresult_set-pk-results-{nidx}-t_max"
] = result["t_max"]
data[
f"{idx}-compoundpkresult_set-pk-results-{nidx}-voldistribution"
] = result["voldistribution"]
f"{idx}-compoundpkresult_set-pk-results-{nidx}-voldistribution_av"
] = result["voldistribution_av"]
data[
f"{idx}-compoundpkresult_set-pk-results-{nidx}-compound_name"
] = result["compound_name"]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment