How to identify devices with HL7? - hl7

I am looking for HL7 messages by which I can identify the vendor and type of devices I have in my network (e.g. Medlink - Xray, Alaris - IV pump).
Are there any specific messages I should be looking at to achieve this?
Are the PRT segment and OBX-18 the relevant sources of information?

If would be much easier to answer if you could post a sample message that you have to deal with. But as a general practice you can follow below steps. You can use a application like HL7 soup to decode your HL7 messages. Please refer the below screenshot.
All the details related to the sender is encoded in MSH segment.

I am not aware about specific message for this but, I can see following workarounds:
Use MSH(2) (Sending Application) and MSH(3) (Sending Facility)
Data in these fields identify the sending application and facility. If this is configured different on each device, you can maintain a table in your database to map device against this data. This is only applicable if unique values for those fields are configured on each device.
Custom field in Z segment
This is only applicable if you can convenience the owner of device to manipulate/customize the HL7 message. Implement custom Z (ZDS may be) segment and define some field (ZDS(1) may be) with mutual communication and pass the device identifier in this field. You can then map this field in your database against device.
IP address on TCP level
If your communication is happening over TCP/IP, you may maintain a master table with device and IP address. Use this mapping to identify the device. You get IP address when the device connects to you.
These may not really be a solutions, just hacks - those also based on some pre-requisites.
Hope this helps you.

Related

Anylogic How to queue and process received messages by agents

--This post has been edited as #Benjamin has suggested in his answer
I am trying to model peer influence for churn situations. Agents will send messages to their peers depending on different conditions. I have also created a List called MessagesReceived to store received messages.(The number of these messages may be >1).
I have tried processing (i.e. adding the message to a list of received messages) these messages in Connections>OnMessageReceived but although I can access message and sender objects, I don't know how to access the receiving agent there.
what would you suggest in this case?
P.S: variable names and types may be a little different in screenshots but the problem I described here does not come from that.
Please always only ask one question per issue, else it gets too confusing.
So let me answer your first question:
although I can access message and sender objects, I don't know how to access the receiving agent there
You can simply type this. in the code box below and you have access to "yourself". In fact, you do not even need that, simply access the fields from "yourself" here. If you are in an agent with variable myVar, you simply use that.
For the other questions, please open separate issues, see this.

What are the available iPhone MDM AccessRights

I am currently using 8191 for the 'AccessRights' variable required for the MDM payload (com.apple.mdm).
Now when using this the users gets the following message:
The administrator may collect personal data, add/remove accounts and
restrictions, list, install and manage apps, and remotely erase data
on your iPhone
Telling him/her the MDM-server are allowed to wipe the device remotely. Now I don't want the MDM-server to be able to do this at all.
When I change the AccessRights to 4161 for instance, the message changes into:
The administrator may collect personal data, and list, install and
manage apps on your iPhone
Now I can't find ANY reference to this AccessRights variable and its values. Can anyone enlighten me on what the value actually represents?
Here is the table that describes all flags for access rights:
You can mix these values to configure necessary list of access rights.
In your particular cases:
8191 - is a combination of all above values.
4161 - is a combination of 4096, 64 and 1.
Update:
Visput's printscreen of "Mobile Device Management Protocol Reference" provides the desired numerical values for AccessRights . However this answer will remain for context, the lessons learned along the way and the mention that said material may be subject to NonDisclosure Agreements due to the nature of the Apple confidential material.
For clear understanding of the answer's scope as well as for the sake of explaining to novices i will provide a little context.
Context
First off Mobile Device Management (MDM) provides you with features which are organized into a collection of settings called configuration profiles - features like real management capabilities, including convenient configuration, self-service tools, and enhanced protection etc.
These profiles are just XML file that allow you to distribute configuration information.
Configuration profiles are in property list format.
From the document that describes the keys in a configuration profile and provides examples of the resulting XML payloads, PayloadContent is one of the keys. It is also the one you meant that contains the AccessRights property.
PayloadContent[optional] is an Array of payload dictionaries (payload objects). Not
present if IsEncrypted is true.
The docs specify that these are the Payload Dictionary Keys Common to All Payloads: PayloadType,PayloadVersion,PayloadIdentifier,PayloadUUID,PayloadDisplayName,PayloadDescription,PayloadOrganization.
In addition to the standard payload keys above, each payload type contains keys that are specific to that payload type.
You are working with PayloadType "com.apple.mdm" and are looking for payload-specific keys for the MDM payload.
Conclusion
I have looked long and hard for all references of mdm payload keys. All i could find where a couple of AccessRights values, there is none in the official documentation available to the public.
The closest i could find was Inside the mdm protocol (pdf). A project with the goal of not creating a simple, turn-key, stand-alone MDM server, nor probing the protocol for weaknesses or hidden features, but simply to document as much of the protocol as possible.
From this document:
Unfortunately, documentation of the underlying protocol has never been
freely available. Obviously, third parties selling MDM servers were
provided access to the documentation by Apple, but it’s not been
available for researchers or smaller development shops. This
hampers risk analysis for enterprises making use of MDM. In order to aid such risk
assessments, and to enable and encourage future research, this project was born.
Now i consider the document to be very useful for understanding MDM. On access rights it provides an image page 8 representing a print screen of a GUI tool which presents access rights as check boxes. As for generated values, your best chance is to google anything like:
<key>AccessRights</key>
<integer>8191</integer>
I've also found the value 2047 somewhere.
I've also found mentions of access rights in this Security Configuration Recommendations from the NSA for Apple iOS devices. On page 16 you have Access Rights for Remote Administrators:
The following settings control what an MDM server is permitted to
query from an iOS device. For an enterprise-owned,
enterprise-controlled device, permitting the enterprise administrator
to query as much information as possible is appropriate. Some MDM
products may simply include these access rights by default and offer
options to retrieve less information from the device.
And it goes on to actually list the check boxes which where also illustrated in the previous guide. No correspondence to xml generated data/ids.
The closest i got to the actual id's was in this mdm-settings.xml which enumerates the access rules along with some other data used on the device for iOS6.
Your best change is to contact apple support and ask for details.
The info you are looking for may be subject to NonDisclosure Agreements due to the nature of the Apple confidential material. The document above was based on data available in Developer Preview

