Video Tutorial - Part 2 (Mapping Demographic Information)

 

The second in a series of Iguana 5 tutorial videos.  In this video, we begin the process of creating our interface.  We start by looking at the incoming HL7 message and our database tables.  Then, we move on to parsing our message and saving some basic demographic fields.

Runtime: 14:48 
Play | YouTube | Download (right-click)


In our first video, we showed you how to setup your environment to follow along with the tutorials.  So in this video, we begin the process of creating our interface.  You can start by coping the script below and pasting it into the Iguana Translator channel you created in Part 1.  

Once you have that in place, you can play this video and follow along as we use the Iguana Translator for the first time to parse our HL7 message into a logic data structure, learn how we use our VMD file to create a local table structure and then move on to organizing our code and mapping some basic patient demographic information.

When we're done, we'll have a working - though limited - interface that is capable of receiving ADT (patient demographics) messages and saving some of the information into our database.

*Note:  In this video I was using a required module called "hl7date".  With the official release of Iguana 5, we have replaced hl7date with a much more robust dateparse.  The code below is identical to what I was using in my video, but I've updated it to use the dateparse module. 

Script:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
require("node")
--require("hl7date")
require("dateparse")

-- The main function is the first function called from Iguana.
-- The Data argument will contain the message to be processed.
function main(Data)
   --local T = MapData(Data)
   --if T then
   --   db.merge{api=db.MY_SQL,name='test', user='user', password='pass', data=T}
   --end 
end


function MapData(Data)
   --local Msg,Name = hl7.parse({vmd='tutorial.vmd', data=Data})
   --local Tables   = db.tables({vmd='tutorial.vmd', name=Name})
   --if Name == 'ADT' then 
   --   ProcessADT(Tables, Msg)
   --   return Tables 
   --end      
   --return nil
end


-- #### Common Routines ####

function MapPatient(Table, PID) 
end  

-- #### End of Common Routines ####


-- ##### Processing ADT (Admit/Discharge/Transfer) #####

function ProcessADT(Tables, Msg)  
end

-- ##### End of ADT Section #####

 

Next > Part 3: Mapping Repeating Information