cdisc-org / ddf-core-poc

This repository will contain the results from the Proof of Concept project.
MIT License
0 stars 1 forks source link

Create rule DDF00034: If a BiomedicalConceptProperty is related to any ResponseCodes, then at least one response code should be enabled #146

Closed ASL-rmarshall closed 7 months ago

ASL-rmarshall commented 9 months ago

Create rule defined for #138

BSnoeijerCD commented 9 months ago

This rule has the same problem as 99912 and others. We like to check within a parent id and that requires a combination of different functions. Is the function present_on_multiple_rows giving a false result if there is no result and when the max number is achieved then that one would work. But that is not clear from the operator description. @ASL-rmarshall: did you already try that option?

BSnoeijerCD commented 9 months ago

Created rule with same logic as DDF00012 based on ResponseCode class and grouped parentIds. positive test data: 3 BCs -> 1 with 2 out of 4 response codes enabled -> 1 with 1 out of 4 response codes enabled -> 1 with 3 out of 3 response codes enabled negative test data: 2 BCs -> both with 4 response codes which are all not enabled.

DianeWold commented 9 months ago

Ran the test data. The negative test data returned an error for each record, similarly to the way DDF00012 returns as error for each record, rather than each group of errors. The positive data returned no errors.

ASL-rmarshall commented 2 days ago

Saving a copy of the POC rule definition before deleting for DDF 4:

Authorities:
  - Organization: 'CDISC'
    Standards:
      - Name: USDM
        References:
          - Citations:
              - Cited Guidance: 'USDM'
                Document: 'USDM v2.6'
            Origin: USDM Conformance Rules
            Release Notes: ''
            Rule Identifier:
              Id: 'DDF00034'
              Version: '1'
            Validator Rule Message: ''
            Version: '1.0'
        Version: '3.0'
Check:
  all:
    - name: $st_parent_id
      operator: does_not_contain
      value: true
      value_is_literal: true

Core:
  Id: CORE-000426
  Status: Draft
  Version: '1'
Description: 'If a BiomedicalConceptProperty is related to any ResponseCodes,
  then at least one response code should be enabled.'
Executability: Fully Executable
Operations:
  - group:
      - parent_id
    id: $st_parent_id
    name: isEnabled
    operator: distinct
Outcome:
  Message: 'A BiomedicalConceptProperty is linked to one or more ResponseCodes,
    but no ResponseCode is enabled.'
  Output Variables:
    - parent_entity
    - parent_rel
    - parent_id
    - id
    - isEnabled
    - code.code
    - code.decode
Rule Type: Record Data
Scope:

  Entities:
    Include:
      - ResponseCode

Sensitivity: Record