OpenVista Clinical Information System (CIS) is a cross platform application based on C# and Gtk# / GTK. CIS runs on the MS and Mono .NET frameworks. It is based on the design of the VA's Computerized Patient Record System (CPRS) along with image viewing, and other commercial enhancements. CIS will be Medsphere's technical platform for our new pharmacy and nursing modules.
Quick Links
Novell has released a Gtk# Win32 installer for Gtk# 2.12.6, based on the installer source code released by Medsphere. This is really cool to see more work by Medsphere being integrated into the "upstream" open source communities.
The release announcement: http://lists.ximian.com/pipermail/mono-devel-list/2008-December/030125.html
I will still stress that this is not the officially supported installer or Gtk# version for Medsphere products, and we recommend not using it in a production environment.
One of the things us CIS developer constantly face is the question, "What the heck does this RPC do?!" Seasoned (or masochistic) developers will often jump into FileMan, and inspect the entry from the REMOTE PROCEDURE and go on their merry way. However, for those of us looking for something a little easier on the eyes (and minds), one of our developers wrote a handy RPC reference page. We've put a copy of it up where other's can get to, so it's now available at:
http://medsphere.org/docs/vista-rpcs/
This is driven by a static file generated from the latest public release of OpenVista Server. Hope others find this useful!
P/Invoke, short term for Platform Invoke, is the mechanism provided by the .NET framework to invoke unmanaged code (methods or functions from libraries written in C or C++ programming languages) from managed code. As an example let's look at some code from the OpenVistaCIS code base.
Let's look at the code that brings spelling support. If you have CIS's source code available go ahead and read the file src/Medsphere.OpenVista.Spelling/AspellSpeller.cs. The basic P/Invoke suport is based on the use of the DllImport attribute. What the DllImport attribute does is to provide the information needed to call a function from unmanaged code, which is described by the method's signature (which involves the name, return type and parameters types).
In order to create an Aspell dictionary on OpenVistaCIS we have two external libraries definitions that take care of what's the platform we are running on, either GNU/Linux or MS Windows
[DllImport ("aspell-15.dll", EntryPoint="new_aspell_speller")]
private static extern IntPtr new_aspell_speller_win32 (IntPtr config);
[DllImport ("libaspell")]
private static extern IntPtr new_aspell_speller (IntPtr config);
The first parameter for the DllImport attribute is the library name, that for the Win32 version is aspell-15.dll but for the Linux version is libaspell, we have to define two external method declarations due to that fact, then for the Win32's signature comes a named argument called EntryPoint that let us map the declaration to the original name of the method in the unmanaged library, so in that case we map new_aspell_speller_win32 to new_aspell_speller. Another important thing that we must highlight is the use of the extern method's modifier to "mark" the method as being implemented externally (that allow us to just use semi-colon as the method's body. And finally, we must highlight the use of the IntPtr type to represent a pointer or handle that's coming back from the unmanaged library.
Now, the way we use them inside the managed code is as follows:
public AspellSpeller (AspellConfig config)
{
if (IsWindows) {
error = new AspellCanHaveError (new_aspell_speller_win32 (config.Handle));
} else {
error = new AspellCanHaveError (new_aspell_speller (config.Handle));
}
.
.
.
}
Where the IsWindows property is defined as:
private static bool IsWindows {
get { return ((int)Environment.OSVersion.Platform <= 3); }
}
The types used in an external method declaration can go from very simple Int32, String or more complicated types that need explicit marshalling. One very detailed article about is the one found in the Mono project's Interop with Native Libraries. Check it out for more details about P/Invoke.
Here's an older post from my private blog (http://gnandt.blogspot.com) that gives an impression about what Mono.Addins is. We use it extensively within OpenVista CIS to dynamically glue our x-platform healthcare components (including GUI) together to one platform.
Mono.Addins is a support framework for implementing extensible applications by libraries. Unlike plugins, this concept does not support application extension by applications, but library extension by libraries (add-in hierarchy). Following example figure shows the framework architecture. The application Add-In Host provides Extension Points as hooks for the Add-In Dynamic Link Libraries (DLL). All add-ins can be enabled and disabled at run-time. Further, an add-in management library for basic user interaction also provides installation support from add-in repositories in addition to the mentioned run-time switches.
I'm releasing the first Gtk# 2.12 installer for Windows today. There has been a lot of community demand for this, so I wanted to get it out. However I do want to be clear that this should be considered an EXPERIMENTAL installer by Medsphere's standards. It has not gone through any QA process, and Medsphere will absolutely not be providing any official support for this.
That said, I'd be happy for people to use it, abuse it, and send bug reports to me regarding either the installer itself or for GTK+ on Windows in general.
If you're interested in using it, you can grab it from: http://bzr.medsphere.com/~cody/installers/gtksharp-sdk-2.12.3-1.msi
OpenVista CIS requires a connection to an OpenVista Server instance.
If you just want to try CIS, the easiest way to get started is to connect Medsphere's OpenVista Public Demo Server.
Alternatively, you can download the OpenVista Appliance, which is a self-contained virtual machine. Inside, OpenVista CIS and OpenVista Server are already pre-configured.
Finally, if you want a more permanent setup, you can download and install OpenVista Server yourself.