以下の例を使用して、Minimum Lower-Layer Protocol (MLLP) を介して HL7 メッセージを読み書きします。
グローバルプロパティの設定
例を使用する前に、次のグローバルプロパティを設定します。
-
Delimiter (区切り文字)
MLLP メッセージを区切る標準の HL7 区切り文字値。これは、16 進の 0x1C 文字 (FS) です。一部の診療所のアプリケーションでは、この項目で異なる区切り値を使用しています。HL7 MLLP Connector の標準値は 001C として表示されます。
-
Host (ホスト)
ソケットのホストアドレスを設定します。
-
Port (ポート)
ソケットのポートを設定します。
高度な接続について、次の項目を入力します。
-
Reuse address (アドレスの再利用)
設定したソケットを再利用するか、ソケットにバインドしようとしたら失敗するか。
-
Send TCP With No Delay (遅延なく TCP を送信)
データを即時に送信するか、または効率化のためにデータをまとめてから送信するか。
-
Linger (延長)
残りのデータが正しく送信されるように、ソケットが閉じるまでにかかる時間 (ミリ秒)。
-
Keep alive (キープアライブ)
ソケットが長時間未使用のまま開いている場合と接続を使用できない場合にソケット接続を閉じるかどうか。
-
Fail on unresolved host (ホストを解決できない場合は失敗)
作成時のソケットがエンドポイントに設定されているホストを解決できない場合に失敗するかどうか。
-
TLS tab (TLS タブ)
新しい TLS 設定を定義します。このパラメーターがある場合、単純な TCP の代わりに SSLServerSocket が使用されることを暗黙に示しています。
-
Set the send or receive buffer size (送信または受信バッファサイズの設定)。
例 - 読み取りおよび書き込みメッセージ
このワークフローの例では、MLLP を介した HL7 メッセージの読み取りおよび書き込みを逐次呼び出します。
-
writer-flow (書き込みフロー)
特定のメッセージをソケット経由で送信して reader-flow で受信できるようにします。
-
reader-flow (読み取りフロー)
MLLP メッセージを受信し、メッセージをログに記録します。
-
アプリケーション、index、styles、app-config、rest-service、order-controller、write-order は、ユーザーインターフェースに関連する静的リソースの読み込みに使用されます。
MLLP を介した HL7 メッセージの読み取りおよび書き込み
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:mllp="http://www.mulesoft.org/schema/mule/mllp"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/mllp
http://www.mulesoft.org/schema/mule/mllp/current/mule-mllp.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
<mllp:mllp-listener-config name="Mule_HL7_MLLP_Listener_config"
doc:name="Mule HL7 MLLP Listener config">
<mllp:mllp-listener-connection host="localhost" port="40000" />
</mllp:mllp-listener-config>
<mllp:request-config name="Mule_HL7_MLLP_Request_config"
doc:name="Mule HL7 MLLP Request config">
<mllp:mllp-requester-connection host="localhost" port="40000" >
<mllp:local-address-settings port="49999" host="localhost" />
</mllp:mllp-requester-connection>
</mllp:request-config>
<http:listener-config name="HTTP_Listener_config"
doc:name="HTTP Listener config">
<http:listener-connection host="localhost" port="8081" />
</http:listener-config>
<flow name="reader-flow">
<mllp:mllp-listener doc:name="Mllp listener"
config-ref="Mule_HL7_MLLP_Mllp_listener_config"/>
<logger level="INFO" doc:name="Logger" message="#[payload]"/>
</flow>
<flow name="writer-flow">
<http:listener doc:name="Listener" config-ref="HTTP_Listener_config"
path="/send"/>
<mllp:send doc:name="Send" config-ref="Mule_HL7_MLLP_Request_config">
</mllp:send>
</flow>
<flow name="index">
<http:listener doc:name="Listener" config-ref="HTTP_Listener_config"
path="/"/>
<parse-template doc:name="Parse Template"
location="ui-demo/index.html"/>
</flow>
<flow name="styles">
<http:listener doc:name="Listener" config-ref="HTTP_Listener_config"
path="/styles"/>
<parse-template doc:name="Parse Template"
location="ui-demo/styles/styles.css"/>
</flow>
<flow name="app-config">
<http:listener doc:name="Listener" config-ref="HTTP_Listener_config" path="/app-config"/>
<parse-template doc:name="Parse Template"
location="ui-demo/app-config.js"/>
</flow>
<flow name="app">
<http:listener doc:name="Listener" config-ref="HTTP_Listener_config"
path="/app"/>
<parse-template doc:name="Parse Template"
location="ui-demo/app.js"/>
</flow>
<flow name="rest-service">
<http:listener doc:name="Listener" config-ref="HTTP_Listener_config"
path="services/restService"/>
<parse-template doc:name="Parse Template"
location="ui-demo/services/restService.js"/>
</flow>
<flow name="order-controller">
<http:listener doc:name="Listener" config-ref="HTTP_Listener_config"
path="order/order.controller"/>
<parse-template doc:name="Parse Template"
location="ui-demo/order/order.controller.js"/>
</flow>
<flow name="write-order">
<http:listener doc:name="Listener"
config-ref="HTTP_Listener_config"
path="/order/writeOrder"/>
<parse-template doc:name="Parse Template"
location="ui-demo/order/writeOrder.html"/>
</flow>
</mule>