     cert: nullIfEmpty config.getConf()['sync-type']['both-trigger-client-cert']
     key: nullIfEmpty config.getConf()['sync-type']['both-trigger-client-key']
     ca: nullIfEmpty config.getConf()['sync-type']['both-trigger-ca-cert']
-    
+  if out.adxAdapterID
+    options.url += '/' + adxAdapterID
+
   beforeTimestamp = new Date()
   request.post options, (err, res, body) ->
     if err
       out.error "Send to Async Receiver failed: #{err}"
       return callback false
-      
+
     if !(200 <= res.statusCode <= 399)
       out.error "Send to Async Receiver responded with non 2/3xx statusCode #{res.statusCode}"
       return callback false

      error: (data) -> append 'error', data
      pushOrchestration: (o) -> orchestrations.push o
      orchestrations: -> orchestrations
    }
  out = _out()


handler = (req, res) ->
  openhimTransactionID = req.headers['x-openhim-transactionid']

  query = url.parse(req.url, true).query
  adxAdapterID = null
  if query.adxAdapterID
    adxAdapterID = query.adxAdapterID
    delete query.adxAdapterID

  _out = ->
    body = ""
    orchestrations = []
