CDA HL7V3 acknowledgement - mirth

I create using Mirth a channel that receives CDA messages in HL7V3 format.
I'm able to parse the message and extract all the data i need.
My question is: How do i create an acknowledgement to the receiver?
I found out that there is a message called MCCI_MT000200UV01 that i need to implement but i can't find good explanation and/or examples.
I have been working a long time with HL7V2 and the acknowledgement is very simple.
Can't find a way to implement this in HL7V3 format.
Thanks in advance for your help

I guess you are talking about a generic Accept Acknowledgment message which is MCCI_IN000002UV02 (according to the HL7v3 NE2014). If I were you, first thing to do I'd download the HL7v3 Normative Edition that matches the year of your inbound message used to transport the CDA document (unless it's HL7v2). Then I'd go to HL7v3NE > Specification Infrastructure > Messaging > Transmission Infrastructure > Generic Message Transmission and find the Accept Ack interaction. There is a related XML Schema that allows you to build an XML template for the v3 ACK (XMLSpy like tool does that by default).
Since ACKGenerator does not support HL7v3, next step is to create a code templates function that builds the v3 ACK from the template you acquired from the previous step.
(PS. The whole procedure with samples is explained in an "Unofficial Mirth Connect Developer's Guide" available at mirthconnect.shamilpublishing.com)

Related

Problems creating a soap connection with IBM SDI

I have recently been working with IBM SDI software for identity and governance.
To get started I was given the exercise of building a calculator using a soap request to this WSDL server.
Given a CSV file, with ID, number1, number2 and operation attributes, i need to create a csv output file with the id attribute and the result of the operation.
Some advices were:
use "invoke soap" connector to make a request to the service
take FormEntry connector to take operations calculated by the SOAP, setting a parameter of this connector called "EntryRawData"
Up to now, the only thing I was able to do was to crate a file connector that reads the csv file in input.
The problems start with SOAP connector. Any help is kindly appreciated.
Even more I have some problems understanding what a WSDL server is, what it does, and what a SOAP request is. Thank you in advance.

File Endpoint for Citrus Framework

I'm currently looking at using Citrus for our Integration Testing, however our Integration Software uses amongst others, file messages - where files are written to an inbound folder, picked up and processed which results in a new file message being written to an outbound folder or data being written to SQL.
I was wondering if Citrus can write a file with a certain payload to an inbound folder and then monitor for a file to appear in certain outbound folder and/or in a SQL table.
Example Test Case:
file()
.folder(todoInboundFolder)
.write()
.payload(new ClassPathResource("templates/todo.xml"));
file()
.folder(todoOutboundFolder)
.read()
.validate("/t:todo/t:correlationId", "${todocorrelationId}")
.validate("/t:todo/t:title", "${todoName}");
query(todoDataSource)
.statement("select count(*) as cnt from todo_entries where correlationid = '${todocorrelationId}'")
.validate("cnt", "1");
Additionaly - is there a way to specific the timeout to wait for the file/SQL entries to appear?
There is no direct implementation of the file endpoint yet in Citrus. There was a feature request but it was closed due to inactivity https://github.com/citrusframework/citrus/issues/151
You can solve this problem though by using a simple Apache Camel route to do the file transfer. Citrus is able to call the Camel route and use its outcome very easily. Read more about this here https://citrusframework.org/citrus/reference/2.8.0/html/index.html#apache-camel
This would be the workaround that can help right now. Other than that you can reopen or contribute to the issue.

Nifi Email ConsumeIMAP filter by subject, from , to and date

