How to write an HL7 Ping Script? - hl7

I am currently trying to write a script that could conduct an "HL7 Ping" but I am still new to HL7 and not 100% sure how I could do that. I am trying to build out a health check for my HL7 enabled devices and have come up fruitless. I've seen solutions like testing the port and such; however, this does not fulfill my goal. I want to send a message:
MSH|^~\&|MONITORINGPING||||||ADT^A01|
And get some sort of ACK back to confirm whether the service is up and running. Does anybody out there know the answer or know where I could go to get it?

There is no such a thing as "ping" or "health check" on HL7 or MLLP level. Please refer to this answer for more details about MLLP.
The message you are sending
MSH|^~&|MONITORINGPING||||||ADT^A01|
is just one segment of ADT message. This is not a valid message. If you want the ACK in response, you should send full and valid ADT (or any other) message. Although, some HL7 Listeners may send NAK for such message; I will recommend do not rely on that.
On TCP level, you may simply ping the IP or alternatively you can telnet IP and port.

An ADT message is not appropriate to "ping" a remote system. The closest trigger event for what you're trying to do is probably NMD^N02 (Application Management Data Message). But you'll find that trigger event isn't supported by most real world applications.

Related

CAN socket - handle not ACK

I'm trying to test getting the ACK bit from a CAN network. My system has an RPI 4, PICAN DUO and transceivers to other CAN nodes. When the RPI and the other node are both connected, all is well and I'm getting 2 way communication.
When the RPI is by itself, I'm sending a Message and should receive an Error, indicating no ack has occurred, but I'm getting nothing.
Configuration:
can.interface.Bus(interface="socketcan", receive_own_messages=True, channel="can1", bitrate=500000, err_reporting=True)
You do not deal directly with ACK, but you can be notified when such event happens. All relevant info can be found in Linux SocketCAN documentation.
If you want implementation details, at this link you can find my hlcanerrdump tool which can parse and show all errors on CAN bus (including NoAck), and hlcanerrsim tool for simulating all kinds of CAN bus errors. Study the source code and you will understand how to achieve what you want.

Sending MQTT messages to Orion Context broker

I have a relatively simple switch that sends data whenever the button is pressed (either 1 or 0). The message protocol it uses is MQTT. It is connected to Mosquitto via Wi-Fi and successfully sends data to it (i am able to see it using mosquitto_sub -v -t "#". However, I would like to be able to send this data to Orion Context Broker and then receive it using REST commands and store it using Fiware-Cygnus afterwards.
the topic that sensor publishes messages to is tt/sergo/demo/sw
the name of the sensor presented in mosquitto_sub when sensor is first connected: DMS-A01
the IP - address of sensor: 192.168.0.108
I have installed Iot-Agent UL, which is working, but I don't know how to make it listen to the specific sensor that sends data to Mosquitto.
I read the manuals but either missed something or did not find the solution to my problem.
I tried using the manual below, but could not apply it to my problem.
Connecting "thing" to Fiware
Thank you in advance, stack overflow community.
Before sending measures you need to do a provision operation for the device using the IOTA-UL API. That provision operation "creates" the device in the IOTA-UL and map it with the corresponding entity at CB. Then, you can start sending measures using MQTT.
You can have a look to this piece of documentation for more detail.

How do I find what program initiated a download using wireshark?

I have a packet capture and I'm trying to find out which program a download was made with, where would I go in the packet to find this information?
Thanks all!
Instead of looking for answers within the packet, you may want to look at which port the download was done through. That could give you more information, and faster
I assume you know the destination ip address from where the file is downloaded. If it's something that you can catch while it's happening or you can trigger it then you could use netstat to determine the PID of the program that is handling that socket after filtering the netstat output based on the destination ip address.
Then you could use ps on Linux or TaskManager on Windows to know which program has that PID.
On windows: How to determine which program uses or blocks specific transmission control protocol ports in Windows
Alternative if the packet capture it's all you got and it's not a recurring event then if the download was done via HTTP you could check the headers of the HTTP request for info about the client in the User-Agent header.
Hope it helps.

SNMPv3 Discovery

I have use SNMP v1 and 2c for network discovery of printers by sending broadcast message with community "public" and it works just fine, but when I send broadcast message with version 3 of the protocol I got timeout error.
Do somebody share example of SNMPv3 device discovery?
Thank you.
Two things:
1) Doing a broadcast SNMPv1/v2c is actually not defined to work in the protocol. Cheap implementations will simply respond, as you've found, to any packet it sees that the kernel accepts to the port and not check the address. However, you'll also find some implementations that will not respond to broadcast packets. So that's actually not a surefire discovery mechanism in the first place. (Let alone, many vendors finally got smart and don't have public be the default community name)
2) SNMPv3, on the other hand, is even less likely to work because of how engineID discovery happens within the SNMPv3 protocol. SNMPv3 won't respond with a normal response PDU anyway, as it should respond with a REPORT PDU saying "this is my engineID" and you'd have to respond back with that engineID and the proper USM credentials to access the device.
In short, SNMPv3 was designed for security and there isn't a "public" equivalent any longer. You'd need to know how to access the device and can't just "guess".

How do I increase the priority of a TCP packet in Delphi?

I have a server application that receives some special TCP packet from a client and needs to react to it as soon as possible by sending an high-level ACK to the client (the TCP ACK won't suite my needs).
However, this server is really network intensive and sometimes the packet will take too long to be sent (like 200ms in a local network, when a simple server application can send it in less than 1ms).
Is there a way to mark this packet with a high-priority tag or something like that in Delphi? Or maybe with the Win32 API?
Thanks in advance.
EDIT
Thanks for all the answers so far. I'll add some details. My product has the following setup: there are several devices that are built upon vehicles with WIFI conectivity. When they arrive at the garage, those device connect to my server and start to transmit data.
Because of hardware limitations, I implemented a high-level ACK to make the device aware that the last packet arrived successfully (please, don't argue about this - the data may be broken even if I got a correct TCP ACK). However, if I use my server software, that communicates with a remote database, to issue this ACK, I get very long delay (>200ms). If I use an exclusive software to do this task, I get small latencies (<1ms). So, I was imagining if I could just tell Windows to send those special packets first, as it seems to me that this package is getting delayed so the database ones can get delivered.
That's the motivation behind my question.
EDIT 2
As requested: this is legacy software and I'm using the legacy dclsockets140.bpl package and Delphi 2010 (14.0.3593.25826).
IMO it is very difficult to realize this. there are a lot of equipment and software involved. first of all, if you communicate between 2 different OS's you got a latency. second, soft and hard firewalls, antiviruses, everything is filtering/delaying your package.
you can try also to 'hack' the system(this involve some very good knowledge on how the frames/segments are packed/send,flow control,congestion,etc), either by altering it from code, either by using some tools like http://half-open.com/ or others.
In short, passing MSG_OOB flag to the send function marks the data as "urgent". Detailed discussion about the OOB in the context of Windows Sockets implementation specifics is available here.

Resources