FHIR © HL7.org  |  Server Home  |  Health Intersections FHIR Server v1.0.287  |  FHIR Version 4.0.0  | User: ANONYMOUS (Unknown)  

Resource "Resource-validate" Version "1" (OperationDefinition)

Tags:

XML or JSON representation . provenance for this resource

Validate a resource

OPERATION: Validate a resource

The official URL for this operation definition is:

http://hl7.org/fhir/OperationDefinition/Resource-validate

The validate operation checks whether the attached content would be acceptable either generally, as a create, an update or as a delete to an existing resource. The action the server takes depends on the mode parameter:

  • [mode not provided]: The server checks the content of the resource against any schema, constraint rules, and other general terminology rules
  • create: The server checks the content, and then checks that the content would be acceptable as a create (e.g. that the content would not violate any uniqueness constraints)
  • update: The server checks the content, and then checks that it would accept it as an update against the nominated specific resource (e.g. that there are no changes to immutable fields the server does not allow to change, and checking version integrity if appropriate)
  • delete: The server ignores the content, and checks that the nominated resource is allowed to be deleted (e.g. checking referential integrity rules)

Modes update and delete can only be used when the operation is invoked at the resource instance level. The return from this operation is an OperationOutcome

Note that this operation is not the only way to validate resources - see Validating Resources for further information.

URL: [base]/Resource/$validate

URL: [base]/Resource/[id]/$validate

Parameters

Use Name Cardinality Type Binding Documentation
IN resource 0..1 Resource

Must be present unless the mode is "delete"

IN mode 0..1 code http://hl7.org/fhir/ValueSet/resource-validation-mode|4.0.0 (Required)

Default is 'no action'; (e.g. general validation)

IN profile 0..1 uri

If this is nominated, then the resource is validated against this specific profile. If a profile is nominated, and the server cannot validate against the nominated profile, it SHALL return an error

OUT return 1..1 OperationOutcome

If the operation outcome does not list any errors, and a mode was specified, then this is an indication that the operation would be expected to succeed (excepting for transactional integrity issues, see below)

This operation may be used during design and development to validate application design. It can also be used at run-time. One possible use might be that a client asks the server whether a proposed update is valid as the user is editing a dialog and displays an updated error to the user. The operation can be used as part of a light-weight two phase commit protocol but there is no expectation that the server will hold the content of the resource after this operation is used, or that the server guarantees to successfully perform an actual create, update or delete after the validation operation completes.

This operation returns a 200 OK whether or not the resource is valid. A 4xx or 5xx error means that the validation itself could not be performed, and it is unknown whether the resource is valid or not.

Note: the correct behaviour of validation with regard to language (especially for Coding.display) is currently undefined, and further development and testing may lead to specific requirements or recommendations in subsequent releases

Future versions of this specifcation may add additional validation parameters. A candidate list is maintained with the FHIR Validator Documentation


{
  "resourceType" : "OperationDefinition",
  "id" : "Resource-validate",
  "meta" : {
    "versionId" : "1",
    "lastUpdated" : "2018-12-14T02:02:44.567Z"
  },
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <h2>Validate a resource</h2>\n <p>OPERATION: Validate a resource</p>\n <p>The official URL for this operation definition is: </p>\n <pre>http://hl7.org/fhir/OperationDefinition/Resource-validate</pre>\n <div>\n <p>The validate operation checks whether the attached content would be acceptable either generally, as a create, an update or as a delete to an existing resource. The action the server takes depends on the mode parameter:</p>\n\n <ul>\n\n <li>[mode not provided]: The server checks the content of the resource against any schema, constraint rules, and other general terminology rules</li>\n\n <li>create: The server checks the content, and then checks that the content would be acceptable as a create (e.g. that the content would not violate any uniqueness constraints)</li>\n\n <li>update: The server checks the content, and then checks that it would accept it as an update against the nominated specific resource (e.g. that there are no changes to immutable fields the server does not allow to change, and checking version integrity if appropriate)</li>\n\n <li>delete: The server ignores the content, and checks that the nominated resource is allowed to be deleted (e.g. checking referential integrity rules)</li>\n\n </ul>\n\n <p>Modes update and delete can only be used when the operation is invoked at the resource instance level. The return from this operation is an \n <a href=\"operationoutcome.html\">OperationOutcome</a>\n </p>\n\n <p>Note that this operation is not the only way to validate resources - see \n <a href=\"validation.html\">Validating Resources</a> for further information.\n </p>\n\n </div>\n <p>URL: [base]/Resource/$validate</p>\n <p>URL: [base]/Resource/[id]/$validate</p>\n <p>Parameters</p>\n <table class=\"grid\">\n <tr>\n <td>\n <b>Use</b>\n </td>\n <td>\n <b>Name</b>\n </td>\n <td>\n <b>Cardinality</b>\n </td>\n <td>\n <b>Type</b>\n </td>\n <td>\n <b>Binding</b>\n </td>\n <td>\n <b>Documentation</b>\n </td>\n </tr>\n <tr>\n <td>IN</td>\n <td>resource</td>\n <td>0..1</td>\n <td>\n <a href=\"resource.html\">Resource</a>\n </td>\n <td/>\n <td>\n <div>\n <p>Must be present unless the mode is \"delete\"</p>\n\n </div>\n </td>\n </tr>\n <tr>\n <td>IN</td>\n <td>mode</td>\n <td>0..1</td>\n <td>\n <a href=\"datatypes.html#code\">code</a>\n </td>\n <td>\n <a href=\"valueset-resource-validation-mode.html\">http://hl7.org/fhir/ValueSet/resource-validation-mode|4.0.0</a> (Required)\n </td>\n <td>\n <div>\n <p>Default is 'no action'; (e.g. general validation)</p>\n\n </div>\n </td>\n </tr>\n <tr>\n <td>IN</td>\n <td>profile</td>\n <td>0..1</td>\n <td>\n <a href=\"datatypes.html#uri\">uri</a>\n </td>\n <td/>\n <td>\n <div>\n <p>If this is nominated, then the resource is validated against this specific profile. If a profile is nominated, and the server cannot validate against the nominated profile, it SHALL return an error</p>\n\n </div>\n </td>\n </tr>\n <tr>\n <td>OUT</td>\n <td>return</td>\n <td>1..1</td>\n <td>\n <a href=\"operationoutcome.html\">OperationOutcome</a>\n </td>\n <td/>\n <td>\n <div>\n <p>If the operation outcome does not list any errors, and a mode was specified, then this is an indication that the operation would be expected to succeed (excepting for transactional integrity issues, see below)</p>\n\n </div>\n </td>\n </tr>\n </table>\n <div>\n <p>This operation may be used during design and development to validate application design. It can also be used at run-time. One possible use might be that a client asks the server whether a proposed update is valid as the user is editing a dialog and displays an updated error to the user. The operation can be used as part of a light-weight two phase commit protocol but there is no expectation that the server will hold the content of the resource after this operation is used, or that the server guarantees to successfully perform an actual create, update or delete after the validation operation completes.</p>\n\n <p>This operation returns a 200 OK whether or not the resource is valid. A 4xx or 5xx error means that the validation itself could not be performed, and it is unknown whether the resource is valid or not.</p>\n\n <p>Note: the correct behaviour of validation with regard to language (especially for Coding.display) is currently undefined, and further development and testing may lead to specific requirements or recommendations in subsequent releases</p>\n\n <p>Future versions of this specifcation may add additional validation parameters. A candidate list is maintained with the \n <a href=\"https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator\">FHIR Validator Documentation</a>\n </p>\n\n </div>\n </div>"
  },
  "extension" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger" : 5
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode" : "normative"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
      "valueCode" : "4.0.0"
    }
  ],
  "url" : "http://hl7.org/fhir/OperationDefinition/Resource-validate",
  "version" : "4.0.0",
  "name" : "Validate a resource",
  "status" : "draft",
  "kind" : "operation",
  "date" : "2018-12-14T01:14:32+00:00",
  "publisher" : "HL7 (FHIR Project)",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://hl7.org/fhir"
        },
        {
          "system" : "email",
          "value" : "fhir@lists.hl7.org"
        }
      ]
    }
  ],
  "description" : "The validate operation checks whether the attached content would be acceptable either generally, as a create, an update or as a delete to an existing resource. The action the server takes depends on the mode parameter: \n\n* [mode not provided]: The server checks the content of the resource against any schema, constraint rules, and other general terminology rules \n* create: The server checks the content, and then checks that the content would be acceptable as a create (e.g. that the content would not violate any uniqueness constraints) \n* update: The server checks the content, and then checks that it would accept it as an update against the nominated specific resource (e.g. that there are no changes to immutable fields the server does not allow to change, and checking version integrity if appropriate) \n* delete: The server ignores the content, and checks that the nominated resource is allowed to be deleted (e.g. checking referential integrity rules) \n\nModes update and delete can only be used when the operation is invoked at the resource instance level. The return from this operation is an [OperationOutcome](operationoutcome.html)\n\nNote that this operation is not the only way to validate resources - see [Validating Resources](validation.html) for further information.",
  "code" : "validate",
  "comment" : "This operation may be used during design and development to validate application design. It can also be used at run-time. One possible use might be that a client asks the server whether a proposed update is valid as the user is editing a dialog and displays an updated error to the user. The operation can be used as part of a light-weight two phase commit protocol but there is no expectation that the server will hold the content of the resource after this operation is used, or that the server guarantees to successfully perform an actual create, update or delete after the validation operation completes.\n\nThis operation returns a 200 OK whether or not the resource is valid. A 4xx or 5xx error means that the validation itself could not be performed, and it is unknown whether the resource is valid or not.\n\nNote: the correct behaviour of validation with regard to language (especially for Coding.display) is currently undefined, and further development and testing may lead to specific requirements or recommendations in subsequent releases\n\nFuture versions of this specifcation may add additional validation parameters. A candidate list is maintained with the [FHIR Validator Documentation](https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator)",
  "resource" : [
    "Resource"
  ],
  "system" : false,
  "type" : true,
  "instance" : true,
  "parameter" : [
    {
      "name" : "resource",
      "use" : "in",
      "min" : 0,
      "max" : "1",
      "documentation" : "Must be present unless the mode is \"delete\"",
      "type" : "Resource"
    },
    {
      "name" : "mode",
      "use" : "in",
      "min" : 0,
      "max" : "1",
      "documentation" : "Default is 'no action'; (e.g. general validation)",
      "type" : "code",
      "binding" : {
        "strength" : "required",
        "valueSet" : "http://hl7.org/fhir/ValueSet/resource-validation-mode|4.0.0"
      }
    },
    {
      "name" : "profile",
      "use" : "in",
      "min" : 0,
      "max" : "1",
      "documentation" : "If this is nominated, then the resource is validated against this specific profile. If a profile is nominated, and the server cannot validate against the nominated profile, it SHALL return an error",
      "type" : "uri"
    },
    {
      "name" : "return",
      "use" : "out",
      "min" : 1,
      "max" : "1",
      "documentation" : "If the operation outcome does not list any errors, and a mode was specified, then this is an indication that the operation would be expected to succeed (excepting for transactional integrity issues, see below)",
      "type" : "OperationOutcome"
    }
  ]
}