diff --git a/README.md b/README.md index a3e406f..9f14e82 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ This library is still early along in development, and some important features ar * Authentication support * Remaining API calls - * [history](http://hl7.org/implement/standards/fhir/http.html#history) * [validate](http://hl7.org/implement/standards/fhir/http.html#validate) * [transaction](http://hl7.org/implement/standards/fhir/http.html#transaction) * [conformance](http://hl7.org/implement/standards/fhir/http.html#conformance) @@ -44,6 +43,7 @@ Most of the basic RESTful API operations are supported currently. * [read](http://hl7.org/implement/standards/fhir/http.html#read) * [vread](http://hl7.org/implement/standards/fhir/http.html#vread) +* [history](http://hl7.org/implement/standards/fhir/http.html#history) * [search](http://hl7.org/implement/standards/fhir/http.html#search) * [create](http://hl7.org/implement/standards/fhir/http.html#create) * [update](http://hl7.org/implement/standards/fhir/http.html#update) @@ -178,6 +178,78 @@ that has already been retrieved. => ExceptionInfo FHIR request failed: HTTP 400 ``` +### history + +Obtaining a "revision history" for a resource can be done with the `history` function. +It returns a FHIR bundle containing resources for each change made to the resource. +This will include any deletions. Deletions are defined in a [different format](http://www.hl7.org/implement/standards/fhir/json.html#json-bundle-delete) +then other "normal" FHIR resources. `collect-resources` will not return deletions. + +You can also use the standard FHIR parameters `:_count` and `:_since` to filter the +returned versions ([see here for more info](http://hl7.org/implement/standards/fhir/http.html#history)). + +##### Examples + +```clojure +; retrieving version history for a patient resource +; (showing an example result that includes a deletion for demonstration purposes) +(history server-url :patient 1651) +=> {:resourceType "Bundle", + :id "416fda0f-2605-40be-b249-46dbc3c9fe36", + :published "2014-08-06T10:33:42.976-04:00", + :link + [{:rel "self", + :href + "http://10.160.2.151:28080/hapi-fhir-jpaserver/base/Patient/1651/_history"} + {:rel "fhir-base", :href "http://fhirtest.uhn.ca/base"}], + :totalResults "2", + :author [{:name "HAPI FHIR Server"}], + :entry + [{:deleted "2014-08-01T14:11:03.565-04:00", + :title "Huckleberry LIN (University Health Network MRN 7007469)", + :id "http://fhirtest.uhn.ca/base/Patient/1651", + :link + [{:rel "self", + :href "http://fhirtest.uhn.ca/base/Patient/1651/_history/2"}], + :updated "2014-08-01T14:11:03.565-04:00", + :published "2014-08-01T14:07:09.158-04:00"} + {:title "Huckleberry LIN (University Health Network MRN 7007469)", + :id "http://fhirtest.uhn.ca/base/Patient/1651", + :link + [{:rel "self", + :href "http://fhirtest.uhn.ca/base/Patient/1651/_history/1"}], + :updated "2014-08-01T14:07:09.165-04:00", + :published "2014-08-01T14:07:09.158-04:00", + :content + {:resourceType "Patient", + :text + {:status "generated", + :div + "
Identifier | University Health Network MRN 7007469 |
Date of birth | 01 January 1884 |