Well, if your IRIS doesn't support Embedded Python you can do the following (if you are using a Linux Server):

  1. Install some application like ImageMagick in your server
  2. From your Business Operation use $ZF(-100) function to execute in the server the magick command to convert the PDG to JPG, something like:
    $ZF(-100,"","magick","\usr\image.pdf","\usr\image.jpg") 
  3. Maybe it takes some time to finish, you can wait to the end of the execution or just create a business service to get all the new pdf files.

That's easy! You only need to add in your DTL an action with the following code:

 Set matchFound = 0
 // Get count of OBR segments
 Set tOBXCnt = source.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp(*)")

 // Loop through OBXs and evaluate field contents
 For tIter = 1:1:tOBXCnt
 {
   set nextIter = tIter+1
   if tIter < tOBXCnt
   {  
     If ((source.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp("_tIter_").OBX:ObservationValue")["SEDATION:") &&
       (source.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp("_nextIter_").OBX:ObservationValue")["Procedure"))
     {
       Set matchFound = 1
     }
   }
   
 }
 if (matchFound = 1)
 {
  do target.SetValueAt("28014-9","PIDgrpgrp(1).ORCgrp(1).OBR:UniversalServiceID.identifier")
 }

As you can see, we keep the seach of the "SEDATION:" and "Procedure" strings and after that, if we find it in our source message, we just update the value of the specific field in the target.

Hi Yone! 

As far as I know there are no applications to compare productions (maybe I'm wrong), but It wouldn't be too hard to develop something to check it, at the end, a production is saved as any other class and you can access to the specific file of the class to compare.

Here you have an example of a production class:

Class QUINIELA.Production Extends Ens.Production [ Not ProcedureBlock ]
{

XData ProductionDefinition
{
<Production Name="QUINIELA.Production" LogGeneralTraceEvents="false">
  <Description></Description>
  <ActorPoolSize>1</ActorPoolSize>
  <Item Name="QUINIELA.BO.ImportBO" Category="" ClassName="QUINIELA.BO.ImportBO" PoolSize="5" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="QUINIELA.BP.ImportBPL" Category="" ClassName="QUINIELA.BP.ImportBPL" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="QUINIELA.BO.StatusBO" Category="" ClassName="QUINIELA.BO.StatusBO" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="QUINIELA.BS.FromWSBS" Category="" ClassName="QUINIELA.BS.FromWSBS" PoolSize="0" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="QUINIELA.BO.PrepareBO" Category="" ClassName="QUINIELA.BO.PrepareBO" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="QUINIELA.BO.TrainBO" Category="" ClassName="QUINIELA.BO.TrainBO" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
  </Item>
  <Item Name="QUINIELA.BP.PrepareBP" Category="" ClassName="QUINIELA.BP.PrepareBP" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="QUINIELA.BP.TrainBP" Category="" ClassName="QUINIELA.BP.TrainBP" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="false" Schedule="">
  </Item>
  <Item Name="QUINIELA.BO.UtilsBO" Category="" ClassName="QUINIELA.BO.UtilsBO" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
  </Item>
  <Item Name="QUINIELA.BO.MatchBO" Category="" ClassName="QUINIELA.BO.MatchBO" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
  </Item>
</Production>
}

}

And here you have an example in Python to compare the content of two files. You only need to know the path in your server to access to those class files to compare.

No problem @Christine Nyamu ! Take a look to this code:

 Set context.matchFound = 0
 // Get count of OBR segments
 Set tOBXCnt = request.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp(*)")

 // Loop through OBXs and evaluate field contents
 For tIter = 1:1:tOBXCnt
 {
   set nextIter = tIter+1
   if tIter < tOBXCnt
   {  
     If ((request.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp("_tIter_").OBX:ObservationValue")["SEDATION:") &&
       (request.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp("_nextIter_").OBX:ObservationValue")["Procedure"))
     {
       Set context.matchFound = 1
     }
   }
   
 }

This code will check the OBX segments and check a variable to 1 in case that "SEDATION" and "Procedure:" are in consecutive segments.

You can add that code in an Activity of your BPL and check the matchFound variable.