Creating a Catchall Matching Rule

What is a "Catchall" matching rule?

HL7 has lots and lots of messages. Often times we want to ignore most of them. This is where having a “catchall” rule which just matches everything that you don’t want to match and just parses the header MSH segment of a message is super helpful.

Editing the Matching Rules in IguanaX

On the previous page we created a vmd file. Now it is time to add “Catchall” and create matching rules:

  1. You should have an ADT^A01 message imported already.

  2. Click + ADD MESSAGE:

  1. Edit the message:

  1. Change the name to “Catchall” and add a “MSH” type, then SAVE:

  1. Click “Matching Rules”

  1. Edit the Matching Rules:

  1. Add a rule like the screenshot and SAVE:

Code:

function main(Data) local m = hl7.parse{vmd='test.vmd', data=Data} trace(m) end

Here is the sample message to copy in:

MSH|^~\&|MESA_ADT|XYZ_ADMITTING|iFW|ZYX_HOSPITAL|||ADT^A04|103102|P|2.4||||||||{{IFWTOKEN}}0A{{IFWTOKEN}} EVN||200007010800||||200007010800{{IFWTOKEN}}0A{{IFWTOKEN}} PID|||583295^^^ADT1||DOE^JANE||19610615|M-||2106-3|123 MAIN STREET^^GREENSBORO^NC^27401-1020|GL|(919)379-1212|(919)271-3434~(919)277-3114||S||PATID12345001^2^M10|123456789|9-87654^NC{{IFWTOKEN}}0A{{IFWTOKEN}} NK1|1|BATES^RONALD^L|SPO|||||20011105{{IFWTOKEN}}0A{{IFWTOKEN}} PV1||E||||||5101^NELL^FREDERICK^P^^DR|||||||||||V1295^^^ADT1|||||||||||||||||||||||||200007010800||||||||{{IFWTOKEN}}0A{{IFWTOKEN}} PV2|||^ABDOMINAL PAIN{{IFWTOKEN}}0A{{IFWTOKEN}} OBX|1|HD|SR Instance UID||1.123456.2.2000.31.2.1||||||F||||||{{IFWTOKEN}}0A{{IFWTOKEN}} AL1|1||^PENICILLIN||PRODUCES HIVES~RASH{{IFWTOKEN}}0A{{IFWTOKEN}} AL1|2||^CAT DANDER{{IFWTOKEN}}0A{{IFWTOKEN}} DG1|001|I9|1550|MAL NEO LIVER, PRIMARY|19880501103005|F||{{IFWTOKEN}}0A{{IFWTOKEN}} PR1|2234|M11|111^CODE151|COMMON PROCEDURES|198809081123{{IFWTOKEN}}0A{{IFWTOKEN}} ROL|45^RECORDER^ROLE MASTER LIST|AD|CP|KATE^SMITH^ELLEN|199505011201{{IFWTOKEN}}0A{{IFWTOKEN}} GT1|1122|1519|BILL^GATES^A{{IFWTOKEN}}0A{{IFWTOKEN}} IN1|001|A357|1234|BCMD|||||132987{{IFWTOKEN}}0A{{IFWTOKEN}} IN2|ID1551001|SSN12345678