Skip to content

does_not_contain operator fails when target is a group-based distinct collection #1760

Description

@PolinaVyniavska

Standard

FDA BR SDTM, CDISC SDTM/SDTMIG

Reference Rule ID(s)

CG0067/FB0614

Conformance Rule ID(s) (if published in CORE)

CORE-000251

JIRA Ticket

https://jira.cdisc.org/projects/CORERULES/issues/CORERULES-

CLI Command Used (if applicable)

python core.py -s SDTM -v 3.4 -d /path/to/datasets

Rule YAML

# Variable: DSDECOD
# Condition: SS.SSSTRESC = 'DEAD'
# Rule: DSDECOD = 'DEATH'
Authorities:
  - Organization: CDISC
    Standards:
      - Name: SDTMIG
        References:
          - Citations:
              - Cited Guidance: For example, if a subject's survival status is "DEAD", the date
                  of death must be stored in DM and within a final disposition
                  record in DS.
                Document: SDTMIG v3.4
                Item: Assumption 1
                Section: 6.3.11
            Origin: SDTM and SDTMIG Conformance Rules
            Rule Identifier:
              Id: CG0067
              Version: '1'
            Version: '2.0'
        Version: '3.4'
      - Name: SDTMIG
        References:
          - Citations:
              - Cited Guidance: For example, if a subject's Survival Status is "DEAD", the date
                  of death must be stored in DM and within a final disposition
                  record in DS.
                Document: SDTMIG v3.3
                Item: Assumption 1
                Section: 6.3.15
            Origin: SDTM and SDTMIG Conformance Rules
            Rule Identifier:
              Id: CG0067
              Version: '1'
            Version: '2.0'
        Version: '3.3'
      - Name: SDTMIG
        References:
          - Citations:
              - Cited Guidance: For example, if a subject's Survival Status is "DEAD", the date
                  of death must be stored in DM and within a final disposition
                  record in DS.
                Document: SDTMIG v3.2
                Item: Assumption 2
                Section: '6.3'
            Origin: SDTM and SDTMIG Conformance Rules
            Rule Identifier:
              Id: CG0067
              Version: '1'
            Version: '2.0'
        Version: '3.2'
  #CG0067 is identical to rule FB0614. Added metadata for FB0614 by Malini Narreddy on 2025-03-07
  - Organization: FDA
    Standards:
      - Name: SDTMIG
        References:
          - Citations:
              - Cited Guidance: All death information should be populated for subjects that died
                  during the study including any post treatment follow-up.
                Document: FDA
                Section: FDAB006
            Origin: FDA Business Rules
            Rule Identifier:
              Id: FB0614
              Version: '1'
            Version: '1.5'
        Version: '3.2'
      - Name: SDTMIG
        References:
          - Citations:
              - Cited Guidance: All death information should be populated for subjects that died
                  during the study including any post treatment follow-up.
                Document: FDA
                Section: FDAB006
            Origin: FDA Business Rules
            Rule Identifier:
              Id: FB0614
              Version: '1'
            Version: '1.5'
        Version: '3.3'
      - Name: SDTMIG
        References:
          - Citations:
              - Cited Guidance: All death information should be populated for subjects that died
                  during the study including any post treatment follow-up.
                Document: FDA
                Section: FDAB006
            Origin: FDA Business Rules
            Rule Identifier:
              Id: FB0614
              Version: '1'
            Version: '1.5'
        Version: '3.4'
Check:
  all:
    - name: SSSTRESC
      operator: equal_to
      value: DEAD
      value_is_literal: true
    - name: $ds_dsdecod
      operator: does_not_contain
      value: DEATH
      value_is_literal: true
Core:
  Id: CORE-000251
  Status: Published
  Version: '1'
Description: When SS.SSSTRESC = "DEAD", the final disposition record must have
  DSDECOD ^= "DEATH".
Executability: Fully Executable
Operations:
  - domain: DS
    group:
      - USUBJID
    id: $ds_dsdecod
    name: DSDECOD
    operator: distinct
Outcome:
  Message: DSDECOD is not "DEATH", When SS.SSSTRESC = "DEAD".
  Output Variables:
    - SSSTRESC
    - $ds_dsdecod
Rule Type: Record Data
Scope:
  Classes:
    Include:
      - FINDINGS
  Domains:
    Include:
      - SS
Sensitivity: Record

Attach any sample test data file(s)

unit-test-coreid-CG0067-negative.xlsx

Attach any output report and/or log file(s)

results.txt

Expected output

results.txt

Any Additional Information

To get the provided expected output

Changed from:
return self._handle_target_is_collection(target, comparator)

To:
return self._handle_target_is_collection(target, comparator,
value_is_literal)

in

engine/cdisc_rules_engine/check_operators/sql/contains_operator.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions