You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix!: community models should not inherit from Statement / EvidenceLine (#22)
close#21
* Use model validator instead of inheriting from `Statement` or
`EvidenceLine`
* `VariantOncogenicityFunctionalImpactEvidenceLine` and
`VariantPathogenicityFunctionalImpactEvidenceLine` should NOT inherit
from `EvidenceLine`
* `VariantOncogenicityStudyStatement`, `VariantPathogenicityStatement`,
`VariantDiagnosticStudyStatement`, `VariantPrognosticStudyStatement`,
and `VariantTherapeuticResponseStudyStatement` should NOT inherit from
`Statement`
@@ -484,7 +489,7 @@ class EvidenceLine(InformationEntity, BaseModelForbidExtra):
484
489
description="The possible fact against which evidence items contained in an Evidence Line were collectively evaluated, in determining the overall strength and direction of support they provide. For example, in an ACMG Guideline-based assessment of variant pathogenicity, the support provided by distinct lines of evidence are assessed against a target proposition that the variant is pathogenic for a specific disease.",
err_msg="Unable to find valid model for `hasEvidenceItems`"
572
+
raiseValueError(err_msg)
568
573
returnevidence_items
569
574
570
575
@@ -580,9 +585,17 @@ class Statement(InformationEntity, BaseModelForbidExtra):
580
585
type: Literal["Statement"] =Field(
581
586
CoreType.STATEMENT.value, description=f"MUST be '{CoreType.STATEMENT.value}'."
582
587
)
583
-
proposition: Proposition=Field(
588
+
proposition: (
589
+
ExperimentalVariantFunctionalImpactProposition
590
+
|VariantDiagnosticProposition
591
+
|VariantOncogenicityProposition
592
+
|VariantPathogenicityProposition
593
+
|VariantPrognosticProposition
594
+
|VariantTherapeuticResponseProposition
595
+
) =Field(
584
596
...,
585
597
description="A possible fact, the validity of which is assessed and reported by the Statement. A Statement can put forth the proposition as being true, false, or uncertain, and may provide an assessment of the level of confidence/evidence supporting this claim.",
598
+
discriminator="type",
586
599
)
587
600
direction: Direction=Field(
588
601
...,
@@ -624,3 +637,70 @@ class StudyGroup(Entity, BaseModelForbidExtra):
624
637
None,
625
638
description="A feature or role shared by all members of the StudyGroup, representing a criterion for membership in the group.",
626
639
)
640
+
641
+
642
+
classStatementValidatorMixin:
643
+
"""Mixin class for reusable Statement model validators
644
+
645
+
Should be used with classes that inherit from Pydantic BaseModel
0 commit comments