File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ function main(
3131 scopes : [ 'https://www.googleapis.com/auth/cloud-platform' ] ,
3232 } ) ,
3333 headers : { 'Content-Type' : 'application/json-patch+json' } ,
34+ responseType : 'json' ,
3435 } ) ;
3536
3637 async function patchFhirResource ( ) {
@@ -50,8 +51,19 @@ function main(
5051 requestBody : patchOptions ,
5152 } ;
5253
53- await healthcare . projects . locations . datasets . fhirStores . fhir . patch ( request ) ;
54- console . log ( `Patched ${ resourceType } resource` ) ;
54+ try {
55+ const resource =
56+ await healthcare . projects . locations . datasets . fhirStores . fhir . patch (
57+ request
58+ ) ;
59+ console . log ( `Patched ${ resourceType } resource` ) ;
60+ console . log ( JSON . stringify ( resource . data , null , 2 ) ) ;
61+ } catch ( error ) {
62+ console . error (
63+ `Error patching ${ resourceType } resource:` ,
64+ error . message || error
65+ ) ;
66+ }
5567 }
5668
5769 patchFhirResource ( ) ;
You can’t perform that action at this time.
0 commit comments