Using ConsumeIMAP to read emails from an Inbox and trying to select only emails that have
- attachment to download
- sent "From" xyz#yahoo.com
- send "To" abc#gmail.com
- Have "Daily" in their subject
- at 8 am EST
Please let me know if it can be set in any component. I tried to use EvaluateJsonPath, ExtractEmailHeaders and RouteonAttribute but no luck yet.
It sounds like you have been exploring the correct path. You should be able to achieve this using a flow consisting of:
ConsumeIMAP >> ExtractEmailHeaders >> RouteOnAttribute
ConsumeIMAP will download messages from the email server and create a single FlowFile for each message, storing the email message raw bytes in the FlowFile contents.
ExtractEmailHeaders attempts to parse a FlowFile's contents as email (must be RFC-2822 compliant), extract email headers, and write each header field to a FlowFile attribute, including:
email.headers.from.*
email.headers.to.*
email.headers.subject
email.headers.sent_date
Note that ExtractEmailHeaders is not doing any filtering, just populating FlowFile attributes based on the FlowFile content, thus making the FlowFiles more easily routable downstream in the flow. Start just by creating a flow that has these two processors and verify that the output of the ExtractEmailHeaders processor meets these expectations. If not, its possible the email messages are malformed or not RFC-2822 compliant.
After you have successfully sent email FlowFiles through ExtractEmailHeaders, you can do the filtering using one or more RouteOnAttribute processors using the NiFi Expression Language to define your match conditions, e.g.:
${email.headers.subject.contains("Daily")}
If you have verified that your flow is working correctly through ExtractEmailHeaders, but the filtering in RouteOnAttribute is not working as expected, make sure your attribute expressions and assumptions about email header values (e.g., capitalization, datetime format) are correct. Consult the Apache NiFi Expression Language Guide and if you have specific questions relating to the expression language itself, search here or post another question on that specifically.
I hope this helps!

Mirth: How to send to a destination multiple times

I would like to read a HL7 message containing multiple orders (ORC segments). My destination is a web service sender which can only handle one order at a time.
How can I iterate through the input HL7 message and send to a destination each time?
Thanks for any help.
As is stated above there are several ways to do it.
I normally did this in a JavaScript transformer step. I basically built a small state engine that would iterate over the incoming (raw) message by splitting the incoming message on '\r' characters. It would then build the outbound message as a string by identifying the "header" section (part that does not change) and storing that in a string, say Header, and the order section (the part that does change) as another string, say Order, and the concatenating them together when I reach the next order or the end of the string and sending them to another channel with
router.routeMessage('channelName', Header + '\r' + Order);
You may create another channel that communicates with your web-service and route the ORC portion to that channel.
For additional information you may read the "Unofficial Mirth Connect Developer's Guide" available at mirthconnect.shamilpublishing.com
(Disclaimer: I'm the author of this guide so any comments or suggestions are welcome.)

MSMQ querying for a specific message

I have a questing regarding MSMQ...
I designed an async arhitecture like this:
CLient - > WCF Service (hosted in WinService) -> MSMQ
so basically the WCF service takes the requests, processes them, adds them to an INPUT queue and returns a GUID. The same WCF service (through a listener) takes first message from queue (does some stuff...) and then it puts it back into another queue (OUTPUT).
The problem is how can I retrieve the result from the OUTPUT queue when a client requests it... because MSMQ does not allow random access to it's messages and the only solution would be to iterate through all messages and push them back in until I find the exact one I need. I do not want to use DB for this OUTPUT queue, because of some limitations imposed by the client...
You can look in your Output-Queue for your message by using
var mq = new MessageQueue(outputQueueName);
mq.PeekById(yourId);
Receiving by Id:
mq.ReceiveById(yourId);
A queue is inherently a "first-in-first-out" kind of data structure, while what you want is a "random access" data structure. It's just not designed for what you're trying to achieve here, so there isn't any "clean" way of doing this. Even if there was a way, it would be a hack.
If you elaborate on the limitations imposed by the client perhaps there might be other alternatives. Why don't you want to use a DB? Can you use a local SQLite DB, perhaps, or even an in-memory one?
Edit: If you have a client dictating implementation details to their own detriment then there are really only three ways you can go:
Work around them. In this case, that could involve using a SQLite DB - it's just a file and the client probably wouldn't even think of it as a "database".
Probe deeper and find out just what the underlying issue is, ie. why don't they want to use a DB? What are their real concerns and underlying assumptions?
Accept a poor solution and explain to the client that this is due to their own restriction. This is never nice and never easy, so it's really a last resort.
You may could use CorrelationId and set it when you send the message. Then, to receive the same message you can pick the specific message with ReceiveByCorrelationId as follow:
message = queue.ReceiveByCorrelationId(correlationId);
Moreover, CorrelationId is a string with the following format:
Guid()\\Number