The key is in your picture "Value DoesNotMatch" "3N.1""-""2N.1""-""4N"

This is MUMPS/Cache/IRIS pattern matching.  This pattern is looking for 3 numbers, a hyphen, 2 numbers, a hyphen, and 4 numbers.  In your custom rule you would be checking for 13 numbers at a minimum.  You could check for a gender match on that digit.  Also verify the citizenship digit.

"Value DoesNotMatch" "13N"


I am a retired Cache/MUMPS developer and have far too much time on my hands.  However, I think I have found a smooth and reliable way to accomplish what you need.  This was fun.  Thanks for the challenge.

 New X,CSZ
 Set CSZ($Increment(CSZ(0)))="CANTON,TX.,75103"
 Set CSZ($Increment(CSZ(0)))="MILFORD, OH 45150"
 Set CSZ($Increment(CSZ(0)))="MILFORD OH 45150"
 Set CSZ($Increment(CSZ(0)))="KANSAS CITY, MO, 12345"
 Set CSZ($Increment(CSZ(0)))="KANSAS CITY MO, 12345"
 Set CSZ($Increment(CSZ(0)))="ST. LOUIS MO, 12345"
 Set CSZ($Increment(CSZ(0)))=" ST. LOUIS MO, 12345"
 For X=1:1:CSZ(0) Write $$CSZ2(CSZ(X)),!
 Set CSZF=$Zconvert(CSZF,"U")
 Set CSZF=$Translate(CSZF,",."," ") // Translate to spaces
 Set CSZF=$Zstrip(CSZF,"<=>"," ") // Remove Leading, Trailing, and multiple spaces.
 Set SC=$Length(CSZF," ") // Count the number of spaces
 Set CITY=$Piece(CSZF," ",1,(SC-2)) // Select the multiple of city pieces
 Set STATE=$Piece(CSZF," ",(SC-1)) // Select one less the the max piece.
 Set ZIP=$Piece(CSZF," ",SC) // Select the max piece.
 Quit CITY_"|"_STATE_"|"_ZIP


This is really helpful Vitaliy Serdtsev.  Thanks for this information.  I set this up with Beyond Compare and it works great.  Do you know of anyway to get it to work across namespaces?  It would be nice to be able to compare a routine from one namespace to another.


Compares an open file to one that you select with Browse. You must have specified an external compare tool with the Compare setting in Options > Environment > General. To work correctly, the compare tool must be able to accept command line parameters as tool.exe file1 file2. Tested compare tools are Microsoft Windiff and Perforce p4Diff.exe.

One of the best tools that I have found for comparing routines is called "Beyond Compare".  You can create a small CSP that will serve up the a routine depending on the routine name in the query string of the URL.  Then you can put that URL directly in the file open dialog of "Beyond Compare" that it will bring up the routines and display a nice side-by-side compare.  It can also save the comparison in an HTML file for sharing with others.


This may be far more than you were looking for, but I will share what I did to determine what globals were being accessed in the VA VistA software.

The first step was to convert the routines to the CSV version using the %SyntaxColor class in Cache.  This link shows an example:  The top frame is the routine and the bottom frame is the CSV version of the routine.  If you look at line 9 of both frames you can find the global ^IBA referenced.  In the CSV version it is identified by the COS 12 indicator.  Therefore, to find all the global references in a list of routines just looking for the COS 12 indicators will find them.

This link shows a listing of a group of routines.  The "ns" variable can be changes to look at any routine or set of routines within the system.

Let me know if you would like more information.

Ben Irwin

Thanks to Robert Cemper for the answer.  However, I misunderstood that Robert was saying, but it fixed the issue.

My web service original was the following:

Method RtnReceive(RtnName As %String, RtnLines As %ListOfDataTypes) As %String [ WebMethod ]

At misunderstanding Robert's suggestion I changed the code to the following:

