This topic contains 2 replies, has 3 voices, and was last updated by  Casey Trauer 14 hours, 57 minutes ago.

Making a segment optional programmatically

  • Hello, I am very new to using Iguana and Chameleon. Not sure if this is the right place for this question however I am trying to make a few segments required based on a value in a previous segment. We are using iguana to parse HL7 message into a database. We get messages that are either a charge or a payment. If the message is a charge, we need certain segments required while they are only optional when a payment message comes thru. If anyone can provide me guidance I would appreciate it.

    Is any reason that you need to make those segments required?
    You can always enforce them inside the translator.

    Hello,

    In Chameleon, you can model different types of messages. Each type of message can have different rules about which segments are optional. Each message type is usually defined by some value in one of the fields — typically MSH.9 but you have many options on which fields to use, so you could test for a value in any field. (Read more about message definitions here.)

    When you define message structure syntax rules in the VMD you export from Chameleon, Iguana will automatically generate a list of validation conflicts when you parse the message. You can capture these errors and log them or create some other workflow to handle that message.

    Alternatively, you can create VMDs in Chameleon that enforce no required segments and no particular segment order. Then you can use Lua scripting logic to test validation rules rather than leverage Chameleon validations. Customers will often use this approach when they want to reuse a more generic VMD across all their interfaces.

    You should be able to pursue either strategy and get the job done.

    Casey Trauer,
    Director, Client Education
    iNTERFACEWARE

Tagged: 

You must be logged in to reply to this topic.