Common transformation for different HL7v2 ADT message types
In over a decade of using Ensemble/HealthShare, we have been able to use a single message type (doc type) for all HL7 ADT event types. We now have an application for which the HL7 segment sequence is different for A03s than it is for other ADT event types. The content of the segments is the same across event types; only the segment sequence differs. The data transformation has to do some custom logic, so we can't just use the "copy" variety of the transformation Create property.
Because a different message schema has to be used for A03s, the only way I can think of accomplishing this is to have one transformation for the A03 messages and another transformation for the other ADT event types. Because the transformation rules will be identical in both, we'd essentially have duplicate transformations. And that means remembering to maintain two transformations for future changes.
Does anyone have a simpler/better idea for handling more than one schema for which transformation rules don't differ across those schemas?
If the individual segment transformations are common across all ADT DTLs, you could implement your DTLs with subtransforms (these work at the segment level). As long as the gross structure of the messages rarely changes, the maintenance is all done in segment DTLs.
The commonality to which I referred is for the one application only. (That may be what you were implying, not across all applications.) But the subtransform approach is still valid in this case. Thanks for the idea.
You could also try adding a code section to you DTL, similar to this.
//this part collates the info to set the doctype
set version=target.GetValueAt("MSH:VersionID.versionID")
set type=target.GetValueAt("MSH:MessageType.messagetype")
set trigger=target.GetValueAt("MSH:MessageType.triggerevent")
//set trigger="A05"
if ((trigger = "A08")!(trigger = "A11")!(trigger = "A27")!(trigger = "A03")!(trigger = "A12")!(trigger = "A13")){SET trigger = "A01"}
//this sets the doctype
set target.DocType=version_":"_type_"_"_trigger
//set target.DocType="2.4:ADT_A05"