Skip to content

Commit 9240de4

Browse files
Merge pull request #250252 from EXPEkesheth/patch-101
Update validation-against-profiles.md
2 parents 47e0402 + 8e6901f commit 9240de4

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

articles/healthcare-apis/fhir/validation-against-profiles.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ Per specification, Mode can be specified with `$validate`, such as create and up
1919
- `update`: Checks that the profile is an update against the nominated existing resource (that is no changes are made to the immutable fields).
2020

2121
There are different ways provided for you to validate resource:
22-
- Validate an existing resource with validate operation.
23-
- Validate a new resource with validate operation.
24-
- Validate on resource CREATE/ UPDATE using header.
22+
- Option 1: Validate an existing resource with validate operation.
23+
- Option 2: Validate a new resource with validate operation.
24+
- Option 3: Validate on resource CREATE/ UPDATE using header.
25+
26+
On the successful validation of an existing/ new resource with the validate operation, resource is not persisted into the FHIR service. Use Option 3: Validate on resource CREATE/ UPDATE using header, to persist successfully validated resource to the FHIR service.
2527

2628
FHIR Service will always return an `OperationOutcome` as the validation results for $validate operation. FHIR service does two step validation, once a resource is passed into $validate endpoint - the first step is a basic validation to ensure resource can be parsed. During resource parsing, individual errors need to be fixed before proceeding further to next step. Once resource is successfully parsed, full validation is conducted as second step.
2729

2830
> [!NOTE]
2931
> Any valuesets that are to be used for validation must be uploaded to the FHIR server. This includes any Valuesets which are part of the FHIR specification, as well as any ValueSets defined in Implementation Guides. Only fully expanded Valuesets which contain a full list of all codes are supported. Any ValueSet definitions which reference external sources are not supported.
3032
31-
## Validating an existing resource
33+
## Option 1: Validating an existing resource
3234

3335
To validate an existing resource, use `$validate` in a `GET` request:
3436

@@ -100,7 +102,7 @@ If you'd like to specify a profile as a parameter, you can specify the canonical
100102

101103
`GET https://myworkspace-myfhirserver.fhir.azurehealthcareapis.com/Observation/12345678/$validate?profile=http://hl7.org/fhir/StructureDefinition/heartrate`
102104

103-
## Validating a new resource
105+
## Option 2: Validating a new resource
104106

105107
If you'd like to validate a new resource that you're uploading to the server, you can do a `POST` request:
106108

@@ -113,7 +115,7 @@ For example:
113115
This request will first validate the resource. New resource you're specifying in the request will be created after validation.
114116
The server will always return an `OperationOutcome` as the result.
115117

116-
## Validate on resource CREATE/UPDATE using header
118+
## Option 3: Validate on resource CREATE/UPDATE using header
117119

118120
You can choose when you'd like to validate your resource, such as on resource `CREATE` or `UPDATE`. By default, the FHIR service is configured to opt out of validation on resource `Create/Update`. This capability allows to validate on `Create/Update`, using the `x-ms-profile-validation` header. Set `x-ms-profile-validation' to true for validation.
119121

@@ -130,6 +132,7 @@ You can choose when you'd like to validate your resource, such as on resource `C
130132
}
131133
}
132134
```
135+
To enable strict validation, use 'Prefer: handling' header with value strict. By setting this header, validation warning will be reported as an error.
133136

134137
## Next steps
135138

0 commit comments

Comments
 (0)