HL7 to Database

Mapping: Lab Messages

Processing a Lab message is very simple. In this example we are only going to process the Patient information, if it exists.

Note: In a real application we would probably want to process the Lab info as well, but we chose to keep it simple for the tutorial.

ProcessLab() looks like this:

If you have a Lab message without patient data then there is nothing to process:

Note: We should probably not have a Lab message without a patient, so we could add an else statement to handle it.

As a quick thought exercise, what would we need to do to process the Lab information?

Pretty simple really:

  1. Create a new mapping function MapLab() for the Lab informationYou will find that the Out variable (Lab table node tree) does not include anywhere to map Lab dataAssuming that our database has a table called Lab, we need to add this to the Lab structure
  2. Update the VMD file to include a definition for the Lab tableWhen this is done you should see something like this:

Next Step?

Now you understand how ProcessLab() is used to process Lab messages. At this point all of the mapping operations have been performed, so we will move on to to inserting data into the database. The next step is to examine how we populate the table node tree that contains the data to be inserted into the database.