Below I summarized what I have tried so far for handling partial update in HL7 FHIR.
1) Syntax
URL: http://[server]/[resource]/[logical id]/_delta
method: POST
I did not use PATCH method since some of older browser does not support this method, also not sure whether PATCH method has been supported in all javascript library
2) Extension element to specify update mode
For each element to be added/replaced/deleted, added the following extension
<extension url="http://hl7.org/fhir/Profile/iso-21090#updateMode" >
<valueCode value="A or R or D" />
</extension>
As an example, below is the XML snippet for updating birthDate
<birthDate value="1970-03-13">
<extension url="http://hl7.org/fhir/Profile/iso-21090#updateMode" >
<valueCode value="R" />
</extension>
</birthDate>
3) Handling collection
For collection data elements such as name, address and contact in Patient resource, server needs to know which element within the collection is to be replaced/deleted. So I decided to pull collection element's internal id as part of the query response, and then use the same id when submitting the payload to server
- Added collection element internal id in query response as part of element extension
<telecom>
<extension url="http://hl7.org/fhir/metadata#id">
<valueString value="1308"/>
</extension>
<system value="phone"/>
<value value="68181256"/>
<use value="home"/>
</telecom>
- Payload for partial update
<telecom>
<extension url="http://hl7.org/fhir/metadata#id">
<valueString value="1308"/>
</extension>
<extension url="http://hl7.org/fhir/Profile/iso-21090#updateMode" >
<valueCode value="R" />
</extension>
<system value="phone"/>
<value value="68181256"/>
<use value="office"/>
</telecom>
4) Suggestion
The above approach works okay so far, however I'd like to make one suggestion here. As we can see from the above XML snippet, the content is very verbose after adding extension elements.Can we add the two attributes (id and updateMode) in FHIR resource as part of Element built-in attributes? In this way, the content will be very compact as the following snippet shows,
<telecom id="1308" updateMode="R">
<system value="phone"/>
<value value="68181256"/>
<use value="office"/>
</telecom>
Tuesday, April 8, 2014
Subscribe to:
Posts (Atom)
HL7 FHIR APIs can fundamentally transform the rapid development of frontend web application
Just imagine if all your backend APIs is based on HL7 FHIR API, how it will fundamentally transform your frontend web application developme...
-
Below is the some of the slides from the recent sharing at FHIR DevDays 2024 ( https://www.devdays.com/ ) on Singapore's National Healt...
-
Recently I am approached by one project team, who stated that it is very difficult to implement HL7 FHIR API with the following two reasons ...
-
During recent Ken Rubin's trip to Singapore in May 28, I shared my views and suggestions on how to effectively adopt/develop healthcare...