Article
· Nov 16, 2018 2m read

Data Verifier for InterSystems Data Platforms

The data model of your solution based on InterSystems platforms constantly changes over time. But what do you do with the data that was entered before? Back then, the data was valid, but what’s happening to it now after a number of data model changes? The answer to this question can be provided by the IDP DV tool that checks the property data of persistent and serial classes according to the types of these properties. In case any discrepancies are found, the tool generates a detailed error report for the user.

Capabilities

IDP DV offers three methods of scanning classes:

  • Scanning of all classes
  • Scanning of all the subclasses of the class
  • Scanning of all classes corresponding to the SQL mask

Usage

To install the tool, just download and import its classes from the repository into the necessary namespace and call the corresponding function.

s st = ##class(IDP.DV).ScanAllClasses(.Oid)   //for all classes     
s st = ##class(IDP.DV).ScanSubclassesOf(Class, .Oid)  //for subclasses    
s st = ##class(IDP.DV).ScanMatchingClasses(Mask, .Oid)  //for SQL

where:

Oid — the output structure saving data about unacceptable objects in the classes
Class — scanning of all subclasses of the class (and the class itself)
Mask — a parameter of the “SELECT ID FROM %Dictionary.ClassDefinition Where ID LIKE ?” SQL query

Example

For our example, let’s use the Sample.Person class and the ScanSubclassesOf method. Let’s start this method without making any changes to it and with making a single change in one of its properties.

No changes

SAMPLES>s st =  ##class(IDP.DV).ScanSubclassesOf("Sample.Person", .Oid)

Sample.Employee has 0 invalid objects

Sample.Person has 0 invalid objects

Having changed the Name property from string to integer:

SAMPLES>s st =  ##class(IDP.DV).ScanSubclassesOf("Sample.Person", .Oid)

Class: Sample.Person
Object: 1
-----------------------------------------------------------------
ERROR #7207: The value of the ‘Ramsay, Jeff X.” data type is not a valid number
     > ERROR #5802: Checking of the data type failed for property ‘Sample.Employee:Name’ with the value equal to “Ramsay, Jeff X.”

...

Class: Sample.Person
Object: 200
----------------------------------------------------------------
ERROR #7207: The value of the ‘Kovalev,Howard F.’ is not a valid number
     > ERROR #5802 Checking of the data type failed for property ‘Sample.Employee:Name’ with the value equal to “Kovalev, Howard F.”

Comments and suggestions are very much welcome.
The application with source code and documentation is available on Open Exchange

Discussion (2)1
Log in or sign up to continue