Mutating Data
In this tutorial we will learn how to add new data or modify existing data in the Commure Platform.
You will need to be authenticated to read data, so make sure to read the authentication tutorial first.
React Data Mutation
The simplest way to create or update data in the Commure Platform is to use the
<withFhirDataMutate/>
higher-order component.
The above example will create a new Patient
resource with the following contents:
Since we are using FhirMethod.POST
,
a new resource will be created.
Related Reading
withFhirDataMutate component reference documentation
Non-React Data Mutation
The same data as in the React example above can be created using curl
as
follows.
You'll need to replace TENANT_ID
with your actual Commure tenant ID, which you
find in the top right menu in the console. The ACCESS_TOKEN
should
be replaced with the value obtained after
authentication.
The above curl
command will return something like the following.
Related Reading
Working With FHIR
Commure FHIR API