Hi,
This is how I am reading the resource
const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}/fhir/${resourceType}/${resourceId}`;
const request = {name};
const resource =
await healthcare.projects.locations.datasets.fhirStores.fhir.read(
request
);
console.log(`Got resource:\n`, resource.data.text());
The response I am getting is
Promise {
'{\n' +
' "id": "94b39b5b-48ed-497c-a242-a7cf798395e2",\n' +
' "meta": {\n' +
' "lastUpdated": "2024-06-10T13:35:39.358817+00:00",\n' +
' "versionId": "MTcxODAyNjUzOTM1ODgxNzAwMA"\n' +
' },\n' +
' "organization": {\n' +
' "reference": "Organization/29e3d12d-2f38-49e9-adce-a15e01634055"\n' +
' },\n' +
' "practitioner": {\n' +
' "reference": "Practitioner/47668024-02ec-4ec7-a0a9-f144074d7a39"\n' +
' },\n' +
' "resourceType": "PractitionerRole",\n' +
' "specialty": [\n' +
' {\n' +
' "coding": [\n' +
' {\n' +
' "code": "277745000",\n' +
' "display": "Pediatrician (occupation)",\n' +
' "system": "
http://snomed.info/sct"\n' +
' }\n' +
' ]\n' +
' }\n' +
' ]\n' +
'}'
}
How do I serialize this into a json object?
Thanks,
Abhijit