google / simhospital

Apache License 2.0
666 stars 76 forks source link

cannot establish mllp connection #4

Open mizue31g opened 3 years ago

mizue31g commented 3 years ago

When I tried to establish a connection to the MLLP adapter (https://github.com/GoogleCloudPlatform/mllp) by specifying mllp_destination option for SimHospital, an error occurred. Error message: FATA [2021-05-26T02: 16: 16Z] Cannot create Hospital Runner error = "cannot create default hospital config: cannot create the sender: cannot establish mllp connection on sender & {client: conn: address: 127.0.0.1: 2575 mllpKeepAlive: false mllpKeepAlivePeriod: 60000000000 count: 0}: cannot connect to tcp address 127.0.0.1: 2575: dial tcp 127.0.0.1: 2575: connect: connection refused "prefix = cmd / simulator source =" main. main (cmd / simulator / simulator.go: 134) ""

Both SimHospital and MLLP Adapter are running on the same server, and their commands are as follows:

[MLLP Adapter] docker run --network = host \ gcr.io/cloud-healthcare-containers/mllp-adapter \ / usr / mllp_adapter / mllp_adapter \ --hl7_v2_project_id = $ PROJECT_ID \ --hl7_v2_location_id = $ REGION \ --hl7_v2_dataset_id = $ DATASET_ID \ --hl7_v2_store_id = $ HL7_STORE_ID \ --export_stats = false --receiver_ip = 127.0.0.1 \ --mllp_addr = https: //healthcare.googleapis.com: 443 / v1beta1 \ --logtostderr

[Sim Hospital] docker run --rm -it -p 8000: 8000 \ eu.gcr.io/simhospital-images/simhospital:latest \ health / simulator \ -output mllp \ -mllp_destination 127.0.0.1:2575

I confirmed that MLLP Adapter is listening on TCP 2575 and I could send a HL7 message to 127.0.0.1:2575.

EugOSullivan commented 1 year ago

Did you ever work out this issue? I've just hit the exact same problem

stefpiatek commented 1 year ago

I haven't used the MLLP adapter but would you need to change 127.0.0.1 -> host.docker.internal or run this within a docker compose network?

mizue31g commented 1 year ago

@EugOSullivan Sorry for the late response. Yes, I could fix the isssue and confirmed it works. Below change is needed. From

--mllp_addr=https: //healthcare.googleapis.com: 443 / v1beta1

To

--api_addr_prefix=https://healthcare.googleapis.com:443/v1beta1

EugOSullivan commented 1 year ago

Thanks both