Skip to content

Development

Rich Howell edited this page Oct 28, 2025 · 1 revision

Developer Overview

This section explains how everything fits together for developers extending or debugging the app.

Architecture Overview

MainForm (UI Layer)
 ├─ UILogger              → Handles rich log output to the interface
 ├─ HL7Server             → Core TCP listener and message processor
 │   ├─ NHapi Parser      → Parses incoming HL7 messages
 │   ├─ Validator         → Validates against JSON schema
 │   ├─ ACK Generator     → Builds and sends ACK messages
 │   └─ File Writer       → Saves messages and ACKs
 └─ Tray Icon Manager     → Handles background operation

Key Events

Event Description
MessageProcessed Fired when an HL7 message is successfully received and parsed
AckSent Fired when an ACK is generated and sent to the client

Adding Features

To add functionality (like sending outbound messages or metrics):

  • Subscribe to the MessageProcessed event in MainForm.cs
  • Implement your own custom handler

Example:

server.MessageProcessed += (msg, type) =>
{
    // Your logic here
};

Future Ideas

  • Multi-port listener support
  • Enhanced JSON schema validation
  • Real-time dashboard
  • Dark mode UI (because why not)

Clone this wiki locally