From 1513cd2e29e8326538702af24f6e359d1fda9ee4 Mon Sep 17 00:00:00 2001 From: Valpan26 Date: Wed, 24 Jun 2026 23:41:53 +0200 Subject: [PATCH 1/2] create CG0060 based on specification --- Unpublished/NEW-RULE/negative/01/data/.env | 6 +++ .../NEW-RULE/negative/01/data/_datasets.csv | 3 ++ .../NEW-RULE/negative/01/data/_variables.csv | 41 ++++++++++++++ .../01/results/results_engine.log.txt | 4 ++ Unpublished/NEW-RULE/positive/01/data/.env | 6 +++ .../NEW-RULE/positive/01/data/_datasets.csv | 3 ++ .../NEW-RULE/positive/01/data/_variables.csv | 41 ++++++++++++++ .../01/results/results_engine.log.txt | 4 ++ Unpublished/NEW-RULE/rule.yml | 54 +++++++++++++++++++ 9 files changed, 162 insertions(+) create mode 100644 Unpublished/NEW-RULE/negative/01/data/.env create mode 100644 Unpublished/NEW-RULE/negative/01/data/_datasets.csv create mode 100644 Unpublished/NEW-RULE/negative/01/data/_variables.csv create mode 100644 Unpublished/NEW-RULE/negative/01/results/results_engine.log.txt create mode 100644 Unpublished/NEW-RULE/positive/01/data/.env create mode 100644 Unpublished/NEW-RULE/positive/01/data/_datasets.csv create mode 100644 Unpublished/NEW-RULE/positive/01/data/_variables.csv create mode 100644 Unpublished/NEW-RULE/positive/01/results/results_engine.log.txt create mode 100644 Unpublished/NEW-RULE/rule.yml diff --git a/Unpublished/NEW-RULE/negative/01/data/.env b/Unpublished/NEW-RULE/negative/01/data/.env new file mode 100644 index 000000000..8433142da --- /dev/null +++ b/Unpublished/NEW-RULE/negative/01/data/.env @@ -0,0 +1,6 @@ +PRODUCT= +VERSION= +SUBSTANDARD= +USE_CASE= +DEFINE_XML= +CT= diff --git a/Unpublished/NEW-RULE/negative/01/data/_datasets.csv b/Unpublished/NEW-RULE/negative/01/data/_datasets.csv new file mode 100644 index 000000000..581ee9dad --- /dev/null +++ b/Unpublished/NEW-RULE/negative/01/data/_datasets.csv @@ -0,0 +1,3 @@ +Filename,Label +pr,Procedures +ho,Healthcare Encounters diff --git a/Unpublished/NEW-RULE/negative/01/data/_variables.csv b/Unpublished/NEW-RULE/negative/01/data/_variables.csv new file mode 100644 index 000000000..6ee52de30 --- /dev/null +++ b/Unpublished/NEW-RULE/negative/01/data/_variables.csv @@ -0,0 +1,41 @@ +dataset,variable,label,type,length +pr,STUDYID,Study Identifier,Char,50 +pr,DOMAIN,Domain Abbreviation,Char,50 +pr,USUBJID,Unique Subject Identifier,Char,50 +pr,PRSEQ,Sequence Number,Num,8 +pr,PRSPID,Sponsor-Defined Identifier,Char,50 +pr,PRTRT,Reported Name of Procedure,Char,50 +pr,PRDECOD,Standardized Procedure Name,Char,50 +pr,PRCAT,Category,Char,50 +pr,PRPRESP,Pre-specified,Char,50 +pr,PROCCUR,Occurrence,Char,50 +pr,PRINDC,Indication,Char,50 +pr,VISITNUM,Visit Number,Num,8 +pr,VISIT,Visit Name,Char,50 +pr,VISITDY,Planned Study Day of Visit,Num,8 +pr,EPOCH,Epoch,Char,50 +pr,PRSTDTC,Start Date/Time of Procedure,Char,50 +pr,PRENDTC,End Date/Time of Procedure,Char,50 +pr,PRSTDY,Study Day of Start of Procedure,Num,8 +pr,PRENDY,Study Day of End of Procedure,Num,8 +pr,PRSTRTPT,Start Relative to Reference Time Point,Char,50 +pr,PRSTTPT,Start Reference Time Point,Char,50 +pr,PRENRTPT,End Relative to Reference Time Point,Char,50 +pr,PRENTPT,End Reference Time Point,Char,50 +ho,STUDYID,Study Identifier,Char,50 +ho,DOMAIN,Domain Abbreviation,Char,50 +ho,USUBJID,Unique Subject Identifier,Char,50 +ho,HOSEQ,Sequence Number,Num,8 +ho,HOGRPID,Group ID,Char,50 +ho,HOTERM,Healthcare Encounter Term,Char,50 +ho,HOPRESP,Pre-Specified Healthcare Encounter,Char,50 +ho,HOOCCUR,Healthcare Encounter Occurrence,Char,50 +ho,EPOCH,Epoch,Char,50 +ho,HOSTDTC,Start Date/Time of Healthcare Encounter,Char,50 +ho,HOENDTC,End Date/Time of Healthcare Encounter,Char,50 +ho,HOSTDY,Study Day of Start of Encounter,Num,8 +ho,HOENDY,Study Day of End of Healthcare Encounter,Num,8 +ho,HOSTRTPT,Start Relative to Reference Time Point,Char,50 +ho,HOSTTPT,Start Reference Time Point,Char,50 +ho,HOENRTPT,End Relative to Reference Time Point,Char,50 +ho,HOENTPT,End Reference Time Point,Char,50 diff --git a/Unpublished/NEW-RULE/negative/01/results/results_engine.log.txt b/Unpublished/NEW-RULE/negative/01/results/results_engine.log.txt new file mode 100644 index 000000000..adfc52a43 --- /dev/null +++ b/Unpublished/NEW-RULE/negative/01/results/results_engine.log.txt @@ -0,0 +1,4 @@ +Traceback (most recent call last): + File "C:\Users\valen\cdisc-open-rules-training\engine\core.py", line 18, in + import click +ModuleNotFoundError: No module named 'click' \ No newline at end of file diff --git a/Unpublished/NEW-RULE/positive/01/data/.env b/Unpublished/NEW-RULE/positive/01/data/.env new file mode 100644 index 000000000..0bcfc2f82 --- /dev/null +++ b/Unpublished/NEW-RULE/positive/01/data/.env @@ -0,0 +1,6 @@ +PRODUCT=SDTMIG +VERSION=3-4 +SUBSTANDARD= +USE_CASE= +DEFINE_XML= +CT= diff --git a/Unpublished/NEW-RULE/positive/01/data/_datasets.csv b/Unpublished/NEW-RULE/positive/01/data/_datasets.csv new file mode 100644 index 000000000..581ee9dad --- /dev/null +++ b/Unpublished/NEW-RULE/positive/01/data/_datasets.csv @@ -0,0 +1,3 @@ +Filename,Label +pr,Procedures +ho,Healthcare Encounters diff --git a/Unpublished/NEW-RULE/positive/01/data/_variables.csv b/Unpublished/NEW-RULE/positive/01/data/_variables.csv new file mode 100644 index 000000000..6ee52de30 --- /dev/null +++ b/Unpublished/NEW-RULE/positive/01/data/_variables.csv @@ -0,0 +1,41 @@ +dataset,variable,label,type,length +pr,STUDYID,Study Identifier,Char,50 +pr,DOMAIN,Domain Abbreviation,Char,50 +pr,USUBJID,Unique Subject Identifier,Char,50 +pr,PRSEQ,Sequence Number,Num,8 +pr,PRSPID,Sponsor-Defined Identifier,Char,50 +pr,PRTRT,Reported Name of Procedure,Char,50 +pr,PRDECOD,Standardized Procedure Name,Char,50 +pr,PRCAT,Category,Char,50 +pr,PRPRESP,Pre-specified,Char,50 +pr,PROCCUR,Occurrence,Char,50 +pr,PRINDC,Indication,Char,50 +pr,VISITNUM,Visit Number,Num,8 +pr,VISIT,Visit Name,Char,50 +pr,VISITDY,Planned Study Day of Visit,Num,8 +pr,EPOCH,Epoch,Char,50 +pr,PRSTDTC,Start Date/Time of Procedure,Char,50 +pr,PRENDTC,End Date/Time of Procedure,Char,50 +pr,PRSTDY,Study Day of Start of Procedure,Num,8 +pr,PRENDY,Study Day of End of Procedure,Num,8 +pr,PRSTRTPT,Start Relative to Reference Time Point,Char,50 +pr,PRSTTPT,Start Reference Time Point,Char,50 +pr,PRENRTPT,End Relative to Reference Time Point,Char,50 +pr,PRENTPT,End Reference Time Point,Char,50 +ho,STUDYID,Study Identifier,Char,50 +ho,DOMAIN,Domain Abbreviation,Char,50 +ho,USUBJID,Unique Subject Identifier,Char,50 +ho,HOSEQ,Sequence Number,Num,8 +ho,HOGRPID,Group ID,Char,50 +ho,HOTERM,Healthcare Encounter Term,Char,50 +ho,HOPRESP,Pre-Specified Healthcare Encounter,Char,50 +ho,HOOCCUR,Healthcare Encounter Occurrence,Char,50 +ho,EPOCH,Epoch,Char,50 +ho,HOSTDTC,Start Date/Time of Healthcare Encounter,Char,50 +ho,HOENDTC,End Date/Time of Healthcare Encounter,Char,50 +ho,HOSTDY,Study Day of Start of Encounter,Num,8 +ho,HOENDY,Study Day of End of Healthcare Encounter,Num,8 +ho,HOSTRTPT,Start Relative to Reference Time Point,Char,50 +ho,HOSTTPT,Start Reference Time Point,Char,50 +ho,HOENRTPT,End Relative to Reference Time Point,Char,50 +ho,HOENTPT,End Reference Time Point,Char,50 diff --git a/Unpublished/NEW-RULE/positive/01/results/results_engine.log.txt b/Unpublished/NEW-RULE/positive/01/results/results_engine.log.txt new file mode 100644 index 000000000..adfc52a43 --- /dev/null +++ b/Unpublished/NEW-RULE/positive/01/results/results_engine.log.txt @@ -0,0 +1,4 @@ +Traceback (most recent call last): + File "C:\Users\valen\cdisc-open-rules-training\engine\core.py", line 18, in + import click +ModuleNotFoundError: No module named 'click' \ No newline at end of file diff --git a/Unpublished/NEW-RULE/rule.yml b/Unpublished/NEW-RULE/rule.yml new file mode 100644 index 000000000..021e182b5 --- /dev/null +++ b/Unpublished/NEW-RULE/rule.yml @@ -0,0 +1,54 @@ +Authorities: + - Organization: 'CDISC' + Standards: + - Name: 'SDTMIG' + References: + - Citations: + - Cited Guidance: 'The characterization of the start of an observation relative to a reference time point. The sponsor-defined reference time point is in --STTPT.' + Document: 'Model v2.0' + Item: '--STRTPT' + Section: 'Timing' + Criteria: + Logical Expression: + Condition: '' + Rule: '' + Plain Language Expression: '' + Type: '' + Origin: 'SDTM AND SDTMIG Conformance Rules' + Release Notes: '' + Rule Identifier: + Id: 'CG060' + Version: '1' + Validator Rule Message: '' + Version: '2.0' + Version: '3.4' +Check: + all: + - operator: '' + name: 'STTPT' + value: 'present' + name: 'STRTPT' + value: 'not present' +Core: + Id: '' + Status: Draft + Version: '1' +Description: 'Raise an error if the value of --STTPT is present and--STRTPT is not present.' +Executability: Fully Executable +Operations: + - id: '' + operator: '' +Outcome: + Message: ' --STTPT is present but--STRTPT is not present' + Output Variables: + - '--STTPT' + - '--STRTPT' +Rule Type: 'record data' +Scope: + Classes: + Include: + - ALL + Domains: + Include: + - ALL +Sensitivity: 'Record-level' From 7ecd68dc764727bd76a3aa7f2569ee430d074b75 Mon Sep 17 00:00:00 2001 From: Valpan26 Date: Thu, 25 Jun 2026 00:49:23 +0200 Subject: [PATCH 2/2] create CG0060 based on specification --- .../01/results/results_engine.log.txt | 20 +++++++++++--- .../01/results/results_engine.log.txt | 20 +++++++++++--- Unpublished/NEW-RULE/rule.yml | 26 ++++++++----------- 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/Unpublished/NEW-RULE/negative/01/results/results_engine.log.txt b/Unpublished/NEW-RULE/negative/01/results/results_engine.log.txt index adfc52a43..0132568fe 100644 --- a/Unpublished/NEW-RULE/negative/01/results/results_engine.log.txt +++ b/Unpublished/NEW-RULE/negative/01/results/results_engine.log.txt @@ -1,4 +1,18 @@ Traceback (most recent call last): - File "C:\Users\valen\cdisc-open-rules-training\engine\core.py", line 18, in - import click -ModuleNotFoundError: No module named 'click' \ No newline at end of file + File "C:\Users\valen\cdisc-open-rules-training\engine\core.py", line 21, in + from cdisc_rules_engine.config import config + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\__init__.py", line 1, in + from .plugin_loader import PluginLoader + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\plugin_loader.py", line 9, in + from cdisc_rules_engine.interfaces import FactoryInterface + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\interfaces\__init__.py", line 4, in + from .data_reader_interface import DataReaderInterface + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\interfaces\data_reader_interface.py", line 1, in + from cdisc_rules_engine.models.dataset import PandasDataset + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\models\dataset\__init__.py", line 6, in + from .dask_dataset import DaskDataset + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\models\dataset\dask_dataset.py", line 1, in + from cdisc_rules_engine.models.dataset.pandas_dataset import PandasDataset + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\models\dataset\pandas_dataset.py", line 2, in + import pandas as pd +ModuleNotFoundError: No module named 'pandas' \ No newline at end of file diff --git a/Unpublished/NEW-RULE/positive/01/results/results_engine.log.txt b/Unpublished/NEW-RULE/positive/01/results/results_engine.log.txt index adfc52a43..0132568fe 100644 --- a/Unpublished/NEW-RULE/positive/01/results/results_engine.log.txt +++ b/Unpublished/NEW-RULE/positive/01/results/results_engine.log.txt @@ -1,4 +1,18 @@ Traceback (most recent call last): - File "C:\Users\valen\cdisc-open-rules-training\engine\core.py", line 18, in - import click -ModuleNotFoundError: No module named 'click' \ No newline at end of file + File "C:\Users\valen\cdisc-open-rules-training\engine\core.py", line 21, in + from cdisc_rules_engine.config import config + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\__init__.py", line 1, in + from .plugin_loader import PluginLoader + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\plugin_loader.py", line 9, in + from cdisc_rules_engine.interfaces import FactoryInterface + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\interfaces\__init__.py", line 4, in + from .data_reader_interface import DataReaderInterface + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\interfaces\data_reader_interface.py", line 1, in + from cdisc_rules_engine.models.dataset import PandasDataset + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\models\dataset\__init__.py", line 6, in + from .dask_dataset import DaskDataset + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\models\dataset\dask_dataset.py", line 1, in + from cdisc_rules_engine.models.dataset.pandas_dataset import PandasDataset + File "C:\Users\valen\cdisc-open-rules-training\engine\cdisc_rules_engine\models\dataset\pandas_dataset.py", line 2, in + import pandas as pd +ModuleNotFoundError: No module named 'pandas' \ No newline at end of file diff --git a/Unpublished/NEW-RULE/rule.yml b/Unpublished/NEW-RULE/rule.yml index 021e182b5..2c252a58f 100644 --- a/Unpublished/NEW-RULE/rule.yml +++ b/Unpublished/NEW-RULE/rule.yml @@ -13,37 +13,33 @@ Authorities: Condition: '' Rule: '' Plain Language Expression: '' - Type: '' - Origin: 'SDTM AND SDTMIG Conformance Rules' + Type: 'Success' + Origin: SDTM and SDTMIG Conformance Rules Release Notes: '' Rule Identifier: - Id: 'CG060' + Id: 'CG0060' Version: '1' Validator Rule Message: '' Version: '2.0' Version: '3.4' Check: all: - - operator: '' - name: 'STTPT' - value: 'present' - name: 'STRTPT' - value: 'not present' + - name: '--STTPT' + operator: 'non_empty' + - name: '--STRTPT' + operator: 'empty' Core: - Id: '' - Status: Draft + Id: 'CORE-000001' + Status: Published Version: '1' Description: 'Raise an error if the value of --STTPT is present and--STRTPT is not present.' Executability: Fully Executable -Operations: - - id: '' - operator: '' Outcome: Message: ' --STTPT is present but--STRTPT is not present' Output Variables: - '--STTPT' - '--STRTPT' -Rule Type: 'record data' +Rule Type: 'Record Data' Scope: Classes: Include: @@ -51,4 +47,4 @@ Scope: Domains: Include: - ALL -Sensitivity: 'Record-level' +Sensitivity: Dataset