Skip to main content

googlehealthcare@1.0.0

createFhirResource

createFhirResource([fhirStore], resource, callback) ⇒ Operation

Create some resource in Google Cloud Healthcare

ParamTypeDescription
[fhirStore]ObjectThe 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.
resourceobjectThe FHIR resource data to be created
callbackfunctionAn 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}`,
},
})
);