MultipeerConnectivity Pass Thumbnail Before Connecting

I am trying to figure out a way to pass a thumbnail image between devices BEFORE the devices agree to connect.
Therefore I can not use the send data or send resource methods.
I can't pass it in the discoveryInfo as that would go over the discoveryInfo's size limit.
Yes I COULD store the image on a server and store a link to it in the discoveryInfo and pass that, but that isn't really an option (one for example, think about no internet connection)
The reason for this is I need to show the thumbnail of the user next to their name when they show up in the list.
(I am NOT using the standard peer picker window, but doing my own interface using MCNearbyServiceAdvertiser and MCNearbyServiceBrowser)
Does anyone have any ideas of how I could pass a thumbnail, or pass reference to a thumbnail that I can then have the app on their device then get, via standard controls/Multipeer/Bonjour/etc?
Thanks!
When you hear the nearby peer and invite them to join the session, you call
invitePeer:toSession:withContext:timeout:
The context is an "arbitrary piece of data that is passed to the nearby peer. This can be used to provide further information to the user about the nature of the invitation."
Presumably, you can include an NSData that contains a thumbnail image in the context.
You can exchange information at an earlier stage by providing discoveryInfo when creating the MCNearbyServiceAdvertiser. This is a dictionary of key-value pairs that are made available to browsers. However, you cannot use that for a thumbnail as "The key-value pair must be no longer than 255 bytes (total) when encoded in UTF-8".
To exchange larger amounts of data you need to create a custom discovery class using Bonjour for discovery.

vCard's tag in URI

I need to upload Contact's information to the web server. I know that it can be done using HTTP PUT approach.
Also API from Address Book Programming guide, even some wrappers (such as RHAddressBook), allow us to generate NSData from Person's contact information.
I detected by WireShark how it is done on one of the servers.
For instance the part of URI for creating (uploading) vCard is this:
.../default/17b0dff5-5145-4515-85c0-5eb56f225f12.vcf
How to generate that tag (17b0dff5-5145-4515-85c0-5eb56f225f12)?
How it is calculated from vCard's data?
Dont know which server you are going to interact with but, in general, the last segment of the URI just need to be unique in the addressbook collection on the server. That is why many clients use some form of UUID.
In other words, the URI is not calculated from the vCard.

RoR: Providing users with unique email addresses

As an RoR newbie, I'm hoping to get insight into what direction I need to take on how to achieve the following (or if its even possible.)
My app will serve as a middle-man between a user and a 3rd party application. Users of the 3rd party application are provided a unique email address that they can send email(text) to, which is then saved into the 3rd party app.
Instead of users sending text to the 3rd party app, I want intercept this text, and strip out the metadata (date, from, subject, etc.), then save each of the pieces of data accordingly into the 3rd party app. With that being said, I envisioned providing users with unique email addresses from my application, that I would match up to their 3rd party address.
Question 1: How would I auto-provision my unique email addresses in
RoR? Question 1.1: Are there providers/APIs that allow for this?
The dirty way is for me to use a hosting provider that allows for unlimited email addresses and manually create a lot of them.
I was looking at using a service such as Mailgun or Cloudmailin to help facilitate the capture/parsing of the incoming email contents.
I don't believe a "catch-all" email address would serve me, as users can share my provided email address to anyone, (e.g. via a mailto link on their website), so most people emailing in may not be users in my application.
All advice/assistance is greatly appreciated. Thanks for your time.
Mailgun is your best bet for something like this - you can use a route to match the pattern of your email addresses, POST it to your RoR app, and then handle all of the processing and parsing internally. This will easily let you scale to however many addresses you want (and you can design your addresses so different patterns go different places).
Also, Mailgun/Rackspace "Fanatical Support" is really nice to have when something goes wrong.
Having used MailGun for the last 18 months or so, the one caveat I will give you is that while it is very reliable and easy to use, you will occasionally experience delivery delays depending on how busy they are. These can be a bit confusing or frustrating, but I've never had them "lose" a piece of mail on me.

Resources