Create
The create operation is used to create a new resource on the server. The server will return the created resource with an id and meta information. For R4 Endpoint we support create operation for all data models under the R4 Data model.
API
R4
- CLI
- Curl
- Typescript
iguhealth api create r4 --data '$MY_RESOURCE'
curl --request POST --header "Authorization: Header" --header "Content-Type: application/fhir+json" --data '$MY_RESOURCE' ${domain}/w/${tenant}/api/v1/fhir/r4/${resourceType}
await client.create({}, R4, resource);
R4B
- CLI
- Curl
- Typescript
iguhealth api create r4b --data '$MY_RESOURCE'
curl --request POST --header "Authorization: Header" --header "Content-Type: application/fhir+json" --data '$MY_RESOURCE' ${domain}/w/${tenant}/api/v1/fhir/r4b/${resourceType}
await client.create({}, R4B, resource);
Example
The following is an example of a create response for a Patient resource.
- Request
- Response
iguhealth api create r4 --data '{"resourceType" :"Patient"}'
{
"id": "gfH47MJRa8wG9eH5XZwibo",
"meta": {
"extension": [
{
"url": "https://iguhealth.app/version-sequence",
"valueInteger": 2551
},
{
"url": "https://iguhealth.app/author",
"valueReference": {
"reference": "ClientApplication/5K89P9NcTjtw4wjy-POJsD"
}
}
],
"versionId": "2551",
"lastUpdated": "2024-06-23T23:01:15.346+00:00"
},
"resourceType": "Patient"
}