Skip to main content

Feature Demo

Linkiir Demo is a ready-to-run project you import as a zip bundle. It generates HL7 messages, sends them over LLP, stores the patients in a SQLite database, and serves them back through an HTTP API — a complete round trip built entirely with the native Linkiir scripting API.

Import it to get an understanding of how to create projects and workflows, as well as to get an understanding of how core nodes work.

Download Linkiir_Demo.linkiir.zip (78 KB)

One of two Demo Projects. For a healthcare interoperability example, see the HL7 v2 to FHIR Demo.


What's inside

The project contains four workflows.

WorkflowWhat it does
Step 1: HL7 Message GeneratorGenerates random HL7 ADT messages every 10 seconds and writes them to file
Step 2: HL7 File to LLPReads HL7 files, maps message fields, stamps the sending application, and forwards via LLP socket
Step 3: HL7 LLP to DatabaseReceives HL7 over LLP, filters for ADT events, extracts patient demographics, and writes them to a SQLite database
Step 4: Patient Lookup APIAn HTTP endpoint that queries the patient database and returns results as JSON, with an interactive web UI

Together they form a round trip: the generator produces messages, the file workflow sends them over LLP, the database workflow stores them, and the API reads them back.


Import the project

  1. Open the Linkiir Grid in your browser.
  2. Go to Projects.
  3. Click the chevron on Add Project and choose From zip.
  4. Drop Linkiir_Demo.linkiir.zip on Choose a project bundle, or click to browse for it.
  5. Click Import.

The project appears as Linkiir Demo with 4 workflows.

No additional setup is required. Everything the project needs is created automatically on first run.


Start the workflows

Click into the project. On the first start of the project, start the workflows in this order:

  1. Step 3: HL7 LLP to Database — starts the LLP listener and creates the database
  2. Step 4: Patient Lookup API — starts the web endpoint
  3. Step 1: HL7 Message Generator — begins producing HL7 messages
  4. Step 2: HL7 File to LLP — reads generated files and sends them to Step 3

For all future starts, simply select Start All.


Try the Patient Lookup API

Once Step 4 is running, open your browser to:

http://localhost:8081/lookup

You'll see an interactive page where you can:

  • Search patients by last name
  • View all records in a table
  • Reset the database for a fresh demo

The JSON API is also available:

URLReturns
http://localhost:8081/lookup?LastName=SmithPatients matching that last name
http://localhost:8081/lookup?all=1All patients as JSON

Configuration you may want to change

SettingWhereDefaultNotes
LLP portStep 2: Send LLP node configlocalhost:5145Must match Step 3's Receive LLP listen port
Listen portStep 3: Receive LLP node config5145Change if the port is in use
HTTP routeStep 4: Patient API node config/lookupChange if it conflicts with another endpoint
Generator intervalStep 1: Generate HL7 node config10000 msIncrease for a quieter demo
File poll intervalStep 2: Read HL7 Files node config10000 msMatch or exceed the generator interval

Reset the demo

To clear all patient data and start fresh:

  1. Stop Step 3: HL7 LLP to Database, to release the SQLite lock.
  2. Open the Patient Lookup page at http://localhost:8081/lookup.
  3. Click the red Reset DB button.
  4. Restart Step 3 and Step 1 to repopulate.

Or simply delete the demo/ folder and restart all workflows — everything will be recreated.


What the scripts demonstrate

Each row is a technique you can lift into your own interfaces.

TechniqueWhere to see it
HL7 parsing and tree navigationStep 2: Map HL7main.lua
Message filtering by typeStep 3: Filter ADTmain.lua
SQLite database accessStep 3: Write Patient DBmain.lua
HTTP request handling + JSON APIStep 4: main.lua + patient_db.lua
Modular Lua with requireStep 4: three-file structure
Random HL7 message generationStep 1: hl7_generator.lua
Self-provisioning (auto-create dirs/db)patient_db.lualinkiir.sys.fs.mkdir + CREATE TABLE IF NOT EXISTS

Open any node in the Scripting tab to see the code, set breakpoints, and run tests against sample data.


Troubleshooting

SymptomCauseFix
Patient count stays the sameStep 3 not running, or LLP connection refusedStart Step 3 before Step 2
"Connection refused" in logsStep 3's LLP listener isn't up yetStart Step 3, wait a moment, then start Step 2
No files in demo/messages/Files are being deleted after processing (normal)That's expected — check the patient database for proof of flow
Patient API returns emptyNo data written yetWait for the generator to produce a few messages
"Database is locked"Step 3 and Reset DB running simultaneouslyStop Step 3 before resetting

Where to go next

GoalRead
Try the healthcare interoperability demoHL7 v2 to FHIR Demo
Understand the node types the demo usesInterfaces and Core Nodes
Look up the functions the scripts callLinkiir Scripting API
Debug and test scripts the way the demo doesTesting and Debugging
Build the same kind of interface from scratchCreate a Project, Workflow, and HTTP Source Node