googlehealthcare@1.1.3
This adaptor exports the following from common:
Functions
createFhirResource
createFhirResource([fhirStore], resource, callback) ⇒ Operation
Create some resource in Google Cloud Healthcare
Param | Type | Description |
---|---|---|
[fhirStore] | Object | The FHIR store information. - cloudRegion (string): The cloud region where the FHIR store is located. - projectId (string): The ID of the project that contains the FHIR store. - datasetId (string): The ID of the dataset that contains the FHIR store. - fhirStoreId (string): The ID of the FHIR store. |
resource | object | The FHIR resource data to be created |
callback | function | An optional callback function |
Example
createFhirResource(
{
cloudRegion: "us-central1",
projectId: "adjective-noun-123",
datasetId: "my-dataset",
fhirStoreId: "my-fhir-store",
},
{
resourceType: "Patient",
name: [{ use: "official", family: "Smith", given: ["Darcy"] }],
gender: "female",
birthDate: "1970-01-01",
}
);
Example
createFhirResource(
{
cloudRegion: "us-central1",
projectId: "adjective-noun-123",
datasetId: "my-dataset",
fhirStoreId: "my-fhir-store",
},
(state) => ({
resourceType: "Encounter",
status: "finished",
class: {
system: "http://hl7.org/fhir/v3/ActCode",
code: "IMP",
display: "inpatient encounter",
},
reasonCode: [
{
text: "The patient had an abnormal heart rate. She was concerned about this.",
},
],
subject: {
reference: `Patient/${state.data.id}`,
},
})
);