nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
905 stars 273 forks source link

Indicate to the destination connector to skip processing and go straight to a given status #4131

Open rbeckman-nextgen opened 4 years ago

rbeckman-nextgen commented 4 years ago

I've come across multiple scenarios where in the transformer a value needs to be retrieved from another system/channel to include in the current message. If that value is not available at the current time (remote server outage, value does not yet exist, etc...) it would be very helpful to have a way to indicate to the destination connector that the message is not fit to be sent at this time. connectorMap.put('mirth_force_status', Status.QUEUED) would be an easy way to set it.

Currently my workaround is to find a field in the connector properties that I can set to a velocity variable. During processing, that variable is set to the valid value if I want the message to complete processing. It is set to a value that I know will cause the connector to error when I want to queue, and then I must check in the response transformer if it is a valid error or forced. If it was forced then I update the status to queued.

Besides being cumbersome, this leaves the error artifact behind when looking at the queued message in the message viewer, and it remains even after the message finally is sent. It also generates events that appear to be errors and are caught by any Alerts that may not be set up to specifically exclude this error. The error itself is different for each connector type since you can't break them all in the same way.

Imported Issue. Original Details: Jira Issue Key: MIRTH-4255 Reporter: agermano Created: 2018-03-30T09:52:50.000-0700

rbeckman-nextgen commented 4 years ago

Or possibly the transformer could just return a Status (including Filtered?). I don't think the return value of the transformer is currently used for anything.

Imported Comment. Original Details: Author: agermano Created: 2018-07-05T08:44:04.000-0700

rbeckman-nextgen commented 4 years ago

I can see where this would be very useful fro stats tracking. If I were to use a programmatic method to remove the message from a destination, I would like the destination to mark it as filtered.

Imported Comment. Original Details: Author: stormcel Created: 2019-05-01T11:50:13.000-0700

pacmano1 commented 4 years ago

This is very useful for holding outbound API calls because a token is not available.

thorst commented 3 years ago

This 100% would be useful

stormcel commented 5 months ago

I can think of multiple use scenarios where this would prove useful. I have had to write quite a bit of workaround code to accommodate a slow api/db repsonse.

jhoule271 commented 1 month ago

I would also like to see this feature. After all you can throw from javascript to set the status to error. The world doesn't end if the transformer stops execution of the destination before the destination connector executes. Making extra destinations is a common workaround I have seen suggested and it is a bad workaround. It's ugly and it consumes unnecessary resources.