Reverse engineer CPRS to create alternate UI's

140 views
Skip to first unread message

shouvik

unread,
Jan 3, 2013, 6:42:30 AM1/3/13
to hard...@googlegroups.com
Hi All,

I have been trying to figure out other ways in which I can pull data from VistA Server and display it on client devices. I came across EWD on this journey and have been pretty comfortable working with it to execute mumps statements and pull the responses on apache. 

On thinking about how to pull data from VistA systems, I hoped that studying the source of VistA CPRS will allow me to get an understanding on the types of mumps commands and kind of interaction that goes between the CPRS module and the VistA Server. I would appreciate if someone could confirm if this train of thought is the correct approach and also I would greatly appreciate if you could point me to some resources which have already been pursuing on the project which I would like to embark upon.

Kind regards
Shouvik

PS: Happy new year to all the folks on Hardhats! May this year bring loads of success and joy to you... :) 

Nancy Anthracite

unread,
Jan 3, 2013, 8:30:17 AM1/3/13
to hard...@googlegroups.com, shouvik

Are you already aware of the Broker Development Kit, the fact you can view the
RPCs in CPRS and the ability to log interactions between CPRS and the server
that is built into VistA?
--
Nancy Anthracite

Skip

unread,
Jan 3, 2013, 8:44:45 AM1/3/13
to hard...@googlegroups.com, shouvik, nanth...@earthlink.net
You can get the source code and look for: "RPCBroker" inside the <dot>pas files and that will tell you what RPC is being called via the VA Broker.  For example:

File Name: fActivateDeactivate.pas
Search for: RPCBroker
The call:
begin
  CallV('ORWDX1 DCREN', [OrderID]); <==RPC
  for i := 0 to RPCBrokerV.Results.Count-1 do
    OriginalOrder.Add(RPCBrokerV.Results.Strings[i]);
end;

and you now the sum total of what I know.

shouvik

unread,
Jan 3, 2013, 9:27:38 AM1/3/13
to hard...@googlegroups.com, shouvik, nanth...@earthlink.net
Hi Nancy,

No sorry, I am not aware of it.

In fact I was looking though vistapedia for installation instructions for EWD with vista and I think I broke my vista. Basically now I have the following error on GTM when I try the following.

GTM>D ^XUP
%GTM-E-INVOBJ, Cannot ZLINK object file due to unexpected format
%GTM-I-TEXT, Object compiled with CHSET=M which is different from $ZCHSET


Any idea as to why this has happened?

Kind regards
Shouvik

shouvik

unread,
Jan 3, 2013, 9:29:42 AM1/3/13
to hard...@googlegroups.com, shouvik
Hi Skip,

Thanks for the tip I will look into it, simultaneously if Nancy's solution works well, then even better!

Regards
Shouvik

Bhaskar, K.S

unread,
Jan 3, 2013, 9:40:46 AM1/3/13
to hard...@googlegroups.com
Object files are sensitive to the mode they were compiled in (M mode vs. UTF-8 mode), and GT.M generates an error when the mode of the object code does not match the mode of the process.  I reproduce an extract from the Basic Operations section of the GT.M Administration and Operations manual below.  You should also read what the Messages and Recovery Procedures manual says about INVOBJ.  To find all GT.M user documentation, go to http://fis-gtm.com and click on the User Documentation tab.

In general, you are likely to get better answers and be more productive if you go to the user documentation and ask specific questions when something is not clear, rather than simply throwing up your hands when you see an error.

Regards
-- Bhaskar


M mode and UTF-8 mode

A GT.M process can operate in either M mode or UTF-8 mode. In certain circumstances, both M mode and UTF-8 mode may concurrently access the same database.

$gtm_chset determines the mode in which a process operates. If it has a value of M, GT.M treats all 256 combinations of the 8 bits in a byte as a character, which is suitable for many single-language applications.

If $gtm_chset has a value of UTF-8, GT.M (at process startup) interprets strings as being encoded in UTF-8. In this mode, all functionality related to Unicode™ becomes available and standard string-oriented operations operate with UTF-8 encoding. In this mode, GT.M detects character boundaries (since the size of a character is variable length), calculates glyph display width, and performs string conversion between UTF-8 and UTF-16.

