Add the connector to a Logic Apps Standard project
- 1Reference the package
in a NuGet-based Logic App project. Download
Lambogenius.MllpConnector.LogicApps.<version>.nupkgfrom Downloads (sign in first), save it in a folder such aspackages/, and make that folder a package source innuget.config.<ItemGroup> <PackageReference Include="Lambogenius.MllpConnector.LogicApps" Version="<version>" /> </ItemGroup>The
host.jsonthe runtime reads must not have anextensionBundlesection, or the runtime ignores the project's packages. The VS Code extension re-adds it to the source file, so remove it from the build and publish copies (the sample project'sRemoveExtensionBundleFrom*HostJsontargets do this). - 2Add connections
to
connections.json: one per listening port, and one per destination.{ "serviceProviderConnections": { "mllpListenerAdt": { "displayName": "MLLP listener (ADT)", "serviceProvider": { "id": "/serviceProviders/lamboHl7Mllp" }, "parameterValues": { "host": "@appsetting('MLLP_RECEIVE_HOST')", "port": "@appsetting('MLLP_RECEIVE_ADT_PORT')", "encoding": "auto" } }, "mllpEmr": { "displayName": "MLLP destination (EMR)", "serviceProvider": { "id": "/serviceProviders/lamboHl7Mllp" }, "parameterValues": { "host": "@appsetting('MLLP_EMR_HOST')", "port": "@appsetting('MLLP_EMR_PORT')" } } } }Connection setting Meaning hostSend: the receiver's host name or IP. Trigger: the local address to listen on, usually 0.0.0.0. Keep it an @appsetting(...) reference. portSend: the receiver's port. Trigger: the listening port, one per receiving workflow. startBlock / endBlock / trailerMLLP block characters as hex. Defaults 0x0B / 0x1C / 0x0D; trailer none for no trailer. encodingutf-8 (default), any .NET encoding name, or auto to read MSH-18. useTls, tlsVersion, tlsCertificate, …See TLS - 3Receive with the trigger.
This workflow answers ADT messages with AA and everything else with AR, like a BizTalk two-way receive location.
{ "definition": { "triggers": { "When_a_message_is_received": { "type": "ServiceProvider", "inputs": { "parameters": { "acknowledgementMode": "Workflow", "acknowledgementType": "Original", "responseTimeoutSeconds": 30, "timeoutBehavior": "SendNegativeAck" }, "serviceProviderConfiguration": { "connectionName": "mllpListenerAdt", "operationId": "receiveMessage", "serviceProviderId": "/serviceProviders/lamboHl7Mllp" } } } }, "actions": { "Is_ADT": { "type": "If", "expression": { "equals": [ "@triggerBody()?['messageCode']", "ADT" ] }, "actions": { "Accept": { "type": "ServiceProvider", "inputs": { "parameters": { "contextId": "@triggerBody()?['contextId']", "ackCode": "AA", "text": "@concat('Processed ', triggerBody()?['messageType'])" }, "serviceProviderConfiguration": { "connectionName": "mllpListenerAdt", "operationId": "sendAcknowledgement", "serviceProviderId": "/serviceProviders/lamboHl7Mllp" } } } }, "else": { "actions": { "Reject": { "type": "ServiceProvider", "inputs": { "parameters": { "contextId": "@triggerBody()?['contextId']", "ackCode": "AR", "text": "@concat('Unsupported message type ', triggerBody()?['messageType'])", "errorCode": 200 }, "serviceProviderConfiguration": { "connectionName": "mllpListenerAdt", "operationId": "sendAcknowledgement", "serviceProviderId": "/serviceProviders/lamboHl7Mllp" } } } } } } } }, "kind": "Stateless" } - 4Run it locally.
Start Azurite, build the project, and run
func startinbin/Debug/net8.0. No license is needed under Core Tools. Then send a message with the test tool.
In Azure, the trigger needs a host that accepts inbound TCP on its port: hybrid deployment or your own container. On App Service plans, receive through the gateway instead; the Send message action works on every plan.