cdisc-org / cdisc-org/cdisc-rules-engine

define_variable_data_type works a bit unexpectedly - Enhancement request

Open
#421 2 comments 0 reactions 0 assignees View on GitHub
Define-XML cross check
Dominant language
Python
Stars
113
Forks
43
Avg merge
14h 51m
Merged PRs (30d)
14

Description

I was a bit surprised how "define_variable_data_type" works. It looks as it can only have the values "Char" and "Num", i.e. that the define.xml data types have been matched towards SAS-XPT data types.
See https://github.com/cdisc-org/cdisc-rules-engine/blob/6da66eda3e5c53020f7c41b4b148fea894bcee24/cdisc_rules_engine/services/define_xml/base_define_xml_reader.py for the code.

This works well for the moment but has some limitations.
Define-XML itself does not have data types "Char" and "Num". The Define-XML data types are modern and are "text", "integer", "float", "date", "datetime", ... . See page 29 of the Define-XML 2.1 specification.

The current "define_variable_data_type" however does not allow us to validate whether e.g. a --DTC variable has been defined as either "date", "datetime", "partialDate", "partialDatetime" etc..
Therefore I propose to also have an additional property that returns the Define-XML real datatype, instead of the one matched to SAS-XPT. We can then have 2 properties, like:
- define_variable_data_type_XPT_matched (replacing the current define_variable_data_type)
- define_variable_data_type_intrinsic - returning the "real" Define-XML datatype

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.