GithubHelp home page GithubHelp logo

developeramarish / nextlevel-hl7 Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 36 KB

NextLevel HL7 .NET Client and Server for Sending and Receiving HL7 Messages

Home Page: http://www.clarion.consulting

License: MIT License

C# 100.00%

nextlevel-hl7's Introduction

Welcome!

The NextLevel HL7 API enables .NET interface developers to send and receive HL7 messages via a simple client server architecture.

What's in the API:

  • Host an HL7 server and receive HL7 messages through an event-based architecture
  • Connect to an HL7 server and transmit HL7 messages
  • Inspect HL7 messages without complex parsing or conditional logic
  • Receive HL7 messages via socket or file system
  • Track statistics for open connections, message history, and delivery failures

Why use this API?

  • Next Level HL7 is built for thread-safety. Multiple clients and servers may exist within a single AppDomain
  • Provides a Task-based Asynchronous Programming model for connection management
  • Leverages .NET dynamic and implicit conversion for simplified parsing of nested HL7 fields.

Contribute Back!

Is there a feature missing that you'd like to see, or found a bug that you have a fix for? Or do you have an idea or just interest in helping out in building the library? Let us know and we'd love to work with you.

Getting Started

1: Create an inbound HL7 consumer using MLLP frames over TCP/IP sockets

BaseHL7Interface hl7InboundSocketInterface = new HL7InboundSocketInterface("Inbound Socket Sample", 2575);
hl7InboundSocketInterface.MessageEvent += OnMessageEvent;
hl7InboundSocketInterface.SendAcknowledgements = false;
hl7InboundSocketInterface.StartAsync();

2: Attach an event handler to receive messages

private void OnMessageEvent(object sender, Message message)
{
   IEHRInterface ehrInterface = sender as IEHRInterface;
   string messageType = message.MessageType();
   Console.WriteLine("[{0}]: {1} Event ", ehrInterface.Name, messageType);
}

3: Attach optional event handlers to receive interface errors or status events

private void OnErrorEvent(object sender, Exception exception)
{
   IEHRInterface ehrInterface = sender as IEHRInterface;
   Console.WriteLine(e.ToString());
}

4: Parse HL7 messages

// find patient's first name in PID segment, sequence 5, field 0.  
Segment pid = message.FindSegment("PID");
string firstName = pid[5][0];

5: Show interface statistics

InterfaceStatistics statistics = hl7InboundSocketInterface.Statistics;
Console.WriteLine("Interface Start Time: {0}", statistics.StartDateTime.ToString());
Console.WriteLine("Interface Uptime: {0}s", statistics.UpTime.TotalSeconds);
Console.WriteLine("Interface Last Message: {0}", statistics.LastMessageDateTime.ToString());
foreach (KeyValuePair<string, int> messageSuccess in statistics.Successes)
   Console.WriteLine("Interface Message {0}: {1}", messageSuccess.Key, messageSuccess.Value);

6: Alternatively, scan a file system for HL7 messages

BaseHL7Interface hl7InboundFileSystemInterface = new HL7InboundFileSystemInterface("File System Sample", @"C:\", "hl7");
hl7InboundFileSystemInterface.MessageEvent += OnMessageEvent;
hl7InboundFileSystemInterface.StartAsync();

7: Connect to an external HL7 server and deliver messages

HL7OutboundSocketInterface hl7OutboundSocketInterface = new HL7OutboundSocketInterface("Outbound Socket Sample", "127.0.0.1", 2575);
hl7OutboundSocketInterface.StartAsync();
hl7OutboundSocketInterface.EnqueueMessage("MSH|...");

This project is maintained by Shaun Tonstad. Contact [email protected] with questions or comments.

nextlevel-hl7's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.