If you install GT.M with Unicode support, all GT.M components related to M mode reside in your GT.M distribution directory and Unicode-related components reside in the utf8 subdirectory of your GT.M distribution. For processes in UTF-8 mode, in addition to gtm_chset, ensure that $gtm_dist points to the utf8 subdirectory, that $gtmroutines includes the utf8 subdirectory (or the libgtmutil.so therein) rather than its parent directory.


--
http://groups.google.com/group/Hardhats
To unsubscribe, send email to Hardhats+u...@googlegroups.com

-- 
GT.M - Rock solid. Lightning fast. Secure. No compromises.
_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.

shouvik

unread,
Jan 3, 2013, 9:41:54 AM1/3/13
to hard...@googlegroups.com, shouvik, nanth...@earthlink.net
Hi,

So on a little bit of digging around I found the following link

This talks about the objects already being compiled in M mode while I am trying to execute them in UTF-8 mode.

This I think might be because I updated the env variables with the following:
export gtm_chset=utf-8
as seen here.

Now should I go ahead and delete all the object files in my /o directory and let them compile as and when the routines are called or is there another solution?

Regards
Shouvik

shouvik

unread,
Jan 3, 2013, 9:47:11 AM1/3/13
to hard...@googlegroups.com, K.S. Bhaskar
Hi Bhaskar,

I will have a look at the documentation. I was still looking for a solution to the issue as posted in my last post and in retrospect I should not have posted the query without exhausting all my options. Thanks for your reply and I apologies for hastily posting the issue.

Regards
Shouvik

shouvik

unread,
Jan 3, 2013, 10:02:49 AM1/3/13
to hard...@googlegroups.com, shouvik, nanth...@earthlink.net
Hi Nancy,

Following up with the documentation link provided by bahskar I deleted the object files and my vista is back up and running smoothly.
Sorry for bombarding your mailbox with mails. I would appreciate some more information on the "Broker Development Kit" though.

Regards
Shouvik

Nancy Anthracite

unread,
Jan 3, 2013, 10:38:08 AM1/3/13
to shouvik, hard...@googlegroups.com
add showrpcs at the end of the target line in your shortcut, where the
S=[Server] P=[Port] CCOW=disable is. The give programmer keys to the user and
under one of the drop down menus at the top of CPRS, I don't recall which one,
is the option to view the RPCs.

For the logging
http://opensourcevista.net:8888/NancysVistAServer/StartBrokerLogging.txt

Broker Development Kit Info is here:

http://www.va.gov/vdl/application.asp?appid=23

There is a copy of the BDK files here:

http://opensourcevista.net:8888/NancysVistAServer/XWB1_1P47_BDK32_080626.zip

shouvik

unread,
Jan 4, 2013, 12:57:34 AM1/4/13
to hard...@googlegroups.com, shouvik, nanth...@earthlink.net
Hi Nancy,

Thanks for the links. I did some digging around and turns out after adding SHOWRPCS to the shortcut, you will be able to view upto the last 100 calls via the help menu in the toolbar.

I am trying to look into the possibility of getting the BDK set up. 

Thanks again
Kind regards
Shouvik

Kevin Toppenberg

unread,
Jan 4, 2013, 7:59:28 AM1/4/13
to hard...@googlegroups.com, shouvik, nanth...@earthlink.net
The BDK is going to be helpful for you if you want to create your own application that talks to the server.  The BDK package has a great help file that has some tutorials to get you going.  It is designed for use from Delphi pascal.  But if you are wanting to interface to web technologies, then it seems that EWD would be a more logical solution.  If you are already calling code on the server, then you could try using the same RPC's.  But be aware that RPC's are very often not the same as API's.  They are not general purpose, and are instead designed for only one purpose typically.

Nancy, 
I was not aware of the "SHOWRPCS" flag.  I pulled up the source for CPRS, and it looks like this causes the name of the RPC being called to be shown in the status text area (on the bottom of the screen.)  It also looks like "DEBUG" is another supported option.  I can't tell for sure what this does.  It seems to be a parameter passed to the server during setup of the connection.

I think the key needed to show the RPC's in the help menu us XUPROGMODE

If you use Astronaut VistA, with TMG CPRS, we have allowed many more than 100 calls to be viewed, and made some other improvements to that dialog as well.  

Kevin

Nancy Anthracite

unread,
Jan 4, 2013, 5:20:50 PM1/4/13
to hard...@googlegroups.com, Kevin Toppenberg, shouvik
I believe the old method of showing RPCs had an option to show up to 100 as
well.

--
Nancy Anthracite
Reply all
Reply to author
Forward
0 new messages