|
Validating CDA XML with C# |
|
Solutions
|
|
Written by Sean McIlvenna
|
|
Validating CDA documents in C# seems to be a bit tricky… At first, I started out just copying the infrastructure and processable schemas to a project and creating the code to use those schemas to validate. Unfortunately, I kept getting errors like “Missing complexType ‘II’ used in restriction base”. The II type is defined in datatypes-base, and the element it was error out on was the POCD_MT000040.InfrastructureRoot.typeId complex type.
I still have no idea what the issue is here… The schemas validate without problem in Eclipse, Oxygen and even XMLSpy.
I ended up having to flatten the schemas into a single file. I believe the issue has something to do with namespaces that I don’t fully understand; so if anyone out here has the answer, please comment.
|
|
Last Updated on Wednesday, 28 April 2010 03:51 |
|
Solutions
|
|
Written by Sean McIlvenna
|
|
Generating C# code from the CDA schemas is a little different than in my previous article about XCA implementation… With XCA, svcutil doesn’t recognize <import> and <include> so you have to specify each XSD and WSDL on the command-line of the svcutil call. However, with CDA it is the exact opposite.
I started out trying to generate code with XSD.exe using the same methodology as with the XCA schemas.. However, after removing the <import> and <include> elements from the schemas, flattening the hierarchy and specifying all the XSD files on the command-line I ended up getting a ton of errors about missing elements.
So, eventually I got around to trying to just run XSD.exe with the root XSD and using the same schema hierarchy that is packed in the normative edition of CDA… Which worked.
1) Copy infrastructure and processable directories from normative cda to a directory on your drive.
2) Open a visual studio command prompt.
3) CD to the infrastructure directory.
4) Run “xsd.exe CDA.xsd /classes /language:C#”
|
|
Last Updated on Monday, 26 April 2010 08:59 |
|
C#/.NET
|
|
Written by Sean McIlvenna
|
Description
Code and document reviewing is a very useful practice to use with projects that deal in document and code output. However, not many tools exist that support reviewing that are cheap.
One of the more popular reviewing tools out there right now is "Review Board". Review board requires the user to provide a unified diff file in order to create a review. Although review board DOES have a tool that allows you to create diff files, it is not very friendly and is built in python, which doesn't make it easy to install.
The goal of this project is to provide a windows-based tool that allows the user to easily create unified diff files from working directories on their local machine, or from revision history stored in their version control. The tool will support multiple repositories with different repository types.
Initially, SVN will be supported. Later, add-ins may be created for other common version control systems such as GIT, CVS, VSS, etc.
An additional POSSIBLE feature will be to allow multiple document types. Currently, only plain-text files can be diff'd. However, it would be good to get .doc and .pdf files to be review-able as well so that companies of a different nature (such as specification developers, architects, etc) are able to use review systems such as Review Board as well.
If you are interested in contributing to this project, I have posted the code on my SVN repository and would be willing to grant you access to it upon request. Please use my Contact Me page to request access to contribute.
|
|
Last Updated on Sunday, 28 February 2010 23:59 |
|
General
|
|
Written by Sean McIlvenna
|
|
A while back I began working on a project where I had to develop an XCA service. For those of you who don.t know what XCA is, see this: Cross-Community Access (XCA). XCA is a supplement of the XDS.b standard, which is Cross-Enterprise Document Sharing (the .b. as opposed to .a. for the older version). Well, I find that there is plenty of specifications on XCA and XDS.b in PDF form, but they seem to focus on the format of data being sent over the wire, not really how to implement the service that communicates that format of data. Initially, someone told me that I could just generate code out of the XSD and WSDL. This sounded great in theory and I had done that for working with CDA documents, but in this case when I tried to use XSD.exe to generate objects for the RIM.xsd schema it gave me a number of errors that elements were missing, so I gave up on that after reading articles on the internet where other people were having similar problems. One statement indicated .IHE is working on creating an XSD that is compatible with Microsoft.s XSD.exe tool, and will be out shortly.. Unfortunately, that post was made quite a while ago and I couldn.t find anything about a newer version from IHE. So, instead I looked into using Microsoft.s implementation of XDS as an example to implement just my own little pieces. Their interfaces used a very odd approach of accepting (and responding with) raw System.ServiceModel.Channels.Message objects. In this case, I parsed and created raw XML and converted that raw XML into the Message object.
|
|
General
|
|
Written by Sean McIlvenna
|
|
My most recent work has put me in a position to learn a great deal more about the health care IT industry. It has been quite an interesting learning curve over the past few months. Looking back, I.ve worked on hospital scheduling systems for an extensive period of time, then coincidentally lead the development of a claims administration system and now I.m learning about another corner of the industry (clinical documentation). CDA is short for Clinical Document Architecture, which is a standard based on a standard called the HL7 RIM . reference information model. CDA, essentially, defines the XML-based structure in which a doctor can report information on procedures, allergies, diagnosis (etc) for a patient. The full CDA specification can be found here.
|
|
General
|
|
Written by Sean McIlvenna
|
|
A couple days back I installed Outlook 2010 Beta because I read an article about it that described a couple features that I could really use. So far, I must say, I am really impressed with the product. Although the interface hasn.t been changed that much, the changes that they did make to it sure do look nice. So, here.s the doozy feature: Support for multiple exchange accounts in a single profile. This is a huge deal for me. I have several exchange accounts that I have to keep up with and the current version of outlook (2007) just doesn.t make that very easy.
|
|
Last Updated on Tuesday, 29 December 2009 09:55 |
|
General
|
|
Written by Sean McIlvenna
|
|
Earlier I was thinking about all the different tools I use and how neat they are and I thought I would share the (vast?) list of tools with everyone and individual thoughts on them. Productivity - Microsoft Office 2007 - Outlook: The best email tool, ever. I use outlook in conjunction with http://www.myhosting.com (for exchange server email @ $10/mo) and a couple other IMAP email addresses. I synch my phone up with my calendar, tasks, contacts and email and am able to track all of my day-to-day stuff in one single place. I even have pictures associated with each contact (where possible) so that my Windows Mobile 6.1 phone displays their picture when they call. - Word - Excel: The ability to perform in-line calculations on spreadsheets is wonderful. I love many of google.s apps, but they try to put too many of them in the browser. The browser still lacks a lot of functionality. The browser should display content, not provide a full user interface to a complex application like excel. - Access
|
|
Last Updated on Friday, 20 November 2009 16:03 |
|
XPS 420 Vista Bluetooth Headset Problems (Dell fails, I win) |
|
General
|
|
Written by Sean McIlvenna
|
|
A while back I ran into some issues with my system getting BSOD'd... The dell online chat representative (after remote assisting me) suggested that I re-install windows. After I did that I could no longer properly use my bluetooth headset devices. Today, I spent about 30 minutes with another dell online chat representative trying to fix this issue (watching them remote assist my computer)... In the end, they told me they could not figure it out and could only suggest that speak with an On-Call representative (which costs money, of course). They told me that everything was fine with my system and that the problem must be with my bluetooth headset, which was not supported by them because it was not Dell.
|
|
Last Updated on Monday, 26 October 2009 14:10 |
|
|