From: Murray, Joe
Sent: Friday, February 09, 2007 4:18 PM
To: Greg Wagner
Subject: Question for Derived Data Fields

Hi Greg,

Thanks for taking the time to talk with us about the derived fields issue. Here is a summary of how we would like the data to ultimately appear in the dataset:

We created variables of SUBJID, USUBJID and VISITNUM at the data structure level, but these are not present on the data entry screens. We want the ClinPlus default variables of INVESTIGATORNUMBER (i.e., 801) and PATIENTNUMBER (i.e., 001) to be concatenated into our variable SUBJID (i.e. 801-001).

Also, we need our variable USUBJID to be populated with a 3 digit study code, in addition to investigator and patient numbers (i.e. 008-801-001).

Also, we need our own numeric variable of VISITNUM to be populated with the same value as the default character variable VISITNUMBER. So the data would appear as:

INVESTIGATOR NUMBER = 801 PATIENT NUMBER = 001 SUBJID = 801-001 USUBJID = 008-801-001 VISITNUMBER = 1 (character) VISITNUM = 1 (numeric)

Thanks,
Joe

-------------------------------------------------------------------------

From: Greg Wagner
Sent: Monday, February 12, 2007 6:02 PM
To: Murray, Joe
Subject: Question for Derived Data Fields

Hi Joe,

To accomplish what you are trying to do, you could either add code directly to the onLoad() method of the screen or in a macro. Since the same action needs to be applied to many screens, it is best to use the macro approach. I am attaching the macro I used to accomplish this. This can be stored in either a Global, Source or Study level macro library. Basically, by using a macro, all you would need to do is add the fields to your screens, set some properties and add the macro call - %sclSetFields;

Here is how you would set this up.
  • Place the sclSetFields.sas file in a macro library
  • Make sure the required fields (SUBJID, USUBJID and VISITNUM) exist on the data structures.
  • Add the fields to your screen definition and Text field objects to the screen layout.
  • Set the properties for each of the derived fields as follows
  • Protected=’Yes’
  • Validate=’No’