Method RtnReceive(RtnName As %String, RtnLines As %ListOfDataTypes(ELEMENTTYPE="%String", XMLITENAME=RtnLinesItem", XMLNAME="RtnLines")) As %String [ WebMethod ]

I had used the $Extract to limit the line length to 50 to avoid the error, and now with the change I have removed the length limit and all is working.

To see an example of how this is going to be used see the following website:

The pages currently in this link are created on a local machine and SFTP'ed to the server using the Cache SFTP functionality.  Now with the web service functionality, these files can be pushed through the web service without first creating files.  This might work faster; that is the goal.

I think that Robert Cemper has provided the answer, but I am not sure how to apply it to coding.

The goal of this exercise is to send a routine from the ^ROUTINE global on one computer to the ^RTN global on another computer through a web service. 

The following code is the web service code.

/// Routines.Upload
Class Routines.Upload Extends %SOAP.WebService [ ProcedureBlock ]

/// Name of the WebService.
Parameter SERVICENAME = "Upload";

/// SOAP Namespace for the WebService
Parameter NAMESPACE = "";

/// Namespaces of referenced classes will be used in the WSDL.

/// Receive Routines
Method RtnReceive(RtnName As %String, RtnLines As %ListOfDataTypes) As %String [ WebMethod ]
 Quit:RtnName="" "Failed"
 Kill ^RTN(RtnName)
 Set ^RTN(RtnName,0)=RtnLines.Count()
 For X=1:1:RtnLines.Count()
   { Set ^RTN(RtnName, X)=RtnLines.GetAt(X) }
 Quit "Done"


The following is the client that is just produced by importing the WSDL.

Class Routines.UploadSoap Extends %SOAP.WebClient [ ProcedureBlock ]

/// This is the URL used to access the web service.
Parameter LOCATION = "http://localhost:57773/csp/data1/Routines.Upload.cls";

/// This is the namespace used by the Service
Parameter NAMESPACE = "";

/// Use xsi:type attribute for literal types.

/// Determines handling of Security header.

/// This is the name of the Service
Parameter SERVICENAME = "Upload";

/// This is the SOAP version supported by the service.
Parameter SOAPVERSION = 1.1;

Method RtnReceive(RtnName As %String, RtnLines As %ListOfDataTypes(ELEMENTTYPE="%String",XMLITEMNAME="RtnLinesItem",XMLNAME="RtnLines")) As %String [ Final, ProcedureBlock = 1, SoapBindingStyle = document, SoapBodyUse = literal, WebMethod ]
 Quit ..WebMethod("RtnReceive").Invoke($this,"",.RtnName,.RtnLines)


Then the following is the code that I am using to call the web service.

 New UCI,x,y,z,RtnLines
 Quit:RtnName="" 0
 Quit:$Data(^[UCI]ROUTINE(RtnName))=0 0
 Set RtnLines=##class(%ListOfDataTypes).%New()
 For x=1:1:^[UCI]ROUTINE(RtnName,0,0)
   Do RtnLines.Insert($Extract(^[UCI]ROUTINE(RtnName,0,x),1,50))
 Set y=##class(Routines.UploadSoap).%New()
 Write RtnName,!
 ZW RtnLines
 Set z=y.RtnReceive(RtnName, RtnLines)
 Quit 1

I was just able to install IRIS on an Apple MacBook Pro, with Parallels and Windows 10 Pro.  I installed the current FOIA VistA with about 8.2 GB of data.  Everything worked good until getting to the Taskman and RPC Broker startup.  This has always been an issue with the developer version from Intersystems.  It's almost enough users to bring up Taskman.  Not nearly enough to bring up Taskman and the RPC Broker.

It's great to have IRIS Studio.  Everything seems just like Cache with a new name.  Thanks Intersystems.

I didn't see the HTML option in the previous comments.  Most of the Microsoft and other Windows type programs can now open a web page directly within the application.  If you point Excel to a http://server/something.cls Cache Server Page class, it will open directly in Excel.  If you create your web page using html tables, then they will format nicely when opened with Excel.  Again many of the applications will even allow a "GET" style request like http://server/something.cls?date=20190501.  This allows for individualized web reports.