VA FileMan V. 22.0 Getting Started HTML Manual Banner


 

Main Chapter Getting Started Manual Programmer Manual

Creating Files and Fields


Creating Fields

For any file, you can create fields describing logically related data that pertains to entries in that file. When created, every file automatically receives one field: a NAME field (the #.01 field). You must explicitly define any other fields. All such definitions are made (and changed) with the Modify File Attributes option.

When you create a file, after you give the new file a name, you are asked:

    Select FIELD:

Enter a new field name and respond with YES when VA FileMan asks:

    Are you adding 'xxxxxxxx' as a new FIELD?

The "xxxxxxxx" represents the name of the field you entered. After answering YES to this prompt, you are now ready to specify what sort of data the new field will contain. A field can only be one type of data; the choices are listed in the following section.

Field Data Types

There are nine Data Types:

No. Data Type Description
1 DATE/TIME Dates with or without time stamps.
2 NUMERIC NUMERIC Data Types, including dollar values.
3 SET OF CODES Codes that represent values (e.g., 1=MALE/2=FEMALE).
4 FREE TEXT A single alphanumeric string of characters.
5 WORD-PROCESSING A Multiline document of text.
6 COMPUTED A virtual field, values not stored.
7 POINTER TO A FILE Referencing an entry in some other file.
8 VARIABLE-POINTER Referencing an entry in a defined set of files.
9 MUMPS Used by programmers to enter M code.

You are asked for the Data Type of any field you are creating. You must pick one of these nine choices. Data validation checks are then asked depending on the Data Type entered. For some Data Types, a default "HELP" prompt is automatically composed.

NOTE: You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. For examples of entering a field attributes in Screen Mode, please refer to the "Examples of File and Field Creation" topic that follows.


Screen Mode Field Editing 

When using the Modify File Attributes option you can make your field entries in the traditional Scrolling Mode or choose to create, modify, or review a file's field attributes easily by running the Modify File Attributes option in Screen Mode.

To make your entries in Screen Mode, simply press the Enter/Return key to accept the default response at the "DO YOU WANT TO USE THE SCREEN-MODE VERSION? Yes//" prompt.

The following example illustrates using Screen Mode when editing the .01 field of the ORDER file (#100):

 

Select OPTION: MODIFY FILE ATTRIBUTES  
DO YOU WANT TO USE THE SCREEN-MODE VERSION? Yes// (Yes)

MODIFY WHAT FILE: ORDER

Select FIELD: .01 ORDER #

You will then be taken into Screen Mode where you can edit the properties of the field, as shown below:

Example of Editing Properties of a Field in Screen Mode.

Using the Screen Mode version of this option, after entering the field name or number (e.g., .01 field) after the "Select FIELD:" prompt, you are presented with a ScreenMan form (screen) that can be reviewed and edited like any other. In this example, the most important field on this screen is the Data Type field in the upper right corner; it is a required entry. In this example, required entries in Screen Mode are indicated by a caption with a different color and an underline.

NOTE: Screen Mode highlights the captions for required fields with an underline. However, depending on your terminal or terminal emulator software and your personal preferences, the form of the highlight can vary (e.g., some emulators will highlight required field captions in reverse video, a different color, with an underline, or any combination of highlights).

In this case, the Data Type field has been defined as NUMERIC and is not editable as indicated by the message displayed near the bottom of the screen (i.e., "NOTE THAT THIS FIELD'S DEFINITION IS NOT EDITABLE"); this is because a programmer has previously edited the definition in a special way. However, unlike the Data Type field, the value of the HELP-PROMPT field (i.e., "Enter the Order number."), which is the message that is displayed to users when they enter a single question mark ("?") while editing the ORDER # field, can be edited. The DESCRIPTION and TECHNICAL DESCRIPTION fields are multi-line WORD-PROCESSING fields; to edit them, press the Enter/Return key and a separate screen opens (i.e., a "pop-up" window). The DESCRIPTION is displayed to users who enter two question marks ("??") while editing the ORDER # field. The TECHNICAL DESCRIPTION, however, is for internal documentation only.


DATE/TIME Data Type

A Data Type defined as DATE/TIME allows you to enter a minimum and maximum date. You can also indicate whether the date can be entered with an imprecise date (e.g., JUL 1969) or with the time-of-day (e.g., JUL 20@4). VA FileMan does not accept dates before 1700.

For example, when defining a DATE/TIME Data Type, you are asked the following questions:

Select FIELD: DATE OF BIRTH
  Are you adding 'DATE OF BIRTH' as a new FIELD? No// Y   (Yes)

DATA TYPE OF DATE OF BIRTH: DATE/TIME
EARLIEST DATE (OPTIONAL): 1/1/1860 (JAN 01, 1860)
LATEST DATE: 1963 (1963)
CAN DATE BE IMPRECISE (Y/N): YES// CAN TIME OF DAY BE ENTERED (Y/N): NO// NO

If you reply YES to the "CAN TIME OF DAY BE ENTERED (Y/N): NO//" prompt, you would then be asked "CAN SECONDS BE ENTERED?".

WILL DATE OF BIRTH FIELD BE MULTIPLE:  No//   (No) 
IS DATE OF BIRTH ENTRY MANDATORY (Y/N): NO// Y YES
...
'HELP'-PROMPT: TYPE A DATE BETWEEN 1/1/1860 AND 1963
Replace DESCRIPTION: 1>

A default Help prompt is automatically written for you with the DATE/TIME Data Type. You can change this prompt using the "Replace ... With" syntax.

NOTE: This Help information is displayed when the user inputs a single question mark ("?") when editing this field.

You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. Thus, we have also provided an example of entering a DATE/TIME Data Type in Screen Mode


NUMERIC Data Type

A Data Type defined as NUMERIC requires you to enter the lowest and highest values allowed, the maximum number of decimal digits allowed, and to state whether dollar values are allowed (e.g., $33).

For example, when defining a NUMERIC Data Type, you are asked the following questions:

Select FIELD: AGE AT ONSET   
Are you adding 'AGE AT ONSET' as a new FIELD? No// Y (YES)

DATA TYPE OF AGE AT ONSET: NUMERIC
INCLUSIVE LOWER BOUND: 0 INCLUSIVE UPPER BOUND: 100
IS THIS A DOLLAR AMOUNT (Y/N): NO//

If you answer YES at the "IS THIS A DOLLAR AMOUNT (Y/N):" prompt, VA FileMan would allow users to precede input data with a dollar sign ("$") and show up to two decimal places.

MAXIMUM NUMBER OF FRACTIONAL DIGITS: 0//  
WILL AGE AT ONSET FIELD BE MULTIPLE? No// (No)
IS AGE AT ONSET ENTRY MANDATORY (Y/N): NO// NO
....
'HELP'-PROMPT: Type a Number between 0 and 100, 0 Decimal Digits
Replace DESCRIPTION: 1>

A default Help prompt is automatically written for you with the NUMERIC Data Type. You can change this prompt using the "Replace ... With" syntax.

NOTE: This Help information is displayed when the user inputs a single question mark ("?") when editing this field.

You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. Thus, we have also provided an example of entering a NUMERIC Data Type in Screen Mode


SET OF CODES Data Type

A Data Type defined as a SET OF CODES can be used to restrict a user to just a few possible values (e.g., YES or NO). When defining a SET OF CODES Data Type, enter a valid code and a translation of what each code means. The user can enter the code, the full meaning, or a portion of the full meaning. If the field is set up to require only a one-character response (as shown in the example below), this Data Type can simplify the user's data entry.

VA FileMan has only a limited amount of space to store the codes and their external values. If the limit is exceeded, you are told "TOO MUCH!!--SHOULD BE A 'POINTER', NOT 'SET'." The SET OF CODES Data Type is sometimes referred to as a SET.

For example, when defining a SET OF CODES Data Type, you are asked the following questions:

Select FIELD: SEX
  Are you adding 'SEX' as a new FIELD? No// Y   (Yes)  

DATA TYPE OF SEX: SET OF CODES
INTERNALLY-STORED CODE: m WILL STAND FOR: MALE
INTERNALLY-STORED CODE: f WILL STAND FOR: FEMALE
INTERNALLY-STORED CODE: WILL SEX FIELD BE MULTIPLE: No// (No)
IS SEX ENTRY MANDATORY (Y/N): No// Y YES
...
'HELP'-PROMPT: DESCRIPTION: 1>

In this example, "m" stands for Male and "f" stands for Female. Numbers as well as alphabetic characters can be used.

You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. Thus, we have also provided an example of entering a SET OF CODES Data Type in Screen Mode


FREE TEXT Data Type

A Data Type defined as FREE TEXT allows you to enter the maximum and minimum allowable string length of the FREE TEXT data. You can also enter an M PATTERN MATCH that input data will have to match.

For example, when defining a FREE TEXT Data Type, you are asked the following questions:

Select FIELD: DIAGNOSIS
  Are you adding 'DIAGNOSIS' as a new FIELD? No// Y   (Yes)

DATA TYPE OF DIAGNOSIS: FREE TEXT
MINIMUM LENGTH: 3 MAXIMUM LENGTH: 30
(OPTIONAL) PATTERN MATCH (IN 'X'):

The PATTERN MATCH is written in M code. If input data violates the PATTERN MATCH or the Minimum/Maximum lengths, the data is not accepted and the user is shown the Help prompt information.

WILL DIAGNOSIS FIELD BE MULTIPLE? No// Y   (Yes)
IS DIAGNOSIS ENTRY MANDATORY(Y/N): NO// NO
SHOULD USER SEE AN "ADDING A NEW DIAGNOSIS?" MESSAGE FOR NEW
ENTRIES (Y/N): N NO
HAVING ENTERED OR EDITED ONE DIAGNOSIS, SHOULD USER BE ASKED
ANOTHER (Y/N): Y YES

With these specifications, the user is not given a confirming message when new subentries are added to the Multiple. The user is allowed to enter several diagnoses in a row for a given patient.

....
....
'HELP'-PROMPT: Answer must be 3-30 characters in length.
Replace DESCRIPTION: 1>

A default Help prompt is automatically written for you with the FREE TEXT Data Type. You can change this prompt using the "Replace ... With" syntax.

NOTE: This Help information is displayed when the user inputs a single question mark ("?") when editing this field.

You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. Thus, we have also provided an example of entering a FREE TEXT Data Type in Screen Mode


WORD-PROCESSING Data Type

A Data Type defined as a WORD-PROCESSING field allows entry of unlimited free-text data. The data can be edited, formatted, and printed with word processing text editors.

NOTE: For a description of VA FileMan's native text editors, please refer to the "Screen Editor" and "Line Editor" chapters in the "VA FileMan Getting Started Manual."

For example, when defining a WORD-PROCESSING Data Type, you are asked the following questions:

Select FIELD: HISTORY
  Are you adding 'HISTORY' as a new FIELD? No// Y   (Yes) 

DATA TYPE OF HISTORY: WORD-PROCESSING SHALL THIS TEXT NORMALLY APPEAR IN WORD-WRAP MODE? Yes// (Yes)
....
....
'HELP'-PROMPT: SUBJECTIVE NARRATIVE OF PATIENT'S PROBLEM HISTORY DESCRIPTION: 1>

If you answer YES to the "SHALL THIS TEXT NORMALLY APPEAR IN WORD-WRAP MODE" question, text is automatically wrapped at word boundaries to fit in the column in which it is being printed. Usually, this is the preferred way to print text. However, when it is important that lines of text be printed exactly as they were entered, answer NO to the "SHALL THIS TEXT NORMALLY APPEAR IN WORD-WRAP MODE" question. Thus, text is output in no-wrap mode. You would probably want a spreadsheet or a restaurant menu printed in no-wrap mode.

NOTE: If the column in which no-wrap text is being printed is too short to accommodate the line of text, your printer may break the line in the middle of words or otherwise destroy the formatting of the text.

You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. Thus, we have also provided an example of entering a WORD-PROCESSING Data Type in Screen Mode


COMPUTED Data Type

When a Data Type is defined as COMPUTED its value is determined at the time the field is accessed. This computation is based on an expression stored in the data dictionary. The field value (or data) itself is not stored in the data dictionary. The COMPUTED expression is constructed using field names, literals or constants, functions, and operators. These elements are explained fully in the "Computed Expressions" chapter in this manual.

NOTE: The functions referred to above are VA FileMan functions stored in the FUNCTION file (#.5), not M functions. A developer with programmer access can also enter M code in a COMPUTED field. The M code must set the variable "X" to the COMPUTED field value.

For example, when defining a COMPUTED Data Type, you are asked the following questions:

Select FIELD: AGE
  Are you adding 'AGE' as a new FIELD? No// Y   (Yes)

DATA TYPE OF AGE: COMPUTED

'COMPUTED-FIELD' EXPRESSION: TODAY-(DATE OF BIRTH)\365.25 .... NUMBER OF FRACTIONAL DIGITS TO OUTPUT (ONLY ANSWER IF NUMBER-VALUED): 2

For this example, we assume the DATE OF BIRTH field was previously created. Thus, we can reference it in the " 'COMPUTED-FIELD' EXPRESSION". Also, the "NUMBER OF FRACTIONAL DIGITS TO OUTPUT" question is asking whether you should enter the number of digits that should normally appear to the right of the decimal point when this field is displayed.

SHOULD VALUE ALWAYS BE INTERNALLY ROUNDED TO 2 DECIMAL PLACES? No// Y
(Yes)
WHEN TOTALLING THIS FIELD, SHOULD THE SUM BE COMPUTED FROM
THE SUMS OF THE COMPONENT FIELDS? No// (No)
LENGTH OF FIELD: 8//

You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. Thus, we have also provided an example of entering a COMPUTED Data Type in Screen Mode


POINTER TO A FILE Data Type

A Data Type defined as a POINTER TO A FILE requires you to enter the name or number of the pointed-to file and that file must already exist (defined previously).

For example, when defining a POINTER TO A FILE Data Type, you are asked the following questions:

Select FIELD: RELIGION
  Are you adding 'RELIGION' as a new FIELD? No// Y   (Yes)

DATA TYPE OF RELIGION: POINTER TO A FILE
POINT TO WHICH FILE: RELIGION

The file that is pointed to must already exist on your system. If you enter a single question mark ("?") at the "POINT TO WHICH FILE:" prompt, you will be presented with a list of the available files.

SHOULD 'ADDING A NEW RELIGION FILE ENTRY' ("LAYGO") 
BE ALLOWED WHEN ANSWERING THE 'RELIGION' QUESTION? No// (No)

By answering NO to this prompt, users who are editing patient data are not able to add a new entry on the fly to the RELIGION file. This prompt depends on whether you have LAYGO access to the file or not.

WILL RELIGION FIELD BE MULTIPLE? No//   (No)
IS RELIGION ENTRY MANDATORY (Y/N): NO// NO
....
'HELP'-PROMPT: DESCRIPTION: 1>

You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. Thus, we have also provided an example of entering a POINTER TO A FILE Data Type in Screen Mode


VARIABLE-POINTER Data Type

A Data Type defined as a VARIABLE-POINTER (as with the POINTER TO A FILE Data Type) requires you to enter the names or numbers of the pointed-to files and those files must already exist (defined previously). Additionally, an order, message, and prefix must be associated with each file.

For example, when defining a VARIABLE-POINTER Data Type, you are asked the following questions:

Select FIELD: PROVIDER
  Are you adding 'PROVIDER' as a new FIELD? No// Y   (Yes)  

DATA TYPE OF PROVIDER: VARIABLE-POINTER Select VARIABLE POINTER: PROVIDER


You answer the "Select VARIABLE POINTER:" prompt with the name or number of an existing file.

Are you adding 'PROVIDER' as a new VARIABLE-POINTER? No// Y   (Yes)

VARIABLE-POINTER: PROVIDER// MESSAGE: Staff Provider
ORDER: 1
PREFIX: S SHOULD USER BE ALLOWED TO ADD A NEW ENTRY: NO NO

The MESSAGE is part of the online Help associated with the VARIABLE-POINTER field when a single question mark ("?") is entered during editing. In this example, the PROVIDER file MESSAGE is associated with "Staff Provider."

The several pointed-to files are searched based on their ORDER. In this example, since the ORDER for the PROVIDER VARIABLE-POINTER is one, the PROVIDER file is the first file searched.

The PREFIX field is used to reference a particular pointed-to file. To see the entries in a particular file, you would enter that file's PREFIX followed by a period and a question mark at the VARIABLE-POINTER's field name (e.g., in this example, entering "S.?" would give you the option to list the entries in the PROVIDER file). If you want to refer to only one of the several pointed-to files, put that file's PREFIX followed by a period at the VARIABLE-POINTER's field name (e.g., in this example, entering "S." would refer you to the PROVIDER file).

By answering NO to the "SHOULD USER BE ALLOWED TO ADD A NEW ENTRY:" prompt, the user is not allowed to add new entries on the fly to the PROVIDER file (the same as the RELIGION field entered as a POINTER TO A FILE). If you had answered YES, then new entries could be added to the PROVIDER file.

Select VARIABLE-POINTER: 16   PERSON 
Are you adding 'PERSON' as a new VARIABLE-POINTER? (the 2ND)? No// Y (Yes)
VARIABLE-POINTER: PERSON// MESSAGE: Other Provider
ORDER: 2 PREFIX: O SHOULD USER BE ALLOWED TO ADD A NEW ENTRY: YES YES

In this example, a second VARIABLE-POINTER was created to the PERSON file (#16). By answering YES to the "SHOULD USER BE ALLOWED TO ADD A NEW ENTRY:" prompt, users who are editing patient data are allowed to add entries to the PERSON file.

Select VARIABLE-POINTER: 

You stop identifying files for a VARIABLE-POINTER by simply pressing the Enter/Return key without any additional entries at the "Select VARIABLE-POINTER:" prompt.

WILL PROVIDER FIELD BE MULTIPLE?  No//   (No) 
IS PROVIDER ENTRY MANDATORY (Y/N): NO// NO
'HELP'-PROMPT: DESCRIPTION: 1>

After entering both VARIABLE-POINTERS, when you enter a single question mark ("?") at the "PROVIDER" field prompt, you will see the following Help message:

PROVIDER: ?
     Enter one of the following:
       S.EntryName to select a Staff Provider
       O.EntryName to select a Other Provider
 
     To see the entries in any particular file type <Prefix.?> 

In this example, if you simply enter a name at the "PROVIDER:" prompt, then the system will search each of the VARIABLE-POINTER field files for the name you have entered. If a match is found, the system will ask you if it is the correct entry. However, if you know the file the entry should be in, then you can speed processing by using the following syntax to select an entry:

NOTE: You do not need to enter the entire file name or message to direct the lookup. Using the first few characters will suffice.

You can review and change a file's field attributes easily by running the Modify File Attributes option in Screen Mode. Thus, we have also provided an example of entering a VARIABLE-POINTER Data Type in Screen Mode


MUMPS Data Type

Those with programmer access can define a field as a MUMPS Data Type. This Data Type is designed specifically to contain executable M code. The code entered into this kind of field is verified to be valid M code that conforms to VA programming standards.

MUMPS Data Type fields are usually used in files that are part of developer tools systems. For example, the OPTION file (#19) is part of the MENU MANAGEMENT system used in the VA for assigning menus and associated actions to each computer user. The ENTRY ACTION field on the OPTION file is defined as a MUMPS type field. This field allows a developer who is creating an option to enter M code to do any setup and initialization that is needed before the end user can do the action allowed by the option.

 


Reviewed/Updated: March 4, 2007