The SQL Inbound Adapter is normally used in such a way that produces a new message per Row.

The File Outbound Adapter is normally used in such a way that produces a new File per received message. Check the overwrite setting (put it to false to append new lines) and verify that when you use PutLine you are using the same file name.

Hello @Mohamed Hassan Anver,

I think that the tutorial is for EF 6 that is designed for .NET Framework. And MS is not promoting more EF Framework, right now, MS has EF core as goal (check this: https://docs.microsoft.com/es-es/ef/efcore-and-ef6/ ) and is the right EF to go in my opinion.

However IRIS is not supporting EF Core https://community.intersystems.com/post/how-can-i-use-iris-net-core-entity-framework. :-( 

Any thought @Bob Kuszewski ?
 

Review the cconsole.log and check if there is any problem with the license, also you can check Application errors log

Well, there are only 2 tables related with that queries:

Ens.MessageHeader(https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=EMONITOR_concepts#EMONITOR_concepts_msgs)

EnsLib.HL7.Messages (https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=EHL72_tools#EHL72_tools_classes)

Any Ensemble Message has a header object or record (Ens.MessageHeader) the Message Body related with this Header can be any persistent object. Then you have to check MessageBodyClassName property to check if the body is a EnsLib.HL7.Message, then you can link the Header and Body using MessageBodyId property.

I hope this helps.

Ens.MessageHeader

Do you want to explore the content of the HL7 Messages using SQL? Or only meta Data like document type, date etc? In case you want more data from HL7 body using SQL I recommend to use a HL7 Search table

Hello Lassi,

You should create a new Business Service class extending the HL7 Business Service of your election (TCP, HTTP, etc) and after overwrite this method:

method OnConstructReply(Output pReplyDoc As EnsLib.EDI.Document, pOriginalDoc As EnsLib.EDI.Document, ByRef pReplyCode As %String, ByRef pSC As %Status, pEarlyAck As %Boolean) as %Status

Override this method to construct a customized reply document. Inputs are the original document and the reply code and the status code that the framework produced in processing the original document. If you change the status code but do not construct a reply document, the framework will use the new value to construct a standard reply document. 
If you construct a non-HL7 object it must still have a property called 'Envelope'. Piece:2 of this value will be written verbatim.

Consider this example (I didn't test it):

method OnConstructReply(Output pReplyDoc As EnsLib.EDI.Document, pOriginalDoc As EnsLib.EDI.Document, ByRef pReplyCode As %String, ByRef pSC As %Status, pEarlyAck As %Boolean) as %Status

{

    Set pReplyDoc=pOriginalDoc.NewReplyDocument(,..LocalFacilityApplication)
    Set pReplyDoc.Source=pOriginalDoc.%Id()
    Do:..#UseOriginalControlId pReplyDoc.SetValueAt(pOriginalDoc.GetValueAt("1:10"),"1:10") ; copy the control id to the ack control id
    Set tAckMSA=##class(EnsLib.HL7.Segment).%New($LB("",1))
    Set tAckMSA.Separators=pReplyDoc.Separators
    Do tAckMSA.SetValueAt("MSA",0)
    Do tAckMSA.SetValueAt("CE",1)
    Do tAckMSA.SetValueAt(pOriginalDoc.GetValueAt("1:10"),2)
    Do:$G($$$ExpectedSequenceNumber) tAckMSA.SetValueAt($$$ExpectedSequenceNumber,4)
    Do pReplyDoc.AppendSegment(tAckMSA)
    Set pReplyDoc.IsMutable=0
    Quit $$$OK

}

I guess you are using Studio (Not Atelier) in order to create the Studio Project. Right?

Then the idea is simple. You have to create a new Studio Project, add any class to the project, save the project from "File/Save Project As..." and after use the Project from the Deployment Page at Management Portal.

What's the thing not working?

Yes you are true in your observation. There are severals things to improve.

Regarding get several files in an easy way you can use an Studio Project in order to pack everything you need and select the project in the Deployment screen.