From 4f90029ddc36132acabe4606a8ecf2f5ad3ae0e9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sun, 10 May 2026 23:12:10 -0300 Subject: [PATCH 1/3] Adding tests to ensure different encoding support --- tests/resources/CoreIssue1023/ae_cp1252.json | 319 ++++++++++++++++++ tests/resources/CoreIssue1023/ae_latin1.json | 319 ++++++++++++++++++ tests/resources/CoreIssue1023/ae_utf8.json | 319 ++++++++++++++++++ tests/unit/test_report_encoding.py | 147 ++++++++ .../test_reporting/test_report_encoding.py | 76 +++++ 5 files changed, 1180 insertions(+) create mode 100644 tests/resources/CoreIssue1023/ae_cp1252.json create mode 100644 tests/resources/CoreIssue1023/ae_latin1.json create mode 100644 tests/resources/CoreIssue1023/ae_utf8.json create mode 100644 tests/unit/test_report_encoding.py create mode 100644 tests/unit/test_services/test_reporting/test_report_encoding.py diff --git a/tests/resources/CoreIssue1023/ae_cp1252.json b/tests/resources/CoreIssue1023/ae_cp1252.json new file mode 100644 index 000000000..803d478c8 --- /dev/null +++ b/tests/resources/CoreIssue1023/ae_cp1252.json @@ -0,0 +1,319 @@ +{ + "datasetJSONCreationDateTime": "2024-11-11T15:09:14", + "datasetJSONVersion": "1.1.0", + "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", + "dbLastModifiedDateTime": "2020-08-21T09:14:28", + "originator": "CDISC SDTM MSG Team", + "sourceSystem": { + "name": "SAS on X64_10PRO", + "version": "9.0401M7" + }, + "studyOID": "cdisc.com/CDISCPILOT01", + "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", + "metaDataRef": "define.xml", + "itemGroupOID": "IG.AE", + "records": 1, + "name": "AE", + "label": "Adverse Events", + "columns": [ + { + "itemOID": "IT.AE.STUDYID", + "name": "STUDYID", + "label": "Study Identifier", + "dataType": "string", + "length": 12, + "keySequence": 1 + }, + { + "itemOID": "IT.AE.DOMAIN", + "name": "DOMAIN", + "label": "Domain Abbreviation", + "dataType": "string", + "length": 2 + }, + { + "itemOID": "IT.AE.USUBJID", + "name": "USUBJID", + "label": "Unique Subject Identifier", + "dataType": "string", + "length": 8, + "keySequence": 2 + }, + { + "itemOID": "IT.AE.AESEQ", + "name": "AESEQ", + "label": "Sequence Number", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AELNKID", + "name": "AELNKID", + "label": "Link ID", + "dataType": "string", + "length": 50, + "keySequence": 5 + }, + { + "itemOID": "IT.AE.AETERM", + "name": "AETERM", + "label": "Reported Term for the Adverse Event", + "dataType": "string", + "length": 200 + }, + { + "itemOID": "IT.AE.AELLT", + "name": "AELLT", + "label": "Lowest Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AELLTCD", + "name": "AELLTCD", + "label": "Lowest Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEDECOD", + "name": "AEDECOD", + "label": "Dictionary-Derived Term", + "dataType": "string", + "length": 1, + "keySequence": 3 + }, + { + "itemOID": "IT.AE.AEPTCD", + "name": "AEPTCD", + "label": "Preferred Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLT", + "name": "AEHLT", + "label": "High Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLTCD", + "name": "AEHLTCD", + "label": "High Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGT", + "name": "AEHLGT", + "label": "High Level Group Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGTCD", + "name": "AEHLGTCD", + "label": "High Level Group Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBODSYS", + "name": "AEBODSYS", + "label": "Body System or Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBDSYCD", + "name": "AEBDSYCD", + "label": "Body System or Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOC", + "name": "AESOC", + "label": "Primary System Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOCCD", + "name": "AESOCCD", + "label": "Primary System Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESEV", + "name": "AESEV", + "label": "Severity/Intensity", + "dataType": "string", + "length": 8 + }, + { + "itemOID": "IT.AE.AESER", + "name": "AESER", + "label": "Serious Event", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEACN", + "name": "AEACN", + "label": "Action Taken with Study Treatment", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEREL", + "name": "AEREL", + "label": "Causality", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEOUT", + "name": "AEOUT", + "label": "Outcome of Adverse Event", + "dataType": "string", + "length": 32 + }, + { + "itemOID": "IT.AE.AESCAN", + "name": "AESCAN", + "label": "Involves Cancer", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESCONG", + "name": "AESCONG", + "label": "Congenital Anomaly or Birth Defect", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDISAB", + "name": "AESDISAB", + "label": "Persist or Signif Disability/Incapacity", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDTH", + "name": "AESDTH", + "label": "Results in Death", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESHOSP", + "name": "AESHOSP", + "label": "Requires or Prolongs Hospitalization", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESLIFE", + "name": "AESLIFE", + "label": "Is Life Threatening", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOD", + "name": "AESOD", + "label": "Occurred with Overdose", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.EPOCH", + "name": "EPOCH", + "label": "Epoch", + "dataType": "string", + "length": 9 + }, + { + "itemOID": "IT.AE.AESTDTC", + "name": "AESTDTC", + "label": "Start Date/Time of Adverse Event", + "dataType": "date", + "keySequence": 4 + }, + { + "itemOID": "IT.AE.AEENDTC", + "name": "AEENDTC", + "label": "End Date/Time of Adverse Event", + "dataType": "date" + }, + { + "itemOID": "IT.AE.AESTDY", + "name": "AESTDY", + "label": "Study Day of Start of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENDY", + "name": "AEENDY", + "label": "Study Day of End of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENRTPT", + "name": "AEENRTPT", + "label": "End Relative to Reference Time Point", + "dataType": "string", + "length": 7 + }, + { + "itemOID": "IT.AE.AEENTPT", + "name": "AEENTPT", + "label": "End Reference Time Point", + "dataType": "date" + } + ], + "rows": [ + [ + "CDISCPILOT01", + "AE", + "cp1252:€", + 9, + "9", + "SUDDEN DEATH", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "SEVERE", + "Y", + "DRUG WITHDRAWN", + "NOT RELATED", + "FATAL", + "N", + "N", + "N", + "Y", + "N", + "Y", + "N", + "TREATMENT", + "2013-01-14", + "2013-01-14", + 61, + 61, + "", + "" + ] + ] +} diff --git a/tests/resources/CoreIssue1023/ae_latin1.json b/tests/resources/CoreIssue1023/ae_latin1.json new file mode 100644 index 000000000..2148ef8da --- /dev/null +++ b/tests/resources/CoreIssue1023/ae_latin1.json @@ -0,0 +1,319 @@ +{ + "datasetJSONCreationDateTime": "2024-11-11T15:09:14", + "datasetJSONVersion": "1.1.0", + "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", + "dbLastModifiedDateTime": "2020-08-21T09:14:28", + "originator": "CDISC SDTM MSG Team", + "sourceSystem": { + "name": "SAS on X64_10PRO", + "version": "9.0401M7" + }, + "studyOID": "cdisc.com/CDISCPILOT01", + "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", + "metaDataRef": "define.xml", + "itemGroupOID": "IG.AE", + "records": 1, + "name": "AE", + "label": "Adverse Events", + "columns": [ + { + "itemOID": "IT.AE.STUDYID", + "name": "STUDYID", + "label": "Study Identifier", + "dataType": "string", + "length": 12, + "keySequence": 1 + }, + { + "itemOID": "IT.AE.DOMAIN", + "name": "DOMAIN", + "label": "Domain Abbreviation", + "dataType": "string", + "length": 2 + }, + { + "itemOID": "IT.AE.USUBJID", + "name": "USUBJID", + "label": "Unique Subject Identifier", + "dataType": "string", + "length": 8, + "keySequence": 2 + }, + { + "itemOID": "IT.AE.AESEQ", + "name": "AESEQ", + "label": "Sequence Number", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AELNKID", + "name": "AELNKID", + "label": "Link ID", + "dataType": "string", + "length": 50, + "keySequence": 5 + }, + { + "itemOID": "IT.AE.AETERM", + "name": "AETERM", + "label": "Reported Term for the Adverse Event", + "dataType": "string", + "length": 200 + }, + { + "itemOID": "IT.AE.AELLT", + "name": "AELLT", + "label": "Lowest Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AELLTCD", + "name": "AELLTCD", + "label": "Lowest Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEDECOD", + "name": "AEDECOD", + "label": "Dictionary-Derived Term", + "dataType": "string", + "length": 1, + "keySequence": 3 + }, + { + "itemOID": "IT.AE.AEPTCD", + "name": "AEPTCD", + "label": "Preferred Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLT", + "name": "AEHLT", + "label": "High Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLTCD", + "name": "AEHLTCD", + "label": "High Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGT", + "name": "AEHLGT", + "label": "High Level Group Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGTCD", + "name": "AEHLGTCD", + "label": "High Level Group Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBODSYS", + "name": "AEBODSYS", + "label": "Body System or Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBDSYCD", + "name": "AEBDSYCD", + "label": "Body System or Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOC", + "name": "AESOC", + "label": "Primary System Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOCCD", + "name": "AESOCCD", + "label": "Primary System Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESEV", + "name": "AESEV", + "label": "Severity/Intensity", + "dataType": "string", + "length": 8 + }, + { + "itemOID": "IT.AE.AESER", + "name": "AESER", + "label": "Serious Event", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEACN", + "name": "AEACN", + "label": "Action Taken with Study Treatment", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEREL", + "name": "AEREL", + "label": "Causality", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEOUT", + "name": "AEOUT", + "label": "Outcome of Adverse Event", + "dataType": "string", + "length": 32 + }, + { + "itemOID": "IT.AE.AESCAN", + "name": "AESCAN", + "label": "Involves Cancer", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESCONG", + "name": "AESCONG", + "label": "Congenital Anomaly or Birth Defect", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDISAB", + "name": "AESDISAB", + "label": "Persist or Signif Disability/Incapacity", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDTH", + "name": "AESDTH", + "label": "Results in Death", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESHOSP", + "name": "AESHOSP", + "label": "Requires or Prolongs Hospitalization", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESLIFE", + "name": "AESLIFE", + "label": "Is Life Threatening", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOD", + "name": "AESOD", + "label": "Occurred with Overdose", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.EPOCH", + "name": "EPOCH", + "label": "Epoch", + "dataType": "string", + "length": 9 + }, + { + "itemOID": "IT.AE.AESTDTC", + "name": "AESTDTC", + "label": "Start Date/Time of Adverse Event", + "dataType": "date", + "keySequence": 4 + }, + { + "itemOID": "IT.AE.AEENDTC", + "name": "AEENDTC", + "label": "End Date/Time of Adverse Event", + "dataType": "date" + }, + { + "itemOID": "IT.AE.AESTDY", + "name": "AESTDY", + "label": "Study Day of Start of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENDY", + "name": "AEENDY", + "label": "Study Day of End of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENRTPT", + "name": "AEENRTPT", + "label": "End Relative to Reference Time Point", + "dataType": "string", + "length": 7 + }, + { + "itemOID": "IT.AE.AEENTPT", + "name": "AEENTPT", + "label": "End Reference Time Point", + "dataType": "date" + } + ], + "rows": [ + [ + "CDISCPILOT01", + "AE", + "latin1:΅", + 9, + "9", + "SUDDEN DEATH", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "SEVERE", + "Y", + "DRUG WITHDRAWN", + "NOT RELATED", + "FATAL", + "N", + "N", + "N", + "Y", + "N", + "Y", + "N", + "TREATMENT", + "2013-01-14", + "2013-01-14", + 61, + 61, + "", + "" + ] + ] +} diff --git a/tests/resources/CoreIssue1023/ae_utf8.json b/tests/resources/CoreIssue1023/ae_utf8.json new file mode 100644 index 000000000..547428f66 --- /dev/null +++ b/tests/resources/CoreIssue1023/ae_utf8.json @@ -0,0 +1,319 @@ +{ + "datasetJSONCreationDateTime": "2024-11-11T15:09:14", + "datasetJSONVersion": "1.1.0", + "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", + "dbLastModifiedDateTime": "2020-08-21T09:14:28", + "originator": "CDISC SDTM MSG Team", + "sourceSystem": { + "name": "SAS on X64_10PRO", + "version": "9.0401M7" + }, + "studyOID": "cdisc.com/CDISCPILOT01", + "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", + "metaDataRef": "define.xml", + "itemGroupOID": "IG.AE", + "records": 1, + "name": "AE", + "label": "Adverse Events", + "columns": [ + { + "itemOID": "IT.AE.STUDYID", + "name": "STUDYID", + "label": "Study Identifier", + "dataType": "string", + "length": 12, + "keySequence": 1 + }, + { + "itemOID": "IT.AE.DOMAIN", + "name": "DOMAIN", + "label": "Domain Abbreviation", + "dataType": "string", + "length": 2 + }, + { + "itemOID": "IT.AE.USUBJID", + "name": "USUBJID", + "label": "Unique Subject Identifier", + "dataType": "string", + "length": 8, + "keySequence": 2 + }, + { + "itemOID": "IT.AE.AESEQ", + "name": "AESEQ", + "label": "Sequence Number", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AELNKID", + "name": "AELNKID", + "label": "Link ID", + "dataType": "string", + "length": 50, + "keySequence": 5 + }, + { + "itemOID": "IT.AE.AETERM", + "name": "AETERM", + "label": "Reported Term for the Adverse Event", + "dataType": "string", + "length": 200 + }, + { + "itemOID": "IT.AE.AELLT", + "name": "AELLT", + "label": "Lowest Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AELLTCD", + "name": "AELLTCD", + "label": "Lowest Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEDECOD", + "name": "AEDECOD", + "label": "Dictionary-Derived Term", + "dataType": "string", + "length": 1, + "keySequence": 3 + }, + { + "itemOID": "IT.AE.AEPTCD", + "name": "AEPTCD", + "label": "Preferred Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLT", + "name": "AEHLT", + "label": "High Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLTCD", + "name": "AEHLTCD", + "label": "High Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGT", + "name": "AEHLGT", + "label": "High Level Group Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGTCD", + "name": "AEHLGTCD", + "label": "High Level Group Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBODSYS", + "name": "AEBODSYS", + "label": "Body System or Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBDSYCD", + "name": "AEBDSYCD", + "label": "Body System or Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOC", + "name": "AESOC", + "label": "Primary System Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOCCD", + "name": "AESOCCD", + "label": "Primary System Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESEV", + "name": "AESEV", + "label": "Severity/Intensity", + "dataType": "string", + "length": 8 + }, + { + "itemOID": "IT.AE.AESER", + "name": "AESER", + "label": "Serious Event", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEACN", + "name": "AEACN", + "label": "Action Taken with Study Treatment", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEREL", + "name": "AEREL", + "label": "Causality", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEOUT", + "name": "AEOUT", + "label": "Outcome of Adverse Event", + "dataType": "string", + "length": 32 + }, + { + "itemOID": "IT.AE.AESCAN", + "name": "AESCAN", + "label": "Involves Cancer", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESCONG", + "name": "AESCONG", + "label": "Congenital Anomaly or Birth Defect", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDISAB", + "name": "AESDISAB", + "label": "Persist or Signif Disability/Incapacity", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDTH", + "name": "AESDTH", + "label": "Results in Death", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESHOSP", + "name": "AESHOSP", + "label": "Requires or Prolongs Hospitalization", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESLIFE", + "name": "AESLIFE", + "label": "Is Life Threatening", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOD", + "name": "AESOD", + "label": "Occurred with Overdose", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.EPOCH", + "name": "EPOCH", + "label": "Epoch", + "dataType": "string", + "length": 9 + }, + { + "itemOID": "IT.AE.AESTDTC", + "name": "AESTDTC", + "label": "Start Date/Time of Adverse Event", + "dataType": "date", + "keySequence": 4 + }, + { + "itemOID": "IT.AE.AEENDTC", + "name": "AEENDTC", + "label": "End Date/Time of Adverse Event", + "dataType": "date" + }, + { + "itemOID": "IT.AE.AESTDY", + "name": "AESTDY", + "label": "Study Day of Start of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENDY", + "name": "AEENDY", + "label": "Study Day of End of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENRTPT", + "name": "AEENRTPT", + "label": "End Relative to Reference Time Point", + "dataType": "string", + "length": 7 + }, + { + "itemOID": "IT.AE.AEENTPT", + "name": "AEENTPT", + "label": "End Reference Time Point", + "dataType": "date" + } + ], + "rows": [ + [ + "CDISCPILOT01", + "AE", + "utf8:αΌ‡", + 9, + "9", + "SUDDEN DEATH", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "SEVERE", + "Y", + "DRUG WITHDRAWN", + "NOT RELATED", + "FATAL", + "N", + "N", + "N", + "Y", + "N", + "Y", + "N", + "TREATMENT", + "2013-01-14", + "2013-01-14", + 61, + 61, + "", + "" + ] + ] +} diff --git a/tests/unit/test_report_encoding.py b/tests/unit/test_report_encoding.py new file mode 100644 index 000000000..ce960b23b --- /dev/null +++ b/tests/unit/test_report_encoding.py @@ -0,0 +1,147 @@ +import os +import subprocess +import json +from conftest import get_python_executable + + +class TestCoreIssue1023: + def test_dataset_cp1252(self): + """Test that the engine correctly handles dataset files with CP1252 encoding""" + command = [ + f"{get_python_executable()}", + "-m", + "core", + "validate", + "-s", + "sdtmig", + "-v", + "3.4", + "-r", + "CORE-000766", + "-e", + "cp1252", + "-dp", + os.path.join("tests", "resources", "CoreIssue1023", "ae_cp1252.json"), + "--output-format", + "json", + ] + subprocess.run(command, check=True) + + files = os.listdir() + json_files = [ + file + for file in files + if file.startswith("CORE-Report-") and file.endswith(".json") + ] + json_report_path = sorted(json_files)[-1] + # Open the JSON report file + json_report = json.load(open(json_report_path, "r", encoding="cp1252")) + assert { + "Conformance_Details", + "Dataset_Details", + "Issue_Summary", + "Issue_Details", + "Rules_Report", + }.issubset(json_report.keys()) + datasets = {x["filename"] for x in json_report["Dataset_Details"]} + assert datasets == {"AE"} + assert ( + json_report["Issue_Details"][0]["USUBJID"] + == f"cp1252:{b'\x80'.decode('cp1252')}" + ) + if os.path.exists(json_report_path): + os.remove(json_report_path) + + def test_dataset_latin1_encoding(self): + """Test that the engine correctly handles dataset files with Latin-1 encoding""" + command = [ + f"{get_python_executable()}", + "-m", + "core", + "validate", + "-s", + "sdtmig", + "-v", + "3.4", + "-r", + "CORE-000766", + "-e", + "latin1", + "-dp", + os.path.join("tests", "resources", "CoreIssue1023", "ae_latin1.json"), + "--output-format", + "json", + ] + subprocess.run(command, check=True) + + files = os.listdir() + json_files = [ + file + for file in files + if file.startswith("CORE-Report-") and file.endswith(".json") + ] + json_report_path = sorted(json_files)[-1] + # Open the JSON report file + json_report = json.load(open(json_report_path, "r", encoding="latin1")) + assert { + "Conformance_Details", + "Dataset_Details", + "Issue_Summary", + "Issue_Details", + "Rules_Report", + }.issubset(json_report.keys()) + datasets = {x["filename"] for x in json_report["Dataset_Details"]} + assert datasets == {"AE"} + assert ( + json_report["Issue_Details"][0]["USUBJID"] + == f"latin1:{b'\xb5'.decode('latin1')}" + ) + if os.path.exists(json_report_path): + os.remove(json_report_path) + + def test_dataset_utf8(self): + """Test that the engine correctly handles dataset files with utf8 encoding""" + command = [ + f"{get_python_executable()}", + "-m", + "core", + "validate", + "-s", + "sdtmig", + "-v", + "3.4", + "-r", + "CORE-000766", + "-e", + "utf8", + "-dp", + os.path.join("tests", "resources", "CoreIssue1023", "ae_utf8.json"), + "--output-format", + "json", + ] + subprocess.run(command, check=True) + + files = os.listdir() + json_files = [ + file + for file in files + if file.startswith("CORE-Report-") and file.endswith(".json") + ] + json_report_path = sorted(json_files)[-1] + # Open the JSON report file + json_report = json.load(open(json_report_path, "r", encoding="utf8")) + assert { + "Conformance_Details", + "Dataset_Details", + "Issue_Summary", + "Issue_Details", + "Rules_Report", + }.issubset(json_report.keys()) + datasets = {x["filename"] for x in json_report["Dataset_Details"]} + assert datasets == {"AE"} + assert ( + json_report["Issue_Details"][0]["USUBJID"] + == f"utf8:{b'\xe1\xbc\x87'.decode('utf8')}" + ) + if os.path.exists(json_report_path): + os.remove(json_report_path) diff --git a/tests/unit/test_services/test_reporting/test_report_encoding.py b/tests/unit/test_services/test_reporting/test_report_encoding.py new file mode 100644 index 000000000..837d014ab --- /dev/null +++ b/tests/unit/test_services/test_reporting/test_report_encoding.py @@ -0,0 +1,76 @@ +import os +import json +import openpyxl +from unittest.mock import MagicMock +from io import BytesIO +from cdisc_rules_engine.services.reporting.json_report import JsonReport +from cdisc_rules_engine.services.reporting.excel_report import ExcelReport +from cdisc_rules_engine.services.reporting.report_metadata_item import ( + ReportMetadataItem, +) + + +def test_json_report_encoding(tmp_path): + # Setup + mock_args = MagicMock() + mock_args.output = str(tmp_path / "test_report_utf8") + mock_args.output_format = ["JSON"] + mock_args.raw_report = False + mock_args.encoding = "utf-8" + + mock_report_data = MagicMock() + mock_report_data.data_sheets = { + "Test Sheet": {"Message": "Hello World", "Unicode": "γ“γ‚“γ«γ‘γ―δΈ–η•Œ"} + } + + report = JsonReport(mock_report_data, mock_args) + report.write_report() + + output_file = f"{mock_args.output}.json" + assert os.path.exists(output_file) + + with open(output_file, "r", encoding="utf-8") as f: + content = json.load(f) + assert content["Test_Sheet"]["Unicode"] == "γ“γ‚“γ«γ‘γ―δΈ–η•Œ" + + +def test_excel_report_unicode_support(tmp_path): + # Setup + mock_args = MagicMock() + mock_args.output = str(tmp_path / "test_report_excel") + # Show report folder + print(f"tmp_path contents: {os.listdir(tmp_path)}") + mock_args.output_format = ["XLSX"] + mock_args.max_report_rows = None + # Encoding arg shouldn't matter for Excel output content as it is binary/xml + mock_args.encoding = "utf-8" + + mock_report_data = MagicMock() + + # Create a simple empty excel file in memory as template + wb = openpyxl.Workbook() + ws = wb.active + ws.title = "Test Sheet" + wb.create_sheet("Conformance Details") + + template_stream = BytesIO() + wb.save(template_stream) + template_stream.seek(0) + + mock_report_data.data_sheets = { + "Test Sheet": [ + ReportMetadataItem(name="Test Item", row=1, value="γ“γ‚“γ«γ‘γ―δΈ–η•Œ") + ], + "Conformance Details": [], + } + + report = ExcelReport(mock_report_data, mock_args, template_stream) + report.write_report() + + output_file = f"{mock_args.output}.xlsx" + assert os.path.exists(output_file) + + wb_out = openpyxl.load_workbook(output_file) + ws_out = wb_out["Test Sheet"] + # ExcelReport writes ReportMetadataItem value to column 2 + assert ws_out.cell(row=1, column=2).value == "γ“γ‚“γ«γ‘γ―δΈ–η•Œ" From 8f1caeb61994abe03d7a26d4d52c484fb4e1a98c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sun, 10 May 2026 23:16:07 -0300 Subject: [PATCH 2/3] Renaming to distinguish two tests --- tests/unit/{test_report_encoding.py => test_encoding_support.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/unit/{test_report_encoding.py => test_encoding_support.py} (100%) diff --git a/tests/unit/test_report_encoding.py b/tests/unit/test_encoding_support.py similarity index 100% rename from tests/unit/test_report_encoding.py rename to tests/unit/test_encoding_support.py From 6f4f9ef83ecc685d4c0f3e187007bcd64603202c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 11 May 2026 00:05:25 -0300 Subject: [PATCH 3/3] Applying prettier formatting --- tests/resources/CoreIssue1023/ae_cp1252.json | 632 +++++++++---------- tests/resources/CoreIssue1023/ae_latin1.json | 632 +++++++++---------- tests/resources/CoreIssue1023/ae_utf8.json | 632 +++++++++---------- 3 files changed, 948 insertions(+), 948 deletions(-) diff --git a/tests/resources/CoreIssue1023/ae_cp1252.json b/tests/resources/CoreIssue1023/ae_cp1252.json index 803d478c8..a7fe504d8 100644 --- a/tests/resources/CoreIssue1023/ae_cp1252.json +++ b/tests/resources/CoreIssue1023/ae_cp1252.json @@ -1,319 +1,319 @@ { - "datasetJSONCreationDateTime": "2024-11-11T15:09:14", - "datasetJSONVersion": "1.1.0", - "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", - "dbLastModifiedDateTime": "2020-08-21T09:14:28", - "originator": "CDISC SDTM MSG Team", - "sourceSystem": { - "name": "SAS on X64_10PRO", - "version": "9.0401M7" - }, - "studyOID": "cdisc.com/CDISCPILOT01", - "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", - "metaDataRef": "define.xml", - "itemGroupOID": "IG.AE", - "records": 1, - "name": "AE", - "label": "Adverse Events", - "columns": [ - { - "itemOID": "IT.AE.STUDYID", - "name": "STUDYID", - "label": "Study Identifier", - "dataType": "string", - "length": 12, - "keySequence": 1 - }, - { - "itemOID": "IT.AE.DOMAIN", - "name": "DOMAIN", - "label": "Domain Abbreviation", - "dataType": "string", - "length": 2 - }, - { - "itemOID": "IT.AE.USUBJID", - "name": "USUBJID", - "label": "Unique Subject Identifier", - "dataType": "string", - "length": 8, - "keySequence": 2 - }, - { - "itemOID": "IT.AE.AESEQ", - "name": "AESEQ", - "label": "Sequence Number", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AELNKID", - "name": "AELNKID", - "label": "Link ID", - "dataType": "string", - "length": 50, - "keySequence": 5 - }, - { - "itemOID": "IT.AE.AETERM", - "name": "AETERM", - "label": "Reported Term for the Adverse Event", - "dataType": "string", - "length": 200 - }, - { - "itemOID": "IT.AE.AELLT", - "name": "AELLT", - "label": "Lowest Level Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AELLTCD", - "name": "AELLTCD", - "label": "Lowest Level Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEDECOD", - "name": "AEDECOD", - "label": "Dictionary-Derived Term", - "dataType": "string", - "length": 1, - "keySequence": 3 - }, - { - "itemOID": "IT.AE.AEPTCD", - "name": "AEPTCD", - "label": "Preferred Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLT", - "name": "AEHLT", - "label": "High Level Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLTCD", - "name": "AEHLTCD", - "label": "High Level Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLGT", - "name": "AEHLGT", - "label": "High Level Group Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLGTCD", - "name": "AEHLGTCD", - "label": "High Level Group Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEBODSYS", - "name": "AEBODSYS", - "label": "Body System or Organ Class", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEBDSYCD", - "name": "AEBDSYCD", - "label": "Body System or Organ Class Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOC", - "name": "AESOC", - "label": "Primary System Organ Class", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOCCD", - "name": "AESOCCD", - "label": "Primary System Organ Class Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESEV", - "name": "AESEV", - "label": "Severity/Intensity", - "dataType": "string", - "length": 8 - }, - { - "itemOID": "IT.AE.AESER", - "name": "AESER", - "label": "Serious Event", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEACN", - "name": "AEACN", - "label": "Action Taken with Study Treatment", - "dataType": "string", - "length": 16 - }, - { - "itemOID": "IT.AE.AEREL", - "name": "AEREL", - "label": "Causality", - "dataType": "string", - "length": 16 - }, - { - "itemOID": "IT.AE.AEOUT", - "name": "AEOUT", - "label": "Outcome of Adverse Event", - "dataType": "string", - "length": 32 - }, - { - "itemOID": "IT.AE.AESCAN", - "name": "AESCAN", - "label": "Involves Cancer", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESCONG", - "name": "AESCONG", - "label": "Congenital Anomaly or Birth Defect", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESDISAB", - "name": "AESDISAB", - "label": "Persist or Signif Disability/Incapacity", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESDTH", - "name": "AESDTH", - "label": "Results in Death", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESHOSP", - "name": "AESHOSP", - "label": "Requires or Prolongs Hospitalization", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESLIFE", - "name": "AESLIFE", - "label": "Is Life Threatening", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOD", - "name": "AESOD", - "label": "Occurred with Overdose", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.EPOCH", - "name": "EPOCH", - "label": "Epoch", - "dataType": "string", - "length": 9 - }, - { - "itemOID": "IT.AE.AESTDTC", - "name": "AESTDTC", - "label": "Start Date/Time of Adverse Event", - "dataType": "date", - "keySequence": 4 - }, - { - "itemOID": "IT.AE.AEENDTC", - "name": "AEENDTC", - "label": "End Date/Time of Adverse Event", - "dataType": "date" - }, - { - "itemOID": "IT.AE.AESTDY", - "name": "AESTDY", - "label": "Study Day of Start of Adverse Event", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AEENDY", - "name": "AEENDY", - "label": "Study Day of End of Adverse Event", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AEENRTPT", - "name": "AEENRTPT", - "label": "End Relative to Reference Time Point", - "dataType": "string", - "length": 7 - }, - { - "itemOID": "IT.AE.AEENTPT", - "name": "AEENTPT", - "label": "End Reference Time Point", - "dataType": "date" - } - ], - "rows": [ - [ - "CDISCPILOT01", - "AE", - "cp1252:€", - 9, - "9", - "SUDDEN DEATH", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "SEVERE", - "Y", - "DRUG WITHDRAWN", - "NOT RELATED", - "FATAL", - "N", - "N", - "N", - "Y", - "N", - "Y", - "N", - "TREATMENT", - "2013-01-14", - "2013-01-14", - 61, - 61, - "", - "" - ] + "datasetJSONCreationDateTime": "2024-11-11T15:09:14", + "datasetJSONVersion": "1.1.0", + "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", + "dbLastModifiedDateTime": "2020-08-21T09:14:28", + "originator": "CDISC SDTM MSG Team", + "sourceSystem": { + "name": "SAS on X64_10PRO", + "version": "9.0401M7" + }, + "studyOID": "cdisc.com/CDISCPILOT01", + "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", + "metaDataRef": "define.xml", + "itemGroupOID": "IG.AE", + "records": 1, + "name": "AE", + "label": "Adverse Events", + "columns": [ + { + "itemOID": "IT.AE.STUDYID", + "name": "STUDYID", + "label": "Study Identifier", + "dataType": "string", + "length": 12, + "keySequence": 1 + }, + { + "itemOID": "IT.AE.DOMAIN", + "name": "DOMAIN", + "label": "Domain Abbreviation", + "dataType": "string", + "length": 2 + }, + { + "itemOID": "IT.AE.USUBJID", + "name": "USUBJID", + "label": "Unique Subject Identifier", + "dataType": "string", + "length": 8, + "keySequence": 2 + }, + { + "itemOID": "IT.AE.AESEQ", + "name": "AESEQ", + "label": "Sequence Number", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AELNKID", + "name": "AELNKID", + "label": "Link ID", + "dataType": "string", + "length": 50, + "keySequence": 5 + }, + { + "itemOID": "IT.AE.AETERM", + "name": "AETERM", + "label": "Reported Term for the Adverse Event", + "dataType": "string", + "length": 200 + }, + { + "itemOID": "IT.AE.AELLT", + "name": "AELLT", + "label": "Lowest Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AELLTCD", + "name": "AELLTCD", + "label": "Lowest Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEDECOD", + "name": "AEDECOD", + "label": "Dictionary-Derived Term", + "dataType": "string", + "length": 1, + "keySequence": 3 + }, + { + "itemOID": "IT.AE.AEPTCD", + "name": "AEPTCD", + "label": "Preferred Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLT", + "name": "AEHLT", + "label": "High Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLTCD", + "name": "AEHLTCD", + "label": "High Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGT", + "name": "AEHLGT", + "label": "High Level Group Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGTCD", + "name": "AEHLGTCD", + "label": "High Level Group Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBODSYS", + "name": "AEBODSYS", + "label": "Body System or Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBDSYCD", + "name": "AEBDSYCD", + "label": "Body System or Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOC", + "name": "AESOC", + "label": "Primary System Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOCCD", + "name": "AESOCCD", + "label": "Primary System Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESEV", + "name": "AESEV", + "label": "Severity/Intensity", + "dataType": "string", + "length": 8 + }, + { + "itemOID": "IT.AE.AESER", + "name": "AESER", + "label": "Serious Event", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEACN", + "name": "AEACN", + "label": "Action Taken with Study Treatment", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEREL", + "name": "AEREL", + "label": "Causality", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEOUT", + "name": "AEOUT", + "label": "Outcome of Adverse Event", + "dataType": "string", + "length": 32 + }, + { + "itemOID": "IT.AE.AESCAN", + "name": "AESCAN", + "label": "Involves Cancer", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESCONG", + "name": "AESCONG", + "label": "Congenital Anomaly or Birth Defect", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDISAB", + "name": "AESDISAB", + "label": "Persist or Signif Disability/Incapacity", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDTH", + "name": "AESDTH", + "label": "Results in Death", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESHOSP", + "name": "AESHOSP", + "label": "Requires or Prolongs Hospitalization", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESLIFE", + "name": "AESLIFE", + "label": "Is Life Threatening", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOD", + "name": "AESOD", + "label": "Occurred with Overdose", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.EPOCH", + "name": "EPOCH", + "label": "Epoch", + "dataType": "string", + "length": 9 + }, + { + "itemOID": "IT.AE.AESTDTC", + "name": "AESTDTC", + "label": "Start Date/Time of Adverse Event", + "dataType": "date", + "keySequence": 4 + }, + { + "itemOID": "IT.AE.AEENDTC", + "name": "AEENDTC", + "label": "End Date/Time of Adverse Event", + "dataType": "date" + }, + { + "itemOID": "IT.AE.AESTDY", + "name": "AESTDY", + "label": "Study Day of Start of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENDY", + "name": "AEENDY", + "label": "Study Day of End of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENRTPT", + "name": "AEENRTPT", + "label": "End Relative to Reference Time Point", + "dataType": "string", + "length": 7 + }, + { + "itemOID": "IT.AE.AEENTPT", + "name": "AEENTPT", + "label": "End Reference Time Point", + "dataType": "date" + } + ], + "rows": [ + [ + "CDISCPILOT01", + "AE", + "cp1252:€", + 9, + "9", + "SUDDEN DEATH", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "SEVERE", + "Y", + "DRUG WITHDRAWN", + "NOT RELATED", + "FATAL", + "N", + "N", + "N", + "Y", + "N", + "Y", + "N", + "TREATMENT", + "2013-01-14", + "2013-01-14", + 61, + 61, + "", + "" ] + ] } diff --git a/tests/resources/CoreIssue1023/ae_latin1.json b/tests/resources/CoreIssue1023/ae_latin1.json index 2148ef8da..9aa7ebb9f 100644 --- a/tests/resources/CoreIssue1023/ae_latin1.json +++ b/tests/resources/CoreIssue1023/ae_latin1.json @@ -1,319 +1,319 @@ { - "datasetJSONCreationDateTime": "2024-11-11T15:09:14", - "datasetJSONVersion": "1.1.0", - "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", - "dbLastModifiedDateTime": "2020-08-21T09:14:28", - "originator": "CDISC SDTM MSG Team", - "sourceSystem": { - "name": "SAS on X64_10PRO", - "version": "9.0401M7" - }, - "studyOID": "cdisc.com/CDISCPILOT01", - "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", - "metaDataRef": "define.xml", - "itemGroupOID": "IG.AE", - "records": 1, - "name": "AE", - "label": "Adverse Events", - "columns": [ - { - "itemOID": "IT.AE.STUDYID", - "name": "STUDYID", - "label": "Study Identifier", - "dataType": "string", - "length": 12, - "keySequence": 1 - }, - { - "itemOID": "IT.AE.DOMAIN", - "name": "DOMAIN", - "label": "Domain Abbreviation", - "dataType": "string", - "length": 2 - }, - { - "itemOID": "IT.AE.USUBJID", - "name": "USUBJID", - "label": "Unique Subject Identifier", - "dataType": "string", - "length": 8, - "keySequence": 2 - }, - { - "itemOID": "IT.AE.AESEQ", - "name": "AESEQ", - "label": "Sequence Number", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AELNKID", - "name": "AELNKID", - "label": "Link ID", - "dataType": "string", - "length": 50, - "keySequence": 5 - }, - { - "itemOID": "IT.AE.AETERM", - "name": "AETERM", - "label": "Reported Term for the Adverse Event", - "dataType": "string", - "length": 200 - }, - { - "itemOID": "IT.AE.AELLT", - "name": "AELLT", - "label": "Lowest Level Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AELLTCD", - "name": "AELLTCD", - "label": "Lowest Level Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEDECOD", - "name": "AEDECOD", - "label": "Dictionary-Derived Term", - "dataType": "string", - "length": 1, - "keySequence": 3 - }, - { - "itemOID": "IT.AE.AEPTCD", - "name": "AEPTCD", - "label": "Preferred Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLT", - "name": "AEHLT", - "label": "High Level Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLTCD", - "name": "AEHLTCD", - "label": "High Level Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLGT", - "name": "AEHLGT", - "label": "High Level Group Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLGTCD", - "name": "AEHLGTCD", - "label": "High Level Group Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEBODSYS", - "name": "AEBODSYS", - "label": "Body System or Organ Class", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEBDSYCD", - "name": "AEBDSYCD", - "label": "Body System or Organ Class Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOC", - "name": "AESOC", - "label": "Primary System Organ Class", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOCCD", - "name": "AESOCCD", - "label": "Primary System Organ Class Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESEV", - "name": "AESEV", - "label": "Severity/Intensity", - "dataType": "string", - "length": 8 - }, - { - "itemOID": "IT.AE.AESER", - "name": "AESER", - "label": "Serious Event", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEACN", - "name": "AEACN", - "label": "Action Taken with Study Treatment", - "dataType": "string", - "length": 16 - }, - { - "itemOID": "IT.AE.AEREL", - "name": "AEREL", - "label": "Causality", - "dataType": "string", - "length": 16 - }, - { - "itemOID": "IT.AE.AEOUT", - "name": "AEOUT", - "label": "Outcome of Adverse Event", - "dataType": "string", - "length": 32 - }, - { - "itemOID": "IT.AE.AESCAN", - "name": "AESCAN", - "label": "Involves Cancer", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESCONG", - "name": "AESCONG", - "label": "Congenital Anomaly or Birth Defect", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESDISAB", - "name": "AESDISAB", - "label": "Persist or Signif Disability/Incapacity", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESDTH", - "name": "AESDTH", - "label": "Results in Death", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESHOSP", - "name": "AESHOSP", - "label": "Requires or Prolongs Hospitalization", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESLIFE", - "name": "AESLIFE", - "label": "Is Life Threatening", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOD", - "name": "AESOD", - "label": "Occurred with Overdose", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.EPOCH", - "name": "EPOCH", - "label": "Epoch", - "dataType": "string", - "length": 9 - }, - { - "itemOID": "IT.AE.AESTDTC", - "name": "AESTDTC", - "label": "Start Date/Time of Adverse Event", - "dataType": "date", - "keySequence": 4 - }, - { - "itemOID": "IT.AE.AEENDTC", - "name": "AEENDTC", - "label": "End Date/Time of Adverse Event", - "dataType": "date" - }, - { - "itemOID": "IT.AE.AESTDY", - "name": "AESTDY", - "label": "Study Day of Start of Adverse Event", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AEENDY", - "name": "AEENDY", - "label": "Study Day of End of Adverse Event", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AEENRTPT", - "name": "AEENRTPT", - "label": "End Relative to Reference Time Point", - "dataType": "string", - "length": 7 - }, - { - "itemOID": "IT.AE.AEENTPT", - "name": "AEENTPT", - "label": "End Reference Time Point", - "dataType": "date" - } - ], - "rows": [ - [ - "CDISCPILOT01", - "AE", - "latin1:΅", - 9, - "9", - "SUDDEN DEATH", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "SEVERE", - "Y", - "DRUG WITHDRAWN", - "NOT RELATED", - "FATAL", - "N", - "N", - "N", - "Y", - "N", - "Y", - "N", - "TREATMENT", - "2013-01-14", - "2013-01-14", - 61, - 61, - "", - "" - ] + "datasetJSONCreationDateTime": "2024-11-11T15:09:14", + "datasetJSONVersion": "1.1.0", + "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", + "dbLastModifiedDateTime": "2020-08-21T09:14:28", + "originator": "CDISC SDTM MSG Team", + "sourceSystem": { + "name": "SAS on X64_10PRO", + "version": "9.0401M7" + }, + "studyOID": "cdisc.com/CDISCPILOT01", + "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", + "metaDataRef": "define.xml", + "itemGroupOID": "IG.AE", + "records": 1, + "name": "AE", + "label": "Adverse Events", + "columns": [ + { + "itemOID": "IT.AE.STUDYID", + "name": "STUDYID", + "label": "Study Identifier", + "dataType": "string", + "length": 12, + "keySequence": 1 + }, + { + "itemOID": "IT.AE.DOMAIN", + "name": "DOMAIN", + "label": "Domain Abbreviation", + "dataType": "string", + "length": 2 + }, + { + "itemOID": "IT.AE.USUBJID", + "name": "USUBJID", + "label": "Unique Subject Identifier", + "dataType": "string", + "length": 8, + "keySequence": 2 + }, + { + "itemOID": "IT.AE.AESEQ", + "name": "AESEQ", + "label": "Sequence Number", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AELNKID", + "name": "AELNKID", + "label": "Link ID", + "dataType": "string", + "length": 50, + "keySequence": 5 + }, + { + "itemOID": "IT.AE.AETERM", + "name": "AETERM", + "label": "Reported Term for the Adverse Event", + "dataType": "string", + "length": 200 + }, + { + "itemOID": "IT.AE.AELLT", + "name": "AELLT", + "label": "Lowest Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AELLTCD", + "name": "AELLTCD", + "label": "Lowest Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEDECOD", + "name": "AEDECOD", + "label": "Dictionary-Derived Term", + "dataType": "string", + "length": 1, + "keySequence": 3 + }, + { + "itemOID": "IT.AE.AEPTCD", + "name": "AEPTCD", + "label": "Preferred Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLT", + "name": "AEHLT", + "label": "High Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLTCD", + "name": "AEHLTCD", + "label": "High Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGT", + "name": "AEHLGT", + "label": "High Level Group Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGTCD", + "name": "AEHLGTCD", + "label": "High Level Group Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBODSYS", + "name": "AEBODSYS", + "label": "Body System or Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBDSYCD", + "name": "AEBDSYCD", + "label": "Body System or Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOC", + "name": "AESOC", + "label": "Primary System Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOCCD", + "name": "AESOCCD", + "label": "Primary System Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESEV", + "name": "AESEV", + "label": "Severity/Intensity", + "dataType": "string", + "length": 8 + }, + { + "itemOID": "IT.AE.AESER", + "name": "AESER", + "label": "Serious Event", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEACN", + "name": "AEACN", + "label": "Action Taken with Study Treatment", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEREL", + "name": "AEREL", + "label": "Causality", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEOUT", + "name": "AEOUT", + "label": "Outcome of Adverse Event", + "dataType": "string", + "length": 32 + }, + { + "itemOID": "IT.AE.AESCAN", + "name": "AESCAN", + "label": "Involves Cancer", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESCONG", + "name": "AESCONG", + "label": "Congenital Anomaly or Birth Defect", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDISAB", + "name": "AESDISAB", + "label": "Persist or Signif Disability/Incapacity", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDTH", + "name": "AESDTH", + "label": "Results in Death", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESHOSP", + "name": "AESHOSP", + "label": "Requires or Prolongs Hospitalization", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESLIFE", + "name": "AESLIFE", + "label": "Is Life Threatening", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOD", + "name": "AESOD", + "label": "Occurred with Overdose", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.EPOCH", + "name": "EPOCH", + "label": "Epoch", + "dataType": "string", + "length": 9 + }, + { + "itemOID": "IT.AE.AESTDTC", + "name": "AESTDTC", + "label": "Start Date/Time of Adverse Event", + "dataType": "date", + "keySequence": 4 + }, + { + "itemOID": "IT.AE.AEENDTC", + "name": "AEENDTC", + "label": "End Date/Time of Adverse Event", + "dataType": "date" + }, + { + "itemOID": "IT.AE.AESTDY", + "name": "AESTDY", + "label": "Study Day of Start of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENDY", + "name": "AEENDY", + "label": "Study Day of End of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENRTPT", + "name": "AEENRTPT", + "label": "End Relative to Reference Time Point", + "dataType": "string", + "length": 7 + }, + { + "itemOID": "IT.AE.AEENTPT", + "name": "AEENTPT", + "label": "End Reference Time Point", + "dataType": "date" + } + ], + "rows": [ + [ + "CDISCPILOT01", + "AE", + "latin1:΅", + 9, + "9", + "SUDDEN DEATH", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "SEVERE", + "Y", + "DRUG WITHDRAWN", + "NOT RELATED", + "FATAL", + "N", + "N", + "N", + "Y", + "N", + "Y", + "N", + "TREATMENT", + "2013-01-14", + "2013-01-14", + 61, + 61, + "", + "" ] + ] } diff --git a/tests/resources/CoreIssue1023/ae_utf8.json b/tests/resources/CoreIssue1023/ae_utf8.json index 547428f66..0a3472e51 100644 --- a/tests/resources/CoreIssue1023/ae_utf8.json +++ b/tests/resources/CoreIssue1023/ae_utf8.json @@ -1,319 +1,319 @@ { - "datasetJSONCreationDateTime": "2024-11-11T15:09:14", - "datasetJSONVersion": "1.1.0", - "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", - "dbLastModifiedDateTime": "2020-08-21T09:14:28", - "originator": "CDISC SDTM MSG Team", - "sourceSystem": { - "name": "SAS on X64_10PRO", - "version": "9.0401M7" - }, - "studyOID": "cdisc.com/CDISCPILOT01", - "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", - "metaDataRef": "define.xml", - "itemGroupOID": "IG.AE", - "records": 1, - "name": "AE", - "label": "Adverse Events", - "columns": [ - { - "itemOID": "IT.AE.STUDYID", - "name": "STUDYID", - "label": "Study Identifier", - "dataType": "string", - "length": 12, - "keySequence": 1 - }, - { - "itemOID": "IT.AE.DOMAIN", - "name": "DOMAIN", - "label": "Domain Abbreviation", - "dataType": "string", - "length": 2 - }, - { - "itemOID": "IT.AE.USUBJID", - "name": "USUBJID", - "label": "Unique Subject Identifier", - "dataType": "string", - "length": 8, - "keySequence": 2 - }, - { - "itemOID": "IT.AE.AESEQ", - "name": "AESEQ", - "label": "Sequence Number", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AELNKID", - "name": "AELNKID", - "label": "Link ID", - "dataType": "string", - "length": 50, - "keySequence": 5 - }, - { - "itemOID": "IT.AE.AETERM", - "name": "AETERM", - "label": "Reported Term for the Adverse Event", - "dataType": "string", - "length": 200 - }, - { - "itemOID": "IT.AE.AELLT", - "name": "AELLT", - "label": "Lowest Level Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AELLTCD", - "name": "AELLTCD", - "label": "Lowest Level Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEDECOD", - "name": "AEDECOD", - "label": "Dictionary-Derived Term", - "dataType": "string", - "length": 1, - "keySequence": 3 - }, - { - "itemOID": "IT.AE.AEPTCD", - "name": "AEPTCD", - "label": "Preferred Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLT", - "name": "AEHLT", - "label": "High Level Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLTCD", - "name": "AEHLTCD", - "label": "High Level Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLGT", - "name": "AEHLGT", - "label": "High Level Group Term", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEHLGTCD", - "name": "AEHLGTCD", - "label": "High Level Group Term Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEBODSYS", - "name": "AEBODSYS", - "label": "Body System or Organ Class", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEBDSYCD", - "name": "AEBDSYCD", - "label": "Body System or Organ Class Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOC", - "name": "AESOC", - "label": "Primary System Organ Class", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOCCD", - "name": "AESOCCD", - "label": "Primary System Organ Class Code", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESEV", - "name": "AESEV", - "label": "Severity/Intensity", - "dataType": "string", - "length": 8 - }, - { - "itemOID": "IT.AE.AESER", - "name": "AESER", - "label": "Serious Event", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AEACN", - "name": "AEACN", - "label": "Action Taken with Study Treatment", - "dataType": "string", - "length": 16 - }, - { - "itemOID": "IT.AE.AEREL", - "name": "AEREL", - "label": "Causality", - "dataType": "string", - "length": 16 - }, - { - "itemOID": "IT.AE.AEOUT", - "name": "AEOUT", - "label": "Outcome of Adverse Event", - "dataType": "string", - "length": 32 - }, - { - "itemOID": "IT.AE.AESCAN", - "name": "AESCAN", - "label": "Involves Cancer", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESCONG", - "name": "AESCONG", - "label": "Congenital Anomaly or Birth Defect", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESDISAB", - "name": "AESDISAB", - "label": "Persist or Signif Disability/Incapacity", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESDTH", - "name": "AESDTH", - "label": "Results in Death", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESHOSP", - "name": "AESHOSP", - "label": "Requires or Prolongs Hospitalization", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESLIFE", - "name": "AESLIFE", - "label": "Is Life Threatening", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.AESOD", - "name": "AESOD", - "label": "Occurred with Overdose", - "dataType": "string", - "length": 1 - }, - { - "itemOID": "IT.AE.EPOCH", - "name": "EPOCH", - "label": "Epoch", - "dataType": "string", - "length": 9 - }, - { - "itemOID": "IT.AE.AESTDTC", - "name": "AESTDTC", - "label": "Start Date/Time of Adverse Event", - "dataType": "date", - "keySequence": 4 - }, - { - "itemOID": "IT.AE.AEENDTC", - "name": "AEENDTC", - "label": "End Date/Time of Adverse Event", - "dataType": "date" - }, - { - "itemOID": "IT.AE.AESTDY", - "name": "AESTDY", - "label": "Study Day of Start of Adverse Event", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AEENDY", - "name": "AEENDY", - "label": "Study Day of End of Adverse Event", - "dataType": "integer" - }, - { - "itemOID": "IT.AE.AEENRTPT", - "name": "AEENRTPT", - "label": "End Relative to Reference Time Point", - "dataType": "string", - "length": 7 - }, - { - "itemOID": "IT.AE.AEENTPT", - "name": "AEENTPT", - "label": "End Reference Time Point", - "dataType": "date" - } - ], - "rows": [ - [ - "CDISCPILOT01", - "AE", - "utf8:αΌ‡", - 9, - "9", - "SUDDEN DEATH", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "SEVERE", - "Y", - "DRUG WITHDRAWN", - "NOT RELATED", - "FATAL", - "N", - "N", - "N", - "Y", - "N", - "Y", - "N", - "TREATMENT", - "2013-01-14", - "2013-01-14", - 61, - 61, - "", - "" - ] + "datasetJSONCreationDateTime": "2024-11-11T15:09:14", + "datasetJSONVersion": "1.1.0", + "fileOID": "www.cdisc.org/StudyMSGv2/1/Define-XML_2.1.0/2024-11-11/ae", + "dbLastModifiedDateTime": "2020-08-21T09:14:28", + "originator": "CDISC SDTM MSG Team", + "sourceSystem": { + "name": "SAS on X64_10PRO", + "version": "9.0401M7" + }, + "studyOID": "cdisc.com/CDISCPILOT01", + "metaDataVersionOID": "MDV.MSGv2.0.SDTMIG.3.3.SDTM.1.7", + "metaDataRef": "define.xml", + "itemGroupOID": "IG.AE", + "records": 1, + "name": "AE", + "label": "Adverse Events", + "columns": [ + { + "itemOID": "IT.AE.STUDYID", + "name": "STUDYID", + "label": "Study Identifier", + "dataType": "string", + "length": 12, + "keySequence": 1 + }, + { + "itemOID": "IT.AE.DOMAIN", + "name": "DOMAIN", + "label": "Domain Abbreviation", + "dataType": "string", + "length": 2 + }, + { + "itemOID": "IT.AE.USUBJID", + "name": "USUBJID", + "label": "Unique Subject Identifier", + "dataType": "string", + "length": 8, + "keySequence": 2 + }, + { + "itemOID": "IT.AE.AESEQ", + "name": "AESEQ", + "label": "Sequence Number", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AELNKID", + "name": "AELNKID", + "label": "Link ID", + "dataType": "string", + "length": 50, + "keySequence": 5 + }, + { + "itemOID": "IT.AE.AETERM", + "name": "AETERM", + "label": "Reported Term for the Adverse Event", + "dataType": "string", + "length": 200 + }, + { + "itemOID": "IT.AE.AELLT", + "name": "AELLT", + "label": "Lowest Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AELLTCD", + "name": "AELLTCD", + "label": "Lowest Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEDECOD", + "name": "AEDECOD", + "label": "Dictionary-Derived Term", + "dataType": "string", + "length": 1, + "keySequence": 3 + }, + { + "itemOID": "IT.AE.AEPTCD", + "name": "AEPTCD", + "label": "Preferred Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLT", + "name": "AEHLT", + "label": "High Level Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLTCD", + "name": "AEHLTCD", + "label": "High Level Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGT", + "name": "AEHLGT", + "label": "High Level Group Term", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEHLGTCD", + "name": "AEHLGTCD", + "label": "High Level Group Term Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBODSYS", + "name": "AEBODSYS", + "label": "Body System or Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEBDSYCD", + "name": "AEBDSYCD", + "label": "Body System or Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOC", + "name": "AESOC", + "label": "Primary System Organ Class", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOCCD", + "name": "AESOCCD", + "label": "Primary System Organ Class Code", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESEV", + "name": "AESEV", + "label": "Severity/Intensity", + "dataType": "string", + "length": 8 + }, + { + "itemOID": "IT.AE.AESER", + "name": "AESER", + "label": "Serious Event", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AEACN", + "name": "AEACN", + "label": "Action Taken with Study Treatment", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEREL", + "name": "AEREL", + "label": "Causality", + "dataType": "string", + "length": 16 + }, + { + "itemOID": "IT.AE.AEOUT", + "name": "AEOUT", + "label": "Outcome of Adverse Event", + "dataType": "string", + "length": 32 + }, + { + "itemOID": "IT.AE.AESCAN", + "name": "AESCAN", + "label": "Involves Cancer", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESCONG", + "name": "AESCONG", + "label": "Congenital Anomaly or Birth Defect", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDISAB", + "name": "AESDISAB", + "label": "Persist or Signif Disability/Incapacity", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESDTH", + "name": "AESDTH", + "label": "Results in Death", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESHOSP", + "name": "AESHOSP", + "label": "Requires or Prolongs Hospitalization", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESLIFE", + "name": "AESLIFE", + "label": "Is Life Threatening", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.AESOD", + "name": "AESOD", + "label": "Occurred with Overdose", + "dataType": "string", + "length": 1 + }, + { + "itemOID": "IT.AE.EPOCH", + "name": "EPOCH", + "label": "Epoch", + "dataType": "string", + "length": 9 + }, + { + "itemOID": "IT.AE.AESTDTC", + "name": "AESTDTC", + "label": "Start Date/Time of Adverse Event", + "dataType": "date", + "keySequence": 4 + }, + { + "itemOID": "IT.AE.AEENDTC", + "name": "AEENDTC", + "label": "End Date/Time of Adverse Event", + "dataType": "date" + }, + { + "itemOID": "IT.AE.AESTDY", + "name": "AESTDY", + "label": "Study Day of Start of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENDY", + "name": "AEENDY", + "label": "Study Day of End of Adverse Event", + "dataType": "integer" + }, + { + "itemOID": "IT.AE.AEENRTPT", + "name": "AEENRTPT", + "label": "End Relative to Reference Time Point", + "dataType": "string", + "length": 7 + }, + { + "itemOID": "IT.AE.AEENTPT", + "name": "AEENTPT", + "label": "End Reference Time Point", + "dataType": "date" + } + ], + "rows": [ + [ + "CDISCPILOT01", + "AE", + "utf8:αΌ‡", + 9, + "9", + "SUDDEN DEATH", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "SEVERE", + "Y", + "DRUG WITHDRAWN", + "NOT RELATED", + "FATAL", + "N", + "N", + "N", + "Y", + "N", + "Y", + "N", + "TREATMENT", + "2013-01-14", + "2013-01-14", + 61, + 61, + "", + "" ] + ] }