0

Our scenario is there is an EHR system that is integrating with a device sensor partner using FHIR. In this scenario both companies will have independent FHIR servers. Each of them has different Patient and Organization(s) records with their own identifiers. The preference is the the sensor FHIR server keep the mapping of EHR identifiers to it's own internal identifiers for these resources

The EHR wants to assign a Patient to a Device with the sensor FHIR server.

Step 1: First the EHR would @GET the list of Device resources for a given Organization where a Patient is not currently assigned from the sensor FHIR server e.g.

/api/Device?organization.identifier=xyz&patient:missing=true

Here I would assume the Organization identifier is that of the EHR system since the EHR system doesn't have knowledge of the sensor system Organization identifier at this point.

The reply to this call would be a bundle of devices:

... snip ...

"owner": {
"reference": "http://sensor-server.com/api/Organization/3"
},  

... snip ...

Question 2: Would the owner Organization reference have the identifier from the search or the internal/logical ID as it's known by the sensor FHIR server as in the snippet above?

Step 2: The clinician of the EHR system chooses a Device from the list to assign it to a Patient in the EHR system

Step 3: The EHR system will now issue a @PUT /api/Device/{id} request back to the sensor FHIR server to assign a Patient resource to a Device resource e.g.

{
  "resourceType": "Device",
  "owner": {
    "reference": "http://sensor-server.com/api/Organization/3"
  },  
  "id": "b4994c31f906",
  "patient": {
    "reference": "https://ehr-server.com/api/Patient/4754475"
  },
  "identifier": [
    {
      "use": "official",
      "system": "bluetooth",
      "value": "b4:99:4c:31:f9:06",
      "label": "Bluetooth address"
    }
  ]
}

Question 3: What resource URI/identifier should be used for the Patient resource? I would assume it is that of the EHR system since the EHR system doesn't have knowledge of the sensor system Patient identifier. Notice however, that the Organization reference is to a URI in the sensor FHIR server while the Patient reference is a URI to the EHR system - this smells funny.

Step 4: The EHR can issue a @GET /api/Device/{id} on the sensor FHIR server and get back the Device resource e.g.

{
  "resourceType": "Device",
  "owner": {
    "reference": "http://sensor-server.com/api/Organization/3"
  },  
  "id": "b4994c31f906",
  "patient": {
    "reference": "https://sensor-server.com/api/Patient/abcdefg"
  },
  "identifier": [
    {
      "use": "official",
      "system": "bluetooth",
      "value": "b4:99:4c:31:f9:06",
      "label": "Bluetooth address"
    }
  ]
}

Question 4: Would we expect to see a reference to the Patient containing the absolute URI to the EHR FHIR server (as it was on the @PUT in Step 3) or would/could the sensor FHIR server have modified that to return a reference to a resource in it's FHIR server using it's internal logical ID?

Marco Di Cesare
  • 133
  • 2
  • 7
  • For "question 2", are you asking if "http://sensor-server.com/api/Organization/3" is guaranteed to have an identifier with value "xyz"? Or are you trying to ask if the result should be something like "reference": " ... xyz ... " where the 'xyz' appears in the reference somehow? – Tim Tisdall Aug 21 '15 at 15:26
  • As to "question 4", [maybe this other question about accepting absolute references may help](http://stackoverflow.com/questions/31944275/hl7-fhir-accepting-absolute-foreign-references-on-server/31947577) (you'll need to read the comments on the answer, though) – Tim Tisdall Aug 21 '15 at 15:29
  • For Question 2 I was asking if the Device resource returned from the @GET would have a reference to the Organization resource with the sensor FHIR server's logical id for it or whether it should have the identifier that was used in the search param in the query String. – Marco Di Cesare Aug 21 '15 at 18:35

1 Answers1

2

I didn't see a Question 1, so I'll presume it's the "assume" sentence in front of your first example. If the EHR is querying the device sensor server and the organizations on the device sensor server include the business identifier known by the EHR, then that's reasonable. You would need some sort of business process to ensure that occurs though.

Question 2: The device owner element would be using a resource reference, which means it's pointing to the "id" element of the target organization. Think of resource ids as primary keys. They're typically assigned by the server that's storing the data, though in some architectures, they can be set by the client (who creates the record using PUT instead of POST). In any event, you can't count on them being meaningful business identifiers - and according to most data storage best practices, they generally shouldn't be. And if, as I expect, your scenario involves multiple EHR clients potentially talking to the "device" server, the resource id couldn't possibly align with the business ids of all of the EHRs. (That's a long way of saying "no 'xyz' probably won't be '3')

Question 3: If the EHR has its own server, the EHR client could update the device on the "sensor" server to point to a URL on the EHR server. Whether that's appropriate or not depends on your architecture. If you want other EHRs to recognize the patient, then you'd probably want the "sensor" server to host patients too and for the EHR to look up the patient by business id and then reference the "sensor" server's URL. If not, then pointing to the EHR server's URL is fine.

Question 4: When you do a "GET", its normal to receive back the same data you specified on a POST. It's legal for the server to change the data, including possibly updating references. But that's likely to confuse a lot of client systems, so it's not generally recommended or typical.

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
  • Question 2: Not quite sure I am clear on this one. So I've issued a @GET with an organization identifier query search param of 'xyz' on the sensor server and got back a bundle with list of matching Devices. What should I expect for the owner references of those Devices? From reading your replies it sounds like it could/should be the reference/URI to that Organization on the sensor server that would have the primary key/logical id as known to the sensor server. Am I understanding that correctly? – Marco Di Cesare Aug 21 '15 at 18:44
  • 1
    Right. So your searching using "identifier" - which is the business identifier associated with the organization. The reference will be the resource id - essentially the primary key. It could be that the organization is hosted on the sensor server, or it could be hosted somewhere else. In either case, you can't count on it being the same as the business identifier. (Particularly given that a resource can only have one resource id/url, but can have multiple business identifiers.) – Lloyd McKenzie Aug 21 '15 at 23:12