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 DDF00032: If the cardinality of a relationship between any class and Code allows for more than one instance of code, the code values must be distinct. #139

Closed ASL-rmarshall closed 7 months ago

ASL-rmarshall commented 9 months ago

Create rule defined for #109

ASL-rmarshall commented 9 months ago

Updated rule id from DDF99986 to DDF00032.

ASL-rmarshall commented 9 months ago

@DianeWold This is now ready for review. I created test data as follows:

ASL-rmarshall commented 9 months ago

Note that the created rule does not implement the "If the cardinality of a relationship between any class and Code allows for more than one instance of code" part of the description - it runs across all instances of the Code class, regardless of the cardinality of the relationship from the parent class.

DianeWold commented 9 months ago

Negative and positive test data ran as described above.

BSnoeijerCD commented 9 months ago

@DianeWold @ASL-rmarshall I think the check description can be more precise as you check for reuse of codes within an instance of a class. That is ok but not reflected in the test description. Also the Negative tests as described above do not seem to resemble the check description as it also seems to check for the use of different coding systems. As, far as I understand the code only checks for duplicates within a unique combination of parent class, instance, attribute and codesystem used.

ASL-rmarshall commented 3 months ago

Saving a copy of the POC rule before overwriting for DDF4:

Authorities:
  - Organization: 'CDISC'
    Standards:
      - Name: USDM
        References:
          - Citations:
              - Cited Guidance: 'USDM'
                Document: 'USDM v2.6'
            Origin: USDM Conformance Rules
            Release Notes: ''
            Rule Identifier:
              Id: 'DDF00032'
              Version: '1'
            Validator Rule Message: ''
            Version: '1.0'
        Version: '3.0'
Check:
  all:
    - name: code
      operator: is_not_unique_set
      value:
        - parent_entity
        - parent_id
        - parent_rel
        - codeSystem
Core:
  Id: CORE-000424
  Status: Draft
  Version: '1'
Description: 'For any Class with a relationship to the Code class, the
  combinations of codeSystem and code related to the class through that
  relationship should be unique.'
Executability: Fully Executable
Outcome:
  Message: 'The combination of Code and CodeSystem for a set of instances of a
    relationship from a Class to the Code class includes duplicates'
  Output Variables:
    - parent_entity
    - parent_id
    - parent_rel
    - id
    - code
    - codeSystem
    - codeSystemVersion
    - decode
Rule Type: Record Data
Scope:
  Entities:
    Include:
      - Code
Sensitivity: Record