ODM Mapping Reference¶
How clinicedc constructs map to CDISC ODM 1.3.1 elements and attributes.
OID conventions¶
All OIDs follow a prefix-dot-key pattern.
Prefix |
Example |
Source |
|---|---|---|
|
|
Protocol name ( |
|
|
SHA-256 fingerprint of the |
|
|
|
|
|
|
|
|
common (death / offstudy) model label |
|
|
|
|
|
|
|
|
|
|
|
|
Study events¶
Source |
ODM Type |
Repeating |
Notes |
|---|---|---|---|
Scheduled visit |
|
|
|
Unscheduled visit |
|
|
|
Death report / offstudy |
|
|
|
Every StudyEventDef carries an <Alias Context="clinicedc.schedule"
Name="…"/> identifying the schedule it belongs to. In the data,
StudyEventData maps a SubjectVisit to SE.<code> when
visit_code_sequence == 0 and to UE.<code> with a
StudyEventRepeatKey when it is > 0.
Fieldset mapping¶
Each CRF model must have a registered ModelAdmin. Its fieldsets
provide the field ordering and grouping:
Each fieldset
(name, {"fields": [...]})becomes oneItemGroupDef.The
ItemGroupOIDincludes the fieldset’s positional order, so two sections that slugify to the same name still get unique OIDs.Fieldsets named
"Audit"or"Action"are excluded.
The data side (FormData → ItemGroupData → ItemData) walks the
same fieldsets, so every ItemData OID resolves to an ItemDef.
Excluded fields¶
These are dropped from both the metadata and the data:
subject_visitandrelated_visit— structural foreign keys.consent_model— consent provenance, not a CRF answer.The
AuditModelMixinsystem columns —user_created,user_modified,hostname_*,device_*,locale_*— exceptcreatedandmodified, which are retained.
Note
Other ForeignKey / OneToOneField fields are currently emitted as
text (the stored UUID), using field.name for the OID and
field.attname for the value. This is a temporary measure; proper
relation handling (FK → coded value, M2M → repeating items, list models)
is planned.
Django field type mapping¶
Django model field types map to ODM DataType values:
Django field |
ODM DataType |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Anything not listed defaults to text.
Code lists¶
Fields with choices produce CodeList elements, and the corresponding
ItemDef references them via a CodeListRef:
<CodeList OID="CL.myapp.mymodel.status" Name="status choices" DataType="text">
<CodeListItem CodedValue="alive">
<Decode><TranslatedText xml:lang="en">Alive</TranslatedText></Decode>
</CodeListItem>
<CodeListItem CodedValue="dead">
<Decode><TranslatedText xml:lang="en">Dead</TranslatedText></Decode>
</CodeListItem>
</CodeList>