Hullo All,
I am currently working on a custom script in Inner Harbor's HL7 Spy. Most everything is going well, but I'm having difficulty scrubbing out embedded PDFs. Logic: if OBX-5.2 == "PDF", then set OBX-5.5.1 = "PDF". My roughed out code is below:
public HL7Message getStrippedMessage()
{
HL7Message message = GetParsedMessage();
foreach(var obx in message.OBXs)
{
if(obx.ObservationValue_05.ElementAt(2).TX_01.Value == "PDF")
{
obx.ObservationValue_05.ElementAt(5).TX_01.Value = "PDF";
}
}
return message;
}
What does it currently do, you ask? It returns the unaltered HL7 message. I'm sure neither the 'if' nor the assignment therein are formatted correctly even though they compile without issue. Could anyone advise on how I would check and alter, respectively, these fields?
Many Thanks
Got a chance to talk with a dev here and found that this one is actually really quite simple. OBX-5, being a coded entry, is handled quite differently from the other fields. This solution is probs pretty obvious to others with more experience, but I locked myself into some tunnel vision.