File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const main = (
2929 auth : new google . auth . GoogleAuth ( {
3030 scopes : [ 'https://www.googleapis.com/auth/cloud-platform' ] ,
3131 } ) ,
32+ responseType : 'json' ,
3233 } ) ;
3334
3435 const getFhirResource = async ( ) => {
@@ -42,11 +43,18 @@ const main = (
4243 const name = `projects/${ projectId } /locations/${ cloudRegion } /datasets/${ datasetId } /fhirStores/${ fhirStoreId } /fhir/${ resourceType } /${ resourceId } ` ;
4344 const request = { name} ;
4445
45- const resource =
46- await healthcare . projects . locations . datasets . fhirStores . fhir . read (
47- request
46+ try {
47+ const resource =
48+ await healthcare . projects . locations . datasets . fhirStores . fhir . read (
49+ request
50+ ) ;
51+ console . log ( `Got ${ resourceType } resource:\n` , resource . data ) ;
52+ } catch ( error ) {
53+ console . error (
54+ `Error getting ${ resourceType } resource:` ,
55+ error . message || error
4856 ) ;
49- console . log ( `Got ${ resourceType } resource:\n` , resource . data ) ;
57+ }
5058 } ;
5159
5260 getFhirResource ( ) ;
You can’t perform that action at this time.
0 commit comments