@Timothy Leavitt, I had to create a custom business process to ingest the data from JSON into a Record Map I built for the request to FHIR. The JSON FHIR structures don't really work within the Data Transformation tool. 

Our use case is the following: An EMS squad brings in a Trauma Case into our Emergency Room. The Trauma Case is Registered within Epic as Trauma. Until registration or Medical Records updates the Patient record within our EMR, the name will remain Trauma.

However, the EMS folks send a Result for the Medical Record which is Trauma... in our EMR, but they might send an updated name and demographics. Which causes the Result to fail based on Patient Validation errors in the EMR.

So, the design I came up, was to send a Patient Search FHIR query to the EMR to get the demographics that are currently assigned to that Medical Record, use that information to update the Result from the EMS vendor, and send the Result to the EMR to have it post in a timelier manner instead of waiting for a user in the EMR to work the error to post the result to the Patient's Chart.

We have not fully tested the workflow as of yet, but just getting the Request to be sent via FHIR to the EMR, and interpreting the result was the difficult part.

Stay Connected is set at 60, messages are sent to the BO in batches depending on when we receive the HL7 message that it requires a lookup. 

Because this is going through a Java Gateway Business Service it seems like there is a disconnect on when the BO loses connection and pipe that it uses through the Java Gateway Business Service. The BO loses the connection, but the Java Gateway Business Service still thinks it is connected to the Database.

I have tried adding Connection Attributes to the BO, but it has not help.

Business Operation Settings

  <Item Name="PatientBillingDBPoll" Category="PatientBilling,SQL,PROD,CC,VANW,PatFeeder" ClassName="osuwmc.PatientBilling.PatientBillingDBPollOperation" PoolSize="1" Enabled="true" Foreground="false" Comment="Is used to lookup items against clarity tables" LogTraceEvents="true" Schedule="">
    <Setting Target="Adapter" Name="Credentials"></Setting>
    <Setting Target="Adapter" Name="DSN">MS-PatientBilling</Setting>
    <Setting Target="Adapter" Name="JGService">PatientBilling.JavaGateway</Setting>
    <Setting Target="Host" Name="FailureTimeout">20</Setting>
    <Setting Target="Host" Name="ReplyCodeActions">E=R</Setting>
    <Setting Target="Host" Name="AlertOnError">0</Setting>
    <Setting Target="Adapter" Name="StayConnected">60</Setting>
    <Setting Target="Adapter" Name="ConnectionAttributes">"queryTimeout = 30";"socketTimeout = 60";"cancelQueryTimeout = 45";"connectRetryCount = 100";"connectRetryInterval = 5"</Setting>
    <Setting Target="Host" Name="ArchiveIO">1</Setting>
  </Item>

Java Gateway Settings

<Item Name="PatientBilling.JavaGateway" Category="PROD" ClassName="EnsLib.JavaGateway.Service" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
    <Setting Target="Host" Name="Port">55558</Setting>
    <Setting Target="Host" Name="JavaHome">/usr</Setting>
    <Setting Target="Host" Name="Logfile"></Setting>
    <Setting Target="Host" Name="ClassPath">/nfs/data/drivers/java/*</Setting>
    <Setting Target="Host" Name="JVMArgs">-d64 -Xss512k -Xmx1024m -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+ExplicitGCInvokesConcurrent -XX:+UseStringDeduplication -XX:MaxHeapFreeRatio=10 -XX:MinHeapFreeRatio=5</Setting>
  </Item>

I have many examples of doing this, as we have Operations that write and read data from MS SQL using stored procedures.

You said your problem is with the email, how is the email defined within the Message Data Class?

Typically I create a Message Data Class for the Parameters of the Stored Procedure and use that Message Data Class to send to my EnsLib.SQL.OutboundAdapter which is using the Message Class to map to the Class Method that sends the Execution call to the Stored Procedure on MS SQL.

If you need more help, feel free to reach out.