Skip to content

Commit a22a861

Browse files
Merge pull request #212633 from mikaelweave/healthcareapis-fix-profiles-post-put
Changed profile saving from POST to PUT to make the operations idempotent
2 parents 9986f45 + 8777fe7 commit a22a861

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

articles/healthcare-apis/azure-api-for-fhir/store-profiles-in-fhir.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,27 @@ Profiles are also specified by various Implementation Guides (IGs). Some common
6666

6767
### Storing profiles
6868

69-
To store profiles in Azure API for FHIR, you can `POST` the `StructureDefinition` with the profile content in the body of the request.
69+
To store profiles in Azure API for FHIR, you can `PUT` the `StructureDefinition` with the profile content in the body of the request. An update or a conditional update are both good methods to store profiles on the FHIR service. Use the conditional update if you are unsure which to use.
7070

71+
Standard `PUT`: `PUT http://<your Azure API for FHIR base URL>/StructureDefinition/profile-id`
7172

72-
`POST http://<your Azure API for FHIR base URL>/StructureDefinition`
73+
**or**
74+
75+
Conditional update: `PUT http://<your Azure API for FHIR base URL>/StructureDefinition?url=http://sample-profile-url`
7376

7477
```
7578
{
7679
"resourceType" : "StructureDefinition",
7780
"id" : "profile-id",
81+
"url": "http://sample-profile-url"
7882
7983
}
8084
```
8185

8286
For example, if you'd like to store the `us-core-allergyintolerance` profile, you'd use the following rest command with the US Core allergy intolerance profile in the body. We've included a snippet of this profile for the example.
8387

8488
```rest
85-
POST https://myAzureAPIforFHIR.azurehealthcareapis.com/StructureDefinition?url=http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance
89+
PUT https://myAzureAPIforFHIR.azurehealthcareapis.com/StructureDefinition?url=http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance
8690
```
8791

8892
```json
@@ -167,7 +171,7 @@ The `Capability Statement` lists all possible behaviors of Azure API for FHIR. A
167171
- `CapabilityStatement.rest.resource.profile`
168172
- `CapabilityStatement.rest.resource.supportedProfile`
169173

170-
For example, if you `POST` a US Core Patient profile, which starts like this:
174+
For example, if you save a US Core Patient profile, which starts like this:
171175

172176
```json
173177
{

articles/healthcare-apis/fhir/store-profiles-in-fhir.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,27 @@ Profiles are also specified by various Implementation Guides (IGs). Some common
6767

6868
### Storing profiles
6969

70-
To store profiles to the FHIR server, you can `POST` the `StructureDefinition` with the profile content in the body of the request.
70+
To store profiles in Azure API for FHIR, you can `PUT` the `StructureDefinition` with the profile content in the body of the request. A standard `PUT` or a conditional update are both good methods to store profiles on the FHIR service. Use the conditional update if you are unsure which to use.
7171

72+
Standard `PUT`: `PUT http://<your Azure API for FHIR base URL>/StructureDefinition/profile-id`
7273

73-
`POST http://<your FHIR service base URL>/StructureDefinition`
74+
**or**
75+
76+
Conditional update: `PUT http://<your Azure API for FHIR base URL>/StructureDefinition?url=http://sample-profile-url`
7477

7578
```
7679
{
7780
"resourceType" : "StructureDefinition",
7881
"id" : "profile-id",
82+
"url": "http://sample-profile-url"
7983
8084
}
8185
```
8286

8387
For example, if you'd like to store the `us-core-allergyintolerance` profile, you'd use the following rest command with the US Core allergy intolerance profile in the body. We've included a snippet of this profile for the example.
8488

8589
```rest
86-
POST https://myworkspace-myfhirserver.fhir.azurehealthcareapis.com/StructureDefinition?url=http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance
90+
PUT https://myAzureAPIforFHIR.azurehealthcareapis.com/StructureDefinition?url=http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance
8791
```
8892

8993
```json

0 commit comments

Comments
 (0)