How could we find inside PID a specific field?
First of all thanks for your help and time
We would need to find inside PID:3 which one meets the following condition:
PID 3.4.1 = "CAC" and PID 3.5 = "JHN"
We have been investigating how could we do it
We have achieved to get single fields in a call request as follows:
request.GetValueAt("ORCgrp(1).ORC:OrderingProvider(1).IDNumber")
##class(Ens.Util.Time).ConvertDateTime(request.GetValueAt("PID:DateTimeofBirth"),"%Y%m%d","%Y-%m-%d")
However, how would you recommend us to look for a specific field in PID meets a specific criteria?
How would you find inside PID if there are PID 3.4.1 = "CAC" and PID 3.5 = "JHN" and get its PID 3.1?
Also we have read:
https://community.intersystems.com/post/hl7-segment-query
https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.UI...
Thanks for your time, and thanks for replying to this question
Hey Yone.
Assuming you're only using ObjectScript for this, then way to achieve this would be to take your HL7 as Enslib.HL7.Message, and then loop through the segments to pull out the PID segment, and then loop through PID:3 for a match.
For example:
Alternatively, you could create a DTL with the logic which you can from the ObjectScript, and then have the target in your DTL be something like a string container that you can then grab a result from. However that might be a bit clunky depending on your use case.