{
  "resourceType" : "OperationDefinition",
  "id" : "cpg-planDefinition-questionnaire",
  "language" : "en",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition cpg-planDefinition-questionnaire</b></p><a name=\"cpg-planDefinition-questionnaire\"> </a><a name=\"hccpg-planDefinition-questionnaire\"> </a><p>URL: [base]/PlanDefinition/$questionnaire</p><p>URL: [base]/PlanDefinition/[id]/$questionnaire</p><h3>Parameters</h3><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>identifier</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#Identifier\">Identifier</a></td><td/><td><div><p>A logical identifier (i.e. 'PlanDefinition.identifier'). The server must know the PlanDefinition or be able to retrieve it from other known repositories.</p>\n</div></td></tr><tr><td>IN</td><td>resource</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/plandefinition.html\">PlanDefinition</a></td><td/><td><div><p>The PlanDefinition is provided directly as part of the request. Servers may choose not to accept resources in this fashion</p>\n</div></td></tr><tr><td>IN</td><td>url</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#canonical\">canonical</a> (<a href=\"http://hl7.org/fhir/R4/plandefinition.html\" title=\"http://hl7.org/fhir/StructureDefinition/PlanDefinition\">PlanDefinition</a>)</td><td/><td><div><p>The PlanDefinition's official URL (i.e. 'PlanDefinition.url'). The server must know the PlanDefinition or be able to retrieve it from other known repositories.</p>\n</div></td></tr><tr><td>IN</td><td>supportedOnly</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#boolean\">boolean</a></td><td/><td><div><p>If true, the questionnaire will only include those elements marked as &quot;mustSupport='true'&quot; in the StructureDefinition.</p>\n</div></td></tr><tr><td>IN</td><td>minimalOnly</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#boolean\">boolean</a></td><td/><td><div><p>If true, the questionnaire items are limited to the minimal set of elements  from the StructureDefinition.</p>\n</div></td></tr><tr><td>IN</td><td>artifactEndpointConfiguration</td><td/><td>0..*</td><td/><td/><td><div><p>Configuration information to resolve canonical artifacts</p>\n<p>Processing Semantics:</p>\n<p>Create a canonical-like reference (e.g.\n<code>{canonical.url}|{canonical.version}</code> or similar extensions for non-canonical artifacts).</p>\n<ul>\n<li>Given a single <code>artifactEndpointConfiguration</code>\n<ul>\n<li>When <code>artifactRoute</code> is present\n<ul>\n<li>And the canonical or artifact reference starts with the <code>artifactRoute</code> (up to and including the entire uri)</li>\n<li>Then attempt to resolve with <code>endpointUri</code> or <code>endpoint</code></li>\n</ul>\n</li>\n<li>When <code>artifactRoute</code> is not present\n<ul>\n<li>Then attempt to resolve with <code>endpointUri</code> or <code>endpoint</code></li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Given multiple <code>artifactEndpointConfiguration</code>s\n<ul>\n<li>Then rank order each configuration (see below)</li>\n<li>And attempt to resolve with <code>endpointUri</code> or <code>endpoint</code> in order until resolved</li>\n</ul>\n</li>\n</ul>\n<p>Rank each <code>artifactEndpointConfiguration</code> such that:</p>\n<ul>\n<li>if <code>artifactRoute</code> is present <em>and</em> <code>artifactRoute</code> <em>starts with</em> canonical or artifact reference: rank based on number of matching characters</li>\n<li>if <code>artifactRoute</code> is <em>not</em> present: include but rank lower</li>\n</ul>\n<p>NOTE: For evenly ranked <code>artifactEndpointConfiguration</code>s, order as defined in the\nOperationDefinition.</p>\n</div></td></tr><tr><td>IN</td><td>artifactEndpointConfiguration.artifactRoute</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#uri\">uri</a></td><td/><td><div><p>An optional route used to determine whether this endpoint is expected to be able to resolve artifacts that match the route (i.e. start with the route, up to and including the entire url)</p>\n</div></td></tr><tr><td>IN</td><td>artifactEndpointConfiguration.endpointUri</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#uri\">uri</a></td><td/><td><div><p>The URI of the endpoint, exclusive with the <code>endpoint</code> parameter</p>\n</div></td></tr><tr><td>IN</td><td>artifactEndpointConfiguration.endpoint</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/endpoint.html\">Endpoint</a></td><td/><td><div><p>An Endpoint resource describing the endpoint, exclusive with the <code>endpointUri</code> parameter</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/questionnaire.html\">Questionnaire</a></td><td/><td><div><p>The questionnaire form generated based on the PlanDefinition action.inputs</p>\n</div></td></tr></table><div><p>If the operation is not called at the instance level, one of the <em>identifier</em>, <em>profile</em> or <em>url</em> 'in' parameters must be provided. If more than one is specified, servers may raise an error or may resolve with the parameter of their choice. If called at the instance level, these parameters will be ignored. The response will contain a <a href=\"https://hl7.org/fhir/R4/questionnaire.html\">Questionnaire</a> instance that conforms to <a href=\"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-extr-defn\">SDC Extractable Questionnaire</a> and <a href=\"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-pop-exp\">SDC Populatable Questionnaire - Expression</a> based on the specified <a href=\"https://hl7.org/fhir/R4/plandefinition.html\">PlanDefinition</a> and/or an <a href=\"https://hl7.org/fhir/R4/operationoutcome.html\">OperationOutcome</a> resource with errors or warnings. Nested groups are used to handle complex structures and data types. If the 'minimalOnly' parameter is set to true, only minimal elements from the structure definition will be included. These are defined as:</p>\n<ol>\n<li>The element is a part of the differential; or</li>\n<li>The element is a part of the snapshot and has a cardinality of at least 1..* (min &gt; 0). Nested child elements with min &gt; 0 should also be included if parent has min &gt; 0; and</li>\n<li>The element is not constrained by fixed[x] or pattern[x]</li>\n</ol>\n<p>Of note, supportedOnly is not recommended for use with minimalOnly within CPG. See <a href=\"interactive-cds.html#questionnaire-generation-processing-semantics\">Questionnaire Processing Semantics</a> for further details.</p>\n</div></div>"
  },
  "extension" : [{
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
    "valueCode" : "cds"
  }],
  "url" : "http://hl7.org/fhir/uv/cpg/OperationDefinition/cpg-planDefinition-questionnaire",
  "version" : "2.0.0",
  "name" : "CPGPlanDefinitionQuestionnaire",
  "title" : "CPG PlanDefinition Questionnaire",
  "status" : "active",
  "kind" : "operation",
  "experimental" : false,
  "date" : "2026-06-10T15:28:01+00:00",
  "publisher" : "HL7 International / Clinical Decision Support",
  "contact" : [{
    "name" : "HL7 International / Clinical Decision Support",
    "telecom" : [{
      "system" : "url",
      "value" : "http://www.hl7.org/Special/committees/dss"
    }]
  }],
  "description" : "Generates a Questionnaire instance based on a specified PlanDefinition, creating questionnaire group items for each data requirement (StructureDefinition) referenced by action.input. A child questionnaire item is generated for each of the StructureDefinition elements.",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
      "code" : "001",
      "display" : "World"
    }]
  }],
  "code" : "questionnaire",
  "comment" : "If the operation is not called at the instance level, one of the *identifier*, *profile* or *url* 'in' parameters must be provided. If more than one is specified, servers may raise an error or may resolve with the parameter of their choice. If called at the instance level, these parameters will be ignored. The response will contain a [Questionnaire](https://hl7.org/fhir/R4/questionnaire.html) instance that conforms to [SDC Extractable Questionnaire](http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-extr-defn) and [SDC Populatable Questionnaire - Expression](http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-pop-exp) based on the specified [PlanDefinition](https://hl7.org/fhir/R4/plandefinition.html) and/or an [OperationOutcome](https://hl7.org/fhir/R4/operationoutcome.html) resource with errors or warnings. Nested groups are used to handle complex structures and data types. If the 'minimalOnly' parameter is set to true, only minimal elements from the structure definition will be included. These are defined as:\n1. The element is a part of the differential; or\n2. The element is a part of the snapshot and has a cardinality of at least 1..\\* (min > 0). Nested child elements with min > 0 should also be included if parent has min > 0; and\n3. The element is not constrained by fixed[x] or pattern[x]\n\n\nOf note, supportedOnly is not recommended for use with minimalOnly within CPG. See [Questionnaire Processing Semantics](interactive-cds.html#questionnaire-generation-processing-semantics) for further details.",
  "resource" : ["PlanDefinition"],
  "system" : false,
  "type" : true,
  "instance" : true,
  "parameter" : [{
    "name" : "identifier",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "A logical identifier (i.e. 'PlanDefinition.identifier'). The server must know the PlanDefinition or be able to retrieve it from other known repositories.",
    "type" : "Identifier"
  },
  {
    "name" : "resource",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The PlanDefinition is provided directly as part of the request. Servers may choose not to accept resources in this fashion",
    "type" : "PlanDefinition"
  },
  {
    "name" : "url",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The PlanDefinition's official URL (i.e. 'PlanDefinition.url'). The server must know the PlanDefinition or be able to retrieve it from other known repositories.",
    "type" : "canonical",
    "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/PlanDefinition"]
  },
  {
    "name" : "supportedOnly",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "If true, the questionnaire will only include those elements marked as \"mustSupport='true'\" in the StructureDefinition.",
    "type" : "boolean"
  },
  {
    "name" : "minimalOnly",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "If true, the questionnaire items are limited to the minimal set of elements  from the StructureDefinition.",
    "type" : "boolean"
  },
  {
    "name" : "artifactEndpointConfiguration",
    "use" : "in",
    "min" : 0,
    "max" : "*",
    "documentation" : "Configuration information to resolve canonical artifacts\n\nProcessing Semantics:\n\nCreate a canonical-like reference (e.g.\n`{canonical.url}|{canonical.version}` or similar extensions for non-canonical artifacts).\n\n* Given a single `artifactEndpointConfiguration`\n  * When `artifactRoute` is present\n    * And the canonical or artifact reference starts with the `artifactRoute` (up to and including the entire uri)\n    * Then attempt to resolve with `endpointUri` or `endpoint`\n  * When `artifactRoute` is not present\n    * Then attempt to resolve with `endpointUri` or `endpoint`\n* Given multiple `artifactEndpointConfiguration`s\n  * Then rank order each configuration (see below)\n  * And attempt to resolve with `endpointUri` or `endpoint` in order until resolved\n\nRank each `artifactEndpointConfiguration` such that:\n* if `artifactRoute` is present *and* `artifactRoute` *starts with* canonical or artifact reference: rank based on number of matching characters\n* if `artifactRoute` is *not* present: include but rank lower\n\nNOTE: For evenly ranked `artifactEndpointConfiguration`s, order as defined in the\nOperationDefinition.",
    "part" : [{
      "name" : "artifactRoute",
      "use" : "in",
      "min" : 0,
      "max" : "1",
      "documentation" : "An optional route used to determine whether this endpoint is expected to be able to resolve artifacts that match the route (i.e. start with the route, up to and including the entire url)",
      "type" : "uri"
    },
    {
      "name" : "endpointUri",
      "use" : "in",
      "min" : 0,
      "max" : "1",
      "documentation" : "The URI of the endpoint, exclusive with the `endpoint` parameter",
      "type" : "uri"
    },
    {
      "name" : "endpoint",
      "use" : "in",
      "min" : 0,
      "max" : "1",
      "documentation" : "An Endpoint resource describing the endpoint, exclusive with the `endpointUri` parameter",
      "type" : "Endpoint"
    }]
  },
  {
    "name" : "return",
    "use" : "out",
    "min" : 1,
    "max" : "1",
    "documentation" : "The questionnaire form generated based on the PlanDefinition action.inputs",
    "type" : "Questionnaire"
  }]
}