A MethodDef defines how a data value can be obtained from a collection of other data values.
Element Name | MethodDef |
---|---|
Parent Elements | MetaDataVersion |
Element XPath(s) | /ODM/Study/MetaDataVersion/MethodDef |
Element Textual Value | None |
Attributes | OID, Name, Type, CommentOID |
Child Elements | (Description, MethodSignature, FormalExpression*, Alias*, DocumentRef*) The Description element must be provided and should include a prose description. The MethodSignature element must also be provided and identifies the input parameter and return values for the MethodDef. The Description and MethodSignature are the normative content of the MethodDef. If a FormalExpression is provided, it must contain a machine-readable expression that implements the Description and MethodSignature. Multiple FormalExpressions can be provided if each has a different Context attribute, allowing the same expression to be represented in forms appropriate to multiple systems. A FormalExpression can reference an external code library such that it can be retrieved for execution at run-time. If MethodDef execution order must be specified then use workflows for this purpose. |
Usage/Business Rules |
|
Attribute | Schema Datatype or Enumeration | Usage | Definition | Business Rules |
---|---|---|---|---|
OID | oid | Required | Unique identifer for the MethodDef element. | The OID attribute value must be unique within the Study/MetaDataVersion. |
Name | name | Required | Human readable name for the method. | The Name attribute must be unique within the set of MethodDef elements within a Study/MetadataVersion. |
Type | (Computation | Imputation | Transpose | Preload) | Optional | Computation: derivation involving one or more variables. Imputation: derivation based on other observations. Transpose: conversion of rows to columns or vice versa. Preload: retrieve and populate data from an external source. | Type="Preload" is the default value when a MethodDef is referenced from an ItemGroup. |
CommentOID | oidref | Optional | Reference to a CommentDef with information related to this MethodDef. | Must match the OID attribute of a CommentDef element within in this Study/MetaDataVersion. |
The Description element must be provided and should include a prose description. The MethodSignature element must also be provided and identifies the input parameter and return values for the MethodDef. The Description and MethodSignature are the normative content of the MethodDef.
If a FormalExpression is provided, it must contain a machine-readable expression that implements the Description and MethodSignature. Multiple FormalExpressions can be provided if each has a different Context attribute, allowing the same expression to be represented in forms appropriate to multiple systems. A FormalExpression can reference an external code library such that it can be retrieved for execution at run-time. If MethodDef execution order must be specified then use workflows for this purpose.
Example: MethodDef Examples
<MethodDef OID="MT.SDY" Name="Study Day" Type="Computation"> <Description> <TranslatedText xml:lang="en" Type="text/plain"> If assessment/event date is before the first dose date: Study Day = Assessment date - First Dose Date If assessment/event date is on or after the first dose date: Study Day = Assessment date - First Dose Date + 1 </TranslatedText> </Description> <MethodSignature> <Parameter Name="STDT" Definition="start Date" DataType="date" OrderNumber="1"/> <Parameter Name="RFSTDT" Definition="reference Date" DataType="date" OrderNumber="2" /> <ReturnValue Name="SDY" DataType="integer" Definition="Study Day of Start of Adverse Event"/> </MethodSignature> <FormalExpression Context="SAS 9.4"> <Code>ifn(STDT >= RFSTDT, STDT-RFSTDT+1, STDT-RFSTDT)</Code> </FormalExpression> </MethodDef> <MethodDef OID="MT.ADT" Name="Analysis Date Imputation" Type="Imputation"> <Description> <TranslatedText xml:lang="en" Type="text/plain"> If day of the month is missing, set the day of the Analysis Date to the last day of the month, then Set date the Imputation flag to D. If month is missing, set day and month of the Analysis Date to 15 July, then set date the Imputation flag to M. If year is missing, then leave the Analysis date and Imputation flag blank. Otherwise use the date as the Analysis date and leave the Imputation flag blank. </TranslatedText> </Description> <MethodSignature> <Parameter Name="QSDTC" Definition="QS Datetime" DataType="datetime" OrderNumber="1"/> <ReturnValue Name="ADT" DataType="date" Definition="Analysis Date" OrderNumber="1"/> <ReturnValue Name="ADTF" DataType="text" Definition="Analysis Date Imputation Flag" OrderNumber="1"/> </MethodSignature> <FormalExpression Context="Python 3.7"> <ExternalCodeLib Library="GitHub" href="https://raw.githubusercontent.com/:owner/:repo/master/:path"/> </FormalExpression> <FormalExpression Context="R 4.0"> <ExternalCodeLib Library="GitHub" href="https://raw.githubusercontent.com/:owner/:repo/master/:path"/> </FormalExpression> </MethodDef> <MethodDef OID="MT.REST.API" Name="Value From API" Type="Computation"> <Description> <TranslatedText xml:lang="en" Type="text/plain">Lookup or calculate a value using a web service</TranslatedText> </Description> <MethodSignature> <Parameter Name="STDT" Definition="start Date" DataType="date" OrderNumber="1"/> <Parameter Name="RFSTDT" Definition="reference Date" DataType="date" OrderNumber="2" /> <ReturnValue Name="STDT" DataType="date" Definition="study date"/> </MethodSignature> <FormalExpression Context="REST"> <Code>https://www.cloudcalc.com/studydate?startDate=STDT@amp;refDate=RFSDT</Code> </FormalExpression> </MethodDef>