I think the binary resource is appropriate. Assuming that the FHIR server supports versioning, then you just ask it for the latest binary resource and it returns the resource (software installation file) along with the HTTP Content-Location
. The value of the Content-Location
contains the version number, which you can then compare against the version that is currently installed.
GET [base]/Binary/my-device
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Last-Modified: Thu, 24 Apr 2013 00:41:55 +1200
Content-Location: http://[base]/Binary/my-device/_history/4
The version number, 4 in this case, is the last component of the Content-Location
.
As you can see the server will also return the date and time that the software installation file was updated in the HTTP Last-Modified
header. It might be easier to use this instead of relying upon a version number.
If you decide to use a date based version, then you can just ask the FHIR server to return all installation files since your last update. Note, that you should add 1 second to your last update date because FHIR treats the _since
query parameter as inclusive.
GET [base]/Binary/my-device?_since=2013-04-24T00:41:56+1200
The above returns a bundle of software installation files since your last update, which is most instances will contain no entries because your device is up to date.