Skip to content

Commit 9d8a04c

Browse files
authored
fix(healthcare): set responseType to JSON instead of Buffer (#4236)
1 parent 553cffd commit 9d8a04c

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

healthcare/fhir/getFhirStoreCapabilities.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const main = (
2727
auth: new google.auth.GoogleAuth({
2828
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2929
}),
30+
responseType: 'json',
3031
});
3132

3233
const getFhirStoreCapabilities = async () => {
@@ -38,9 +39,16 @@ const main = (
3839
const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}/fhir/metadata`;
3940
const request = {name};
4041

41-
const fhirStore =
42-
await healthcare.projects.locations.datasets.fhirStores.get(request);
43-
console.log(JSON.stringify(fhirStore.data, null, 2));
42+
try {
43+
const fhirStore =
44+
await healthcare.projects.locations.datasets.fhirStores.get(request);
45+
console.log(JSON.stringify(fhirStore.data, null, 2));
46+
} catch (error) {
47+
console.error(
48+
'Error getting FHIR store capabilities:',
49+
error.message || error
50+
);
51+
}
4452
};
4553

4654
getFhirStoreCapabilities();

0 commit comments

Comments
 (0)