Skip to main content

Production Validator

Production Validator helps you confirm that your production interfaces remain valid when you upgrade your InterSystems IRIS for Health® instance. To do so, it extracts HL7 service headers, messages, and operation messages to a temporary database, which you can copy to an upgraded InterSystems IRIS for Health instance to replay. By comparing the original messages to the messages processed on the upgraded system, you can evaluate and address differences.

Given the copying of the service and operation messages, the Production Validator is agnostic to the intermediary transformation logic.

Note:

Production Validator is supported only when both the source instance and the upgraded instance are InterSystems IRIS for Health version 2018.x or later, or the discontinued product InterSystems Ensemble® version 2016.2 or later.

You can access the Production Validator in the terminal. The comparisons are presented in a graphical interface on the Visual Comparison management portal page.

Metrics include the following:

  • Messages that were generated but should not have been.

  • Messages that are missing.

  • Messages that are different in content.

Validate a Production

The general workflow for using the Production Validator to validate your production upgrade is as follows:

Procure and Install Production Validator Code

Production Validator execution requires that the Production Validator code be installed in both the source system and the target system. The most recent version of the Production Validator code comes pre-installed in versions 2025.1 and later. If either your source system or your target system (or both) is older than 2025.1, you will need to download the code and install it as follows:

  1. Go to the WRC Distribution page under ComponentsOpens in a new tab and search for Production Validator.

  2. Download and unzip the Production Validator ZIP file. Make a note of the name of the extracted file and the path to where you save it. Execute the remaining steps for the source system and/or the target system, whichever are older than version 2025.1.

  3. Log in to the IRIS terminal associated with the relevant system, and set the namespace to HSLIB.

    Set $namespace="HSLIB"
    
  4. Write enable the HSLIB database to prepare for loading the Production Validator code.

    write ##class(%ZHSLIB.HealthShareMgr).UpdateReadWrite("HSLIB",0)
    
  5. Set a string variable to identify the filename and path to the Production Validator code.

    set file="<filepath>\<extracted_prod_validator_file>"
    
  6. Load Production Validator code.

    do $system.OBJ.Load(file,"ck")
    
  7. Reset read/write permissions for the HSLIB database.

    write ##class(%ZHSLIB.HealthShareMgr).UpdateReadWrite("HSLIB",1)
    

Gather Baseline Production Data

Follow these steps to create and export a JSON object describing production data stored in the source system database.

  1. In the terminal, switch to the namespace associated with the existing production system. For example, if the production name is TESTING:

    Set $namespace="TESTING"
    
  2. Fetch any paths within the production that have an HL7 service and an HL7 operation, and store them within a template object, to be used for production message comparison.

    set template=##class(HS.InteropTools.HL7.Compare.ProductionExtract).GetServiceList()
    
    
  3. Optional. After creating a template object for production message comparison, you can manipulate the object to configure your eventual results, by setting element values at the terminal command line or by streaming the JSON output into a text file, editing it, and re-importing. See Advanced Options for details.

  4. Using the template object, export source production data to the database in tempDatabaseDir.

    write ##class(HS.InteropTools.HL7.Compare.ProductionExtract).Run(template)
    

    This should return 1, indicating successful data export.

Advanced Options

After creating a template object for production message comparison, you can manipulate the object to configure your eventual results (See relevant step in the “Gather Baseline Production Data” procedure), either by setting properties at the terminal command line or by streaming the JSON output to a text file and adding or editing them, then reloading the template.

If you choose to stream the output to a text file, use these commands:

Set stream = ##class(%Stream.FileCharacter).%New()
Write stream.LinkToFile(filename)
Do template.%ToJSON(stream)

When you have finished adding and editing properties, you can use the following commands to re-import the file:

Set stream = ##class(%Stream.FileCharacter).%New()
Write stream.LinkToFile(filename)
Set template={}.%FromJSON(stream)

You can set the following properties:

additionalGlobals

A comma-delimited list of globals in the globals database to copy to the temp database. For example, My.XYZ.GlobalA, My.XYZ.GlobalB.

additionalRoutineGlobals

A comma-delimited list of globals listed in the routines database, to be copied to temp database. For example, My.XYZ.RoutineGlobalC, My.XYZ.RoutineGlobalD.

from and to

You can set the template.from and template.to elements in the template; these control the time span of data exported. The expected date-time format is YYYY-MM-DDTHH:MM:SS for local time. You can append Z for UTC or an offset (such as +HH:MM or -HH:MM to specify a different time zone.

maxListCount

The number of sessions to be assigned to each worker job. Default is 1000.

percentage

By default, everything is exported. You can reduce output size and times by setting the percentage property to a lower value in the template. Permitted values range from 1 to 100. For example, if you set template.percentage to 10 (indicating 10%), every tenth record will be selected.

tempDatabase and tempDatabaseDir

By default, the generated template will have tempDatabase="COMPARE-"<namespace> (for example, COMPARE-TESTING) and tempDatabaseDir=$system.Util.ManagerDirectory()_tempDatabase (for example, COMPARE-TESTING in the instance manager directory).

You can put the database elsewhere, potentially with a different name, by modifying the values of the tempDatabase and tempDatabaseDir properties.

workerJobs

The workerJobs property can be specified in the template to control the number of background jobs used to process the data. When not specified, the system default number of worker jobs is used. For example, you can specify "workerJobs":0 to not use worker jobs.

exclude

You can skip a particular operation by adding the exclude element with value = 1 in the template. For example, to skip the operation called ADT_OPERATION:

{"name":"ADT_OPERATION","exclude":1}

Re-process Extracted Production Data and Compare

Follow these steps to generate analogous messages in your upgraded system and compare them to the messages generated in your source system.

Prerequisites

  • If you are upgrading from an InterSystems Cache-based system, rename the Cache.DAT file to IRIS.DAT.

  • IMPORTANT: Copy your IRIS.DAT to a new location available to the target system. This will allow you to re-execute the steps on the target if something goes wrong.

Steps

  1. Log in to the IRIS terminal associated with the target system, and set the namespace to HSLIB.

    Set $namespace="HSLIB"
    
  2. Create the namespace for your comparisons, and begin reprocessing messages. Later, the reprocessed messages will be compared to the original messages from the source system.

    set sc = ##class(HS.InteropTools.HL7.Compare.ProductionExtract).ConfigureAndImport(<Testing_Namespace>,<Full_Path>)
    

    Full_Path is the full path to the directory that contains the IRIS.DAT database.

    Testing_Namespace is the name of the testing namespace.

    This process switches you into the new testing namespace.

    Note:

    If the user code is mapped elsewhere or a production item requires additional globals, the code/globals must be brought manually into this instance. In this case, instead of executing the ConfigureAndImport() method, follow these instructions:

    1. Configure the new testing namespace:

      set sc = ##class(HS.InteropTools.HL7.Compare.ProductionExtract).ConfigureNamespace(<Testing_Namespace>,<Full_Path>)
      
    2. Load your code and/or globals manually into the testing namespace.

    3. Switch into the newly created testing namespace and begin reprocessing messages. Later, the reprocessed messages will be compared to the original messages from the source system.

      Set $namespace="<Testing_Namespace>"
      set sc = ##class(HS.InteropTools.HL7.Compare.ProductionExtract).Import()
      
  3. Ensure that the import succeeded by checking the value of the status code variable sc. The value should be 1.

    write sc
    
  4. Execute the comparison of messages from the source system to messages from the upgraded system, and store the results in a variable.

    set stats=##class(HS.InteropTools.HL7.Compare.Compare).Run("Source","Target")
    
  5. View the comparison results.

    zwrite stats
    

    The output includes the following data:

    • compareStartTime—The beginning of the timespan of the comparison.

    • count1—The number of messages in the output from the source system.

    • count2—The number of messages in the output from the upgraded system.

    • missingFiles—The number of messages present in the source system output that are absent in the upgraded system output.

    • newFiles—The number of messages present in the upgraded system output that are absent in the source system output.

    • differences—The number of messages that exist in the output of both systems but that have different contents.

    • kpi—Percentage representing how close the upgraded system’s output is to the output from the source system.

    • compareEndTime—The end of the timespan of the comparison.

    • output—A link to the Visual Comparison page in the management portal, which displays a detailed listing of the differences between the two sets of messages.

  6. To view the output of the comparison on the Visual Comparison page in the management portal, click the link in the output field. This page displays each message in tabular form with issues highlighted. There is also a link to the visual trace. You can use these tools to identify issues. Certain issues may be inevitable or uncorrectable, and the Visual Comparison page features links to filter some of these out of the output.

  7. Optional. You can insert items to be ignored into a skip list table. Items in this table will not be included in the comparison output. Instead, if a field is included in the skip list, the field value is replaced in the output with SLV, which indicates a skip list value. For example, if the only difference between a message from the source system and the corresponding message from the upgrade system is that one is from production and the other is from testing, you might reasonably wish to skip that difference.

    To add an item to the skip list table, execute the following command in the testing namespace:

    Set rs = ##class(%SQL.Statement).%ExecDirect(,"insert into HS_InteropTools_HL7_Compare.Skiplist (Segment,Field) Values (?,?)","<segment_name>",<position>)
    

    In addition to skipping specified differences in a field, you can skip entire rows if they are empty. To skip empty segments, insert into HS_InteropTools_HL7_Compare.Skiplist( Segment,Field,IgnoreEmptySegment) Values ('PV1','*',1). Entering these values will only skip the identified segments in which all fields are completely empty.

    Note:

    The skiplist can be used to skip specific fields within a segment, but will require entering the value of the field names in the skiplist field.

    See HS.InteropTools.HL7.Compare.SkiplistOpens in a new tab in the class reference for additional position options provided by other properties of the Skiplist class.

  8. Optional. If you added rows to the skip list, recompute and refresh the Visual Comparison page to see the new results. In the testing namespace, execute this command:

    do ##class(HS.InteropTools.HL7.Compare.Compare).Recompute("Source","Target")
    
Important:

This procedure modifies the contents of the IRIS.DAT. If you wish to execute this procedure again, you need an original copy of the IRIS.DAT, and you need to delete the Testing_Namespace and the associated database. You can delete these in the management portal at System->Configuration->Local Databases. When you delete the database, the Delete Database dialog includes checkboxes allowing you to delete both the database and the namespace.

The Visual Comparison Page

The Visual Comparison page, located at Interoperability/Visual Comparison in the management portal, displays tables comparing the output from your source system to the output from your upgraded system.

Image of the visual comparison table

  • Each table depicts a single message. You can navigate between messages by clicking the arrow buttons on either side of the issue number displayed above the table.

  • Each row represents a single segment of the displayed message, lining up output from the source system, position-by-position directly above output from the upgraded system.

  • The first cell of each row is the line number, and the second is the segment name.

  • Each cell from the third column onward represents a single position in its segment. You can learn the position number for a cell by looking at that cell’s tool tip.

  • Differences are highlighted.

For diagnostic purposes, the Visual Trace... link takes you to the visual trace of messages that yielded the message currently being displayed.

Two filter links are displayed above the table:

  • The Filter Session... link removes the currently-displayed message from the comparison output.

  • The Remove all records for <Service|Operation> link removes all records that match the specified service/operation pairing.

FeedbackOpens in a new tab