Download 6 Performing Data Capture
Transcript
Using Scripts to Enhance Your Data Capture FieldNames FieldValues begin GlobalData FieldValue FieldNames FieldValues 21 : Variant; : Variant; := := := := VarArrayGet( VarArrayGet( VarArrayGet( VarArrayGet( Params, Params, Params, Params, [1] [2] [3] [4] ); ); ); ); Result := StrUpper(FieldValue); end; begin end. Calculate the current field from a value entered in another field For this example, you will require the 5th field to be called 'Max Heart Rate' and contain a numeric value. The script should be applied to a different field, which will also be a numeric field, and will be flagged as "Calculated Value" To apply this transformation to a field, go to the field and click on the "Transform value script" button to paste in the following: function TransformValue( const Params : Variant ) : Variant; var GlobalData : Variant; FieldValue : Variant; FieldNames : Variant; FieldValues : Variant; HeartRate : Variant; begin GlobalData FieldValue FieldNames FieldValues := := := := VarArrayGet( VarArrayGet( VarArrayGet( VarArrayGet( Params, Params, Params, Params, [1] [2] [3] [4] ); ); ); ); HeartRate := FieldValueByIndex( FieldNames, FieldValues, 5, 'Max Heart Rate' ); Result := HeartRate * 10; end; begin end. 8.2 EDC Data Capture API Reference Here is the list of types, constants & functions (API) that the EDC Data Capture software makes available to you when scripting. Some come from DocuData while others come from Object Pascal (Delphi) and some from the Jedi library. DocuData API © 2010 DocuData Software Corporation