A MethodDef defines how a data value can be obtained from a collection of other data values.

Element NameMethodDef
Parent ElementsMetaDataVersion
Element XPath(s)/ODM/Study/MetaDataVersion/MethodDef
Element Textual ValueNone
AttributesOID, 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
  • Business Rule(s):
    • There must be an MethodDef element for each unique MethodOID attribute value in the study.
    • The MethodOID attribute may be used on the ItemGroupRef or ItemRef elements.
    • MethodDefs associated with ItemRefs may only return a single value.
    • MethodDefs associated with ItemGroupRefs must return one value per ItemRef.

AttributeSchema Datatype or EnumerationUsageDefinitionBusiness Rules
OIDoidRequiredUnique identifer for the MethodDef element.The OID attribute value must be unique within the Study/MetaDataVersion.
NamenameRequiredHuman 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.
CommentOIDoidrefOptionalReference to a CommentDef with information related to this MethodDef.Must match the OID attribute of a CommentDef element within in this Study/MetaDataVersion.

Example: MethodDef Examples

MethodDef
<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>

Example: BMI MethodDef Example

BMI MethodDef Example
            <!-- Value Level Metadata -->
            <ValueListDef OID="VL.VS.VSORRES">
                <ItemRef ItemOID="IT.VS.VSORRES.DIABP" OrderNumber="1" Mandatory="Yes">
                    <Origin Type="Collected" Source="Investigator">
                        <DocumentRef leafID="LF.acrf">
                            <PDFPageRef PageRefs="11" Type="PhysicalRef"/>
                        </DocumentRef>
                    </Origin>
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.DIABP"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSORRES.FRMSIZE" OrderNumber="2" Mandatory="No">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.FRMSIZE"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSORRES.HEIGHT" OrderNumber="3" Mandatory="Yes">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.HEIGHT"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSORRES.PULSE" OrderNumber="4" Mandatory="No">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.PULSE"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSORRES.SYSBP" OrderNumber="5" Mandatory="Yes">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.SYSBP"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSORRES.WEIGHT" OrderNumber="6" Mandatory="Yes">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.WEIGHT"/>
                </ItemRef>
            </ValueListDef>

            <ValueListDef OID="VL.VS.VSSTRESC">
                <ItemRef ItemOID="IT.VS.VSSTRESC.DIABP" OrderNumber="1" Mandatory="Yes">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.DIABP"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSSTRESC.FRMSIZE" OrderNumber="2" Mandatory="No">
                    <Origin Type="Collected" Source="Investigator">
                        <DocumentRef leafID="LF.acrf">
                            <PDFPageRef PageRefs="11" Type="PhysicalRef"/>
                        </DocumentRef>
                    </Origin>
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.FRMSIZE"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSSTRESC.HEIGHT" OrderNumber="3" Mandatory="Yes">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.BMI"/>
                </ItemRef>
            </ValueListDef>

            <ValueListDef OID="VL.VS.VSSTRESN">
                <ItemRef ItemOID="IT.VS.VSSTRESN.DIABP" OrderNumber="1" Mandatory="Yes">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.DIABP"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSSTRESN.HEIGHT" OrderNumber="3" Mandatory="Yes">
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.HEIGHT"/>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSSTRESN.BMI" OrderNumber="7" Mandatory="Yes"
                    MethodOID="MT.BMISN">
                    <Origin Type="Derived" Source="Sponsor">
                        <Description>
                            <TranslatedText xml:lang="en" type="text/plain">EDC
                                System</TranslatedText>
                        </Description>
                        <DocumentRef leafID="LF.acrf">
                            <PDFPageRef PageRefs="11" Type="PhysicalRef"/>
                        </DocumentRef>
                    </Origin>
                    <WhereClauseRef WhereClauseOID="WC.VS.VSTESTCD.BMI"/>
                </ItemRef>
            </ValueListDef>

            <!-- Dataset Definition (VS) -->
            <ItemGroupDef OID="IG.VS" Domain="VS" Name="VS" Type="Dataset" Repeating="Simple" IsReferenceData="No"
                Structure="One record per vital sign measurement per visit per subject"
                Purpose="Tabulation" ArchiveLocationID="LF.VS">
                <Description>
                    <TranslatedText xml:lang="en" Type="text/plain">Vital Signs</TranslatedText>
                </Description>
                <Class Name="FINDINGS"/>
                <ItemRef ItemOID="IT.STUDYID" Mandatory="Yes" OrderNumber="1" KeySequence="1"/>
                <ItemRef ItemOID="IT.VS.DOMAIN" Mandatory="Yes" OrderNumber="2"/>
                <ItemRef ItemOID="IT.USUBJID" Mandatory="Yes" OrderNumber="3" KeySequence="2"
                    MethodOID="MT.USUBJID"/>
                <ItemRef ItemOID="IT.VS.VSORRES" Mandatory="No" OrderNumber="8">
                    <Origin Type="Collected" Source="Investigator">
                        <DocumentRef leafID="LF.acrf">
                            <PDFPageRef PageRefs="11" Type="PhysicalRef"/>
                        </DocumentRef>
                    </Origin>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSORRESU" Mandatory="No" OrderNumber="9">
                    <Origin Type="Collected" Source="Investigator">
                        <DocumentRef leafID="LF.acrf">
                            <PDFPageRef PageRefs="11" Type="PhysicalRef"/>
                        </DocumentRef>
                    </Origin>
                </ItemRef>
                <ItemRef ItemOID="IT.VS.VSSTRESC" Mandatory="Yes" OrderNumber="10"
                    MethodOID="MT.VSSTRESC"/>
                <ItemRef ItemOID="IT.VS.VSSTRESN" Mandatory="No" OrderNumber="11"
                    MethodOID="MT.VSSTRESN"/>
                <ItemRef ItemOID="IT.VS.VSSTRESU" Mandatory="No" OrderNumber="12"/>
                <Alias Context="SAS" Name="VS"/>
                <Leaf ID="LF.VS" xlink:href="vs.xpt">
                    <Title>vs.xpt</Title>
                </Leaf>
            </ItemGroupDef>

            <ItemDef OID="IT.VS.VSORRES" Name="VSORRES" DataType="text" Length="30">
                <Description>
                    <TranslatedText xml:lang="en" Type="text/plain">Result or Finding in Original
                        Units</TranslatedText>
                </Description>
                <ValueListRef ValueListOID="VL.VS.VSORRES"/>
                <Alias Context="SAS" Name="VSORRES"/>
            </ItemDef>
            <ItemDef OID="IT.VS.VSORRESU" Name="VSORRESU" DataType="text" Length="20">
                <Description>
                    <TranslatedText xml:lang="en" Type="text/plain">Original Units</TranslatedText>
                </Description>
                <ValueListRef ValueListOID="VL.VS.VSORRESU"/>
                <Alias Context="SAS" Name="VSORRESU"/>
            </ItemDef>
            <ItemDef OID="IT.VS.VSORRES.DIABP" Name="VSORRES1" DataType="integer" Length="2">
                <Description>
                    <TranslatedText xml:lang="en" Type="text/plain">Diastolic Blood Pressure in Orig
                        U</TranslatedText>
                </Description>
                <Alias Context="SAS" Name="DIABPOR"/>
            </ItemDef>
            <ItemDef OID="IT.VS.VSORRES.FRMSIZE" Name="VSORRES2" DataType="text" Length="6">
                <Description>
                    <TranslatedText xml:lang="en" Type="text/plain">Body Frame Size -
                        Orig</TranslatedText>
                </Description>
                <CodeListRef CodeListOID="CL.SIZE"/>
                <Alias Context="SAS" Name="FRMSZOR"/>
            </ItemDef>
            <ItemDef OID="IT.VS.VSSTRESN.BMI" Name="VSSTRESN6" DataType="float" Length="6"
                DisplayFormat="6.2">
                <Description>
                    <TranslatedText xml:lang="en" Type="text/plain">BMI Num in Std
                        U</TranslatedText>
                </Description>
                <Alias Context="SAS" Name="BMISN"/>
            </ItemDef>

            <MethodDef OID="MT.BMISC" Name="Algorithm to derive BMISC" Type="Computation">
                <Description>
                    <TranslatedText xml:lang="en" Type="text/plain">character value of
                        VSSTRESN</TranslatedText>
                </Description>
                <FormalExpression Context=">=SAS 9.0">
                    <Code>putc(bmi_numeric_value,best.)</Code>
                </FormalExpression>

                <FormalExpression Context="R">
                    <Code>toString(bmi_numeric_value, witdth=NULL)</Code>
                </FormalExpression>
            </MethodDef>

            <MethodDef OID="MT.BMISN" Name="Algorithm to derive BMISN" Type="Computation">
                <Description>
                    <TranslatedText xml:lang="en" Type="text/plain">round((VSSTRESN for weight/
                        (VSSTRESN for height / 100)^2), .01). Note: height and weight at the closest
                        visit collected.</TranslatedText>
                </Description>
                <FormalExpression Context="SAS 9.0+">
                    <Code>%bmisn_versionx(weight=retrieved_weight_closest_visit,height=retrieved_height_closest_visit)</Code>
                </FormalExpression>
                <FormalExpression Context="SAS 9.0+">
                    <Code>%bmisn_versiony(weight=retrieved_weight_closest_visit,height=retrieved_height_closest_visit)</Code>
                </FormalExpression>
            </MethodDef>

            <Leaf ID="LF.acrf" xlink:href="acrf.pdf">
                <Title>Annotated CRF</Title>
            </Leaf>

  • No labels