Stream: implementers
Topic: error code 400 vs 422
frank cao (Sep 05 2019 at 19:43):
Hi, I'm trying to decide which error code to use for validation errors for a patient match operation. The operation takes a Parameter resouce that contains a Patient resource, and returns a Bundle if results are found. My question is: should I use 400 if the request resource is non-conformant in any way, or should I use 422 if it only fails businss rules, and 400 for structural and valueset validation? The confusion stems from the FHIR rule that says "422 Unprocessable Entity - the proposed resource violated applicable FHIR profiles or server business rules", does the "violated profile" refer to the structure part or the semantic part? Should 422 only be used for resource create or update? Thanks.
Grahame Grieve (Sep 05 2019 at 20:46):
probably semantic part but there's always uncertainty here, so you shouldn't worry too much about it
Last updated: Apr 12 2022 at 19:14 UTC