VA FileMan V. 22.0 Getting Started HTML Manual Banner


 

Main Chapter Getting Started Manual Programmer Manual

File Utilities


MSCINPUT TRANSFORM/CONSISTENCY-CHECK

Consistency checks on a given field can be entered by developers without using MUMPS code.  There can be any number of consistency checks on a given field. Each is evaluated (true/false) whenever data for the field is entered via FileMan (ENTER/EDIT Option, ScreenMan, Database Server APIs)    If any of the Consistency Checks evaluate as FALSE, the data change is not allowed.  Consistency checks are also made during the VERIFY Option.

A consistency check is in the form of a Boolean-valued Computed Expression.

Example 1: Suppose we want to ensure that when a user enters a value for Field #10 in the PACKAGE File, that value contains a "/" character.  In Computed-Field syntax, the "[" operator means "contains".  Note that after we enter the Consitency Check, FileMan will offer to show which of the current values of Field 10 do not obey the rule that we have just entered.

Select OPTION:    UTILITY FUNCTIONS
Select UTILITY OPTION:    INPUT TRANSFORM/CONSISTENCY-CHECK

Modify what File: PACKAGE           (125 entries)
Select FIELD:    DEVELOPER (PERSON/SITE)
Do you wish to create a new Consistency-Check for the 'DEVELOPER (PERSON/SITE)' Field? No// Y
  (Yes)
Internal number of check being created:  (1-9999999999): 1//

Using 'DEVELOPER (PERSON/SITE)' to refer to this Field's value,
enter an expression which must be true for this Field to be considered properly validated:
   DEVELOPER (PERSON/SITE)["/"

By 'DEVELOPER ', do you mean PACKAGE  'DEVELOPER (PERSON/SITE)'? Yes//   (Yes)
WARNING--EXPRESSION DOESN'T MENTION ANOTHER FIELD BESIDES 'DEVELOPER (PERSON/SITE)'!
Now please enter a message corresponding to this check
      > MUST HAVE A SLASH IN THE ANSWER
<DONE>


SINCE YOU HAVE CHANGED THE FIELD DEFINITION,
EXISTING 'DEVELOPER (PERSON/SITE)' DATA WILL NOW BE CHECKED FOR INCONSISTENCIES
OK? Yes//   (Yes)
...
VERIFY FIELDS REPORT
PACKAGE
FILE
(#9.4)                              
JAN 18, 2019  17:25    PAGE 1
-------------------------------------------------------------------------------
--FIELD #10 DEVELOPER (PERSON/SITE)--  (FREE TEXT)

ENTRY#   
NAME                         
ERROR

4         MAILMAN
           
'WASHINGTON ISC' DATA INCONSISTENCY: MUST HAVE A SLASH IN THE ANSWER
42        HEALTH SUMMARY
           
'SALT LAKE CITY' DATA INCONSISTENCY: MUST HAVE A SLASH IN THE ANSWER
.....

Example 2: The Computed Expression might simply check for the presence of a value in another field.  Remember that in a Computed Expression, a field can be referred to by its number.  Suppose we want to make sure that, in the PATIENT File, Field #.1411 must be filled in before a user can enter a value for Field #.14112.  Saying that .1411 is "filled in" is equivalent to saying that it is "not null".

Select OPTION: UTILITY FUNCTIONS
Select UTILITY OPTION:  INPUT TRANSFORM/CONSISTENCY-CHECK

Modify what File: PATIENT          (2497 entries)
Select FIELD:    CONFIDENTIAL ADDR CHANGE DT/TM

Do you wish to create a new Consistency-Check for the 'CONFIDENTIAL ADDR CHANGEDT/TM' Field? No// Y  (Yes)
Internal number of check being created:  (1-9999999999): 1//

Using 'CONFIDENTIAL ADDR CHANGE DT/TM' to refer to this Field's value,
enter an expression which must be true
for this Field to be considered properly validated: #.1411'=""


       Do you want this check made if 'CONFIDENTIAL STREET [LINE 1]' is null? No// Y  (Yes)
WARNING--EXPRESSION DOES NOT MENTION 'CONFIDENTIAL ADDR CHANGE DT/TM'!

Now please enter a message corresponding to this check
      > ADDRESS MUST EXIST
<DONE>



SINCE YOU HAVE CHANGED THE FIELD DEFINITION,
EXISTING 'CONFIDENTIAL ADDR CHANGE DT/TM' DATA WILL NOW BE CHECKED FOR INCONSIST
ENCIES
OK? Yes//  .....

Example 3: It's often desirable to validate a date being input by comparing it with another date.  For example, nothing in a patient's record should be dated as taking place before the patient was born!  The internally-stored dates in FileMan can be compared as numbers, but since the external forms of dates look like "JUL 20,1969", the INTERNAL Function must be used to turn such strings into numbers.  Suppose that we want to check every value of Field .153 to insure it is not earlier than the PATIENT's birth.

Select OPTION: UTILITY FUNCTIONS
Select UTILITY OPTION: 5  INPUT TRANSFORM/CONSISTENCY-CHECK

Modify what File: PATIENT//               (2497 entries)
Select FIELD: .153  MISSING PERSON DATE
Do you wish to create a new Consistency-Check for the 'MISSING PERSON DATE' Field? No// Y   (Yes)
Internal number of check being created:  (1-9999999999): 1//

Using 'MISSING PERSON DATE' to refer to this Field's value,
enter an expression which must be true for this Field to be considered properly validated:
   INTERNAL(MISSING PERSON DATE)>INTERNAL(DOB)

By 'DOB', do you mean PATIENT  'DATE OF BIRTH'? Yes//   (Yes)

       Do you want this check made if 'DATE OF BIRTH' is null? No//   (No)

Now please enter a message corresponding to this check
      > CAN'T BE BEFORE HE WAS BORN
<DONE>



SINCE YOU HAVE CHANGED THE FIELD DEFINITION,
EXISTING 'MISSING PERSON DATE' DATA WILL NOW BE CHECKED FOR INCONSISTENCIES
OK? Yes//  ....

Consistency checks can be considered adjuncts to the Field's Input Transform, which is MUMPS code that FileMan creates internally for a Field when it is created.  If you have programmer access, you can edit a field's Input Transform (or 'syntax checker'), using this same Utility Option.  Answer YES to the question

DO YOU WISH TO EDIT THE MUMPS INPUT TRANSFORM? No//

NOTE: For a detailed description of the INPUT transform, see the "Input Transforms" section in the "VA FileMan Programmer Manual."

 


Reviewed/Updated: January, 2019