A hands-on method for students to get to know the communication foundation of almost every medical institution https://hl7v2.hnu.thielker.dev/
Find a file
2025-07-30 13:15:56 +02:00
packages HL7-3: remove optimistic updates and react to delivery-success 2025-07-30 13:15:56 +02:00
.env.example Initial commit 2025-07-30 12:04:29 +02:00
.gitignore Initial commit 2025-07-30 12:04:29 +02:00
.npmrc Initial commit 2025-07-30 12:04:29 +02:00
bun.lock Initial commit 2025-07-30 12:04:29 +02:00
compose.yaml Initial commit 2025-07-30 12:04:29 +02:00
package.json Initial commit 2025-07-30 12:04:29 +02:00
README.md HL7-1: add example .env files to client and server 2025-07-30 13:03:51 +02:00
tsconfig.base.json Initial commit 2025-07-30 12:04:29 +02:00

HL7v2

HL7v2 is a medical communication protocol. This application tries to be a hands-on method for students to get to know the communication foundation of almost every medical institution, typically hidden behind software forms.

How it works

The application is web-based and features an individual number of clients. Every client has an input to construct a raw HL7v2 message, build of the message header and an optional number of segments. Each editor has predefined segment templates with missing values, which have to be filled in to be sent the message to a different client.

Architecture

The stack features a SvelteKit application and a Bun websocket server. Communication between clients is only the web-socket server, validating each message for a valid format. Only if the message was valid and delivered successfully to a different client, the server sends back an acknowledgement and notifies the sending client.

Getting started

  1. Download the sources of the project
  2. Copy the .env.example files to .env files
  3. Execute bun install and bun run dev in the root directory
  4. Start customizing the code to your needs

Deployment

  1. Download the compose.yaml file to the machine you want the application to run on.

  2. Copy the sample .env file by running cp .env.example .env and adjust the new file to your needs.

    -- public URL of the client used by traefik
    CLIENT_URL=my.app.com
    
    -- public URL of the server used by the client to connect and traefik
    SERVER_URL=server.my.app.com
    
    -- the port the server listens on
    PORT=8080
    
    -- number of ID prefixes (no effect on pool-size)
    PREFIXES=STA,LAB
    
    -- amount of available IDs
    POOL_SIZE=100
    
  3. The compose.yaml file configures Traefik routers with TLS encryption. Customize the settings as needed or just remove them if you are using a different reverse proxy.

  4. Start up the containers using podman|docker compose up -d.