We need to check for 1-to-1 relationships between the following pairs of variables:
name and description
name and label
name and text
However, the requirement for a 1-to-1 relationship is usually within the scope of a parent entity/class. For example, it would be acceptable for the same name value to be associated with different description values for StudyArm, StudyEpoch, StudyElement, etc. if the combinations appeared within different instances of the parent StudyDesign class.
At the moment, the is_unique_relationship and is_not_unique_relationship operators check for unique relationships within the whole dataset. In order to support checking of unique relationships within an instance of a parent class, the operators should be updated to support use of the within parameter. The within parameter should accept a list of 1 or more variable names, which (if present) would then be used to group the input dataset (e.g., using groupby) before checking for unique relationships. For example, the following would check for non-unique relationship of name and description within parent_id:
We need to check for 1-to-1 relationships between the following pairs of variables:
name
anddescription
name
andlabel
name
andtext
However, the requirement for a 1-to-1 relationship is usually within the scope of a parent entity/class. For example, it would be acceptable for the same
name
value to be associated with differentdescription
values forStudyArm
,StudyEpoch
,StudyElement
, etc. if the combinations appeared within different instances of the parentStudyDesign
class.At the moment, the
is_unique_relationship
andis_not_unique_relationship
operators check for unique relationships within the whole dataset. In order to support checking of unique relationships within an instance of a parent class, the operators should be updated to support use of thewithin
parameter. Thewithin
parameter should accept a list of 1 or more variable names, which (if present) would then be used to group the input dataset (e.g., usinggroupby
) before checking for unique relationships. For example, the following would check for non-unique relationship ofname
anddescription
withinparent_id
: