For the Surgical Synoptic Reporting project we needed to be able to create Operative Reports in a format that MEDITECH would accept. The requirement was that the solution would generate the report and send the report in the OBX segment of an ORU message. It needed to create the reports to support both Magic and Client / Server.
I had already built some code during the pilot phase preceding this project so it made sense to use take that code and turn it into a library that our vendor could use. Their solution could use a .NET assembly.
The library that I built is available on GitHub. Here is a screenshot from the test harness that is included with the library.
The library allows you to:
- build a representation of a formatted text document in code
- parse an existing formatted text document to build an object graph
- generate an HTML representation of a formatted text document
Here is an example of building a document in code:
private void helloWorld() {
// create the document
var document = new MeditechUtilities.FormattedTextDocument();
// allow local escape codes (for example italic)
document.SupportsLocalEscapeCodes = true;
// work with the node collection to build the document
var nodes = document.Nodes;
// create a new document
nodes.StartDocument();
// highlighted document title
nodes.StartHighlight();
nodes.AddText("Hello World!");
nodes.StartNormalText();
// end the document
nodes.EndDocument();
// build the MEDITECH formatted text codes
inputTextBox.Text = document.ToMeditech();
}
This code generates:
And here is a sample using the document that is in the MEDITECH ITS Inbound Results Interface specification.
Hopefully other people will find this library useful.
No comments:
Post a Comment