To receive REST call directly into a Business Service is not the most recommended because you can't apply any kind of access restriction to the service. What I always recommend is to create a web application managed by a class that extends from %CSP.Rest and resend the JSON received to the Business Service.

You can see an example on this article:

https://community.intersystems.com/post/creating-rest-service-iris

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") 
    ObjectScript
    ObjectScript
  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")
 }
ObjectScript
ObjectScript

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.