-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Standard
CDISC USDM
Reference Rule ID(s)
DDF00245, DDF00163, DDF00244
Conformance Rule ID(s) (if published in CORE)
CORE-001041, CORE-001051, CORE-001073
JIRA Ticket
https://jira.cdisc.org/projects/CORERULES/issues/CORERULES-
CLI Command Used (if applicable)
./core.py validate -s USDM -v 4-0 -o ../../Downloads/narrative_conformance.xlsx -dp ../soa-workbench/files/pilot_LZZT_narrative_2026MAR10.json -r CORE-001051 -r CORE-000965 -r CORE-001055 -r CORE-001041 -r CORE-000964 -r CORE-000944 -r CORE-001069 -r CORE-001073
Rule YAML
Authorities:
- Organization: CDISC
Standards:
- Name: USDM
References:
- Citations:
- Cited Guidance: 'Referenced items in the narrative content item texts must be
available elsewhere in the data model.'
Document: 'USDM_CORE_Rules.xlsx'
Origin: 'USDM Conformance Rules'
Rule Identifier:
Id: 'DDF00244'
Version: '1'
Version: '1.0'
Version: '4.0'
Check: |-
(
$lkp:=**[id and instanceType].$each(function($v,$k){{$join([instanceType,id,$k],"|"):$v}})~>$merge;
($.study.versions.narrativeContentItems[$type(text)="string" and $contains(text,/usdm:ref/)])@$nci.
$match( $nci.text,
/<usdm:ref([^>]*)(\/>|><\/usdm:ref>)/
)@$ref.
(
$g0_or_null := function($m){$m ? $m.groups[0] : ""};
{
"instanceType": $nci.instanceType,
"id": $nci.id,
"path": $nci._path,
"name": $nci.name,
"text": $nci.text,
"usdm_ref": {
"match": $ref.match,
"klass": $match($ref.groups[0],/klass=\"([a-zA-Z]+)\"/) ~> $g0_or_null(),
"id": $match($ref.groups[0],/id=\"(\w+)\"/) ~> $g0_or_null(),
"attribute": $match($ref.groups[0],/attribute=\"([a-zA-Z]+)\"/) ~> $g0_or_null()
}
}
)
~> $map(function($v)
{
(
$ref_val := "usdm_ref" in $keys($v)
? (
$k := $join([$v.usdm_ref.klass,$v.usdm_ref.id,$v.usdm_ref.attribute],"|");
$k in $keys($lkp)
? $lookup($lkp,$k)
: "!!NOT FOUND!!"
)
: $v.value;
$v ~> |$|{"Invalid Reference": $v.usdm_ref.match, "Referenced Value": $ref_val},['usdm_ref']|
)
}
)
~> $filter(function($v)
{
$v.`Referenced Value` = "!!NOT FOUND!!"
}
)
)
Core:
Id: 'CORE-001073'
Status: Published
Version: '1'
Description: 'Referenced items in the narrative content item texts must be
available elsewhere in the data model.'
Executability: Fully Executable
Outcome:
Message: 'The item referenced in the narrative content item text is not
available elsewhere in the model.'
Output Variables:
- name
- 'Invalid Reference'
Rule Type: JSONata
Scope:
Entities:
Include:
- 'NarrativeContentItem'
Sensitivity: RecordAuthorities:
- Organization: CDISC
Standards:
- Name: USDM
References:
- Citations:
- Cited Guidance: 'Narrative content is expected to point to a child and/or to a
content item text.'
Document: 'USDM_CORE_Rules.xlsx'
Origin: 'USDM Conformance Rules'
Rule Identifier:
Id: 'DDF00163'
Version: '1'
Version: '1.0'
Version: '4.0'
Check: |-
$.study.documentedBy@$sdd.
$sdd.versions@$sddv.
$filter(($sddv.contents),function($v)
{
$not($v.childIds or $v.contentItemId)
}
)@$c.
{
"instanceType": $c.instanceType,
"id": $c.id,
"path": $c._path,
"StudyDefinitionDocument.id": $sdd.id,
"StudyDefinitionDocument.name": $sdd.name,
"StudyDefinitionDocumentVersion.id": $sddv.id,
"StudyDefinitionDocumentVersion.version": $sddv.version,
"name": $c.name,
"sectionNumber": $c.sectionNumber,
"sectionTitle": $c.sectionTitle
}
Core:
Id: 'CORE-001051'
Status: Published
Version: '1'
Description: 'Narrative content is expected to point to a child and/or to a
content item text.'
Executability: Partially Executable - Possible Overreporting
Outcome:
Message: "The narrative content does not contain either a child or a narrative
content item."
Output Variables:
- StudyDefinitionDocument.id
- StudyDefinitionDocument.name
- StudyDefinitionDocumentVersion.id
- StudyDefinitionDocumentVersion.version
- name
- sectionNumber
- sectionTitle
Rule Type: JSONata
Scope:
Entities:
Include:
- 'NarrativeContent'
Sensitivity: RecordAuthorities:
- Organization: CDISC
Standards:
- Name: USDM
References:
- Citations:
- Cited Guidance: Within a document version, the specified displayed section
numbers for narrative content must be unique.'
Document: 'USDM_CORE_Rules.xlsx'
Origin: 'USDM Conformance Rules'
Rule Identifier:
Id: 'DDF00245'
Version: '1'
Version: '1.0'
Version: '4.0'
Check: |-
$.study.documentedBy@$sdd.
$sdd.versions@$sddv.
(
$sddv.contents[displaySectionNumber=true and sectionNumber].
{
"group": $join([$sdd.id,$sddv.id,sectionNumber],"\n"),
"details":
{
"instanceType": instanceType,
"id": id,
"path": _path,
"StudyDefinitionDocument.id": $sdd.id,
"StudyDefinitionDocument.name": $sdd.name,
"StudyDefinitionDocumentVersion.id": $sddv.id,
"StudyDefinitionDocumentVersion.version": $sddv.version,
"name": name,
"sectionNumber": sectionNumber,
"displaySectionNumber": displaySectionNumber
}
} {group: $count(details)>1?details}
).*
Core:
Id: 'CORE-001041'
Status: Published
Version: '1'
Description: 'Within a document version, the specified displayed section numbers
for narrative content must be unique.'
Executability: Fully Executable
Outcome:
Message: 'The displayed section number is not unique within the study definition
document version.'
Output Variables:
- StudyDefinitionDocument.id
- StudyDefinitionDocument.name
- StudyDefinitionDocumentVersion.id
- StudyDefinitionDocumentVersion.version
- name
- sectionNumber
- displaySectionNumber
Rule Type: JSONata
Scope:
Entities:
Include:
- 'NarrativeContent'
Sensitivity: RecordAttach any sample test data file(s)
This file was created using the SOA Workbench but the narrative content was pasted from the pilot study USDM JSON (which is also attached).
pilot_LZZT_narrative_2026MAR10.json
Attach any output report and/or log file(s)
Here is the output report.
Expected output
I would expect for all of the issues reported on the Issue Summary worksheet to have more information included on the Issue Details worksheet. Only rule CORE-001069 has any details provided.
Any Additional Information
There are a considerable number of issues detected in the JSON but the issues are very difficult to track down without additional details.