@@ -163,6 +163,8 @@ Here are implementations for:
163163
164164### Resource's CRUD
165165
166+ #### Create Resource
167+
166168To create a FHIR resource, call
167169` myClient.create(entry, callback, errback) ` , passing
168170an object that contains the following properties:
@@ -199,9 +201,9 @@ myClient.create(entry,
199201
200202```
201203
202- ### Search
204+ #### Search Resource
203205
204- fhir.search({type: resourceType, query: queryObject}),
206+ To search a resource, call ` fhir.search({type: resourceType, query: queryObject}) ` ,
205207where queryObject syntax ` fhir.js ` adopts
206208mongodb-like query syntax ([ see] ( http://docs.mongodb.org/manual/tutorial/query-documents/ ) ):
207209
@@ -229,6 +231,32 @@ mongodb-like query syntax ([see](http://docs.mongodb.org/manual/tutorial/query-d
229231
230232```
231233
234+ #### Update Resource
235+
236+ To update a resource, call ` fhir.update({type: resourceType, id: identifier, resource: resourceObject}) ` .
237+ In case of success,the callback function will be invoked.
238+
239+ Example:
240+ ``` javascript
241+ this .fhirClient .update ({
242+ type: " Patient" ,
243+ id: 1 ,
244+ resource: {
245+ name: ' New Name'
246+ }
247+ }).catch (function (e ){
248+ console .log (' An error happened while updating patient: \n ' + JSON .stringify (e));
249+ throw e;
250+ }).then (function (bundle ){
251+ console .log (' Updating patient successed' );
252+ return bundle;
253+ });
254+ ```
255+
256+ #### Delete Resource
257+
258+ To update a resource, call ` fhir.delete({type: resourceType, id: identifier}) ` .
259+
232260For more information see [ tests] ( https://github.com/FHIR/fhir.js/blob/master/test/querySpec.coffee )
233261
234262## AngularJS adapter: ` ng-fhir `
0 commit comments