Structured Data Capture
3.0.0 - STU 3 International flag

Structured Data Capture, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 3.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/sdc/ and changes regularly. See the Directory of published versions

: Example $assemble operation response - JSON Representation

Raw json | Download


{
  "resourceType" : "Parameters",
  "id" : "sdc-modular-root-assembled",
  "meta" : {
    "profile" : [
      🔗 "http://hl7.org/fhir/uv/sdc/StructureDefinition/parameters-questionnaire-assemble-out"
    ]
  },
  "parameter" : [
    {
      "name" : "return",
      "resource" : {
        "resourceType" : "Questionnaire",
        "extension" : [
          {
            "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-assembledFrom",
            "valueCanonical" : "http://hl7.org/fhir/uv/sdc/Questionnaire/sdc-modular-contact|3.0"
          },
          {
            "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-assembledFrom",
            "valueCanonical" : "http://hl7.org/fhir/uv/sdc/Questionnaire/sdc-modular-name|3.0"
          },
          {
            "extension" : [
              {
                "url" : "name",
                "valueCoding" : {
                  "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
                  "code" : "patient"
                }
              },
              {
                "url" : "type",
                "valueCode" : "Patient"
              }
            ],
            "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext"
          },
          {
            "url" : "http://hl7.org/fhir/StructureDefinition/variable",
            "valueExpression" : {
              "name" : "person",
              "language" : "text/fhirpath",
              "expression" : "%patient"
            }
          }
        ],
        "url" : "http://hl7.org/fhir/uv/sdc/Questionnaire/sdc-modular-root",
        "name" : "QuestionnaireSDCModularRoot",
        "title" : "Example modular Questionnaire",
        "status" : "draft",
        "experimental" : true,
        "item" : [
          {
            "extension" : [
              {
                "url" : "http://hl7.org/fhir/StructureDefinition/variable",
                "valueExpression" : {
                  "name" : "linkIdPrefix",
                  "language" : "text/fhirpath",
                  "expression" : "'patientname.'"
                }
              },
              {
                "extension" : [
                  {
                    "url" : "key",
                    "valueId" : "qcontact-1"
                  },
                  {
                    "url" : "severity",
                    "valueCode" : "error"
                  },
                  {
                    "url" : "human",
                    "valueString" : "Must have either first or last name"
                  },
                  {
                    "url" : "expression",
                    "valueString" : "item.where(linkId=%linkIdPrefix+'1').exists() or item.where(linkId=%linkIdPrefix+'2').exists()"
                  }
                ],
                "url" : "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint"
              },
              {
                "url" : "http://hl7.org/fhir/StructureDefinition/variable",
                "valueExpression" : {
                  "name" : "name",
                  "language" : "text/fhirpath",
                  "expression" : "iif(%person.name.where(use='official').exists(),%person.name.where(use='official')[0],%person.name[0])"
                }
              }
            ],
            "linkId" : "1",
            "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.name",
            "text" : "What is the person's official name?",
            "type" : "group",
            "item" : [
              {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                    "valueExpression" : {
                      "language" : "text/fhirpath",
                      "expression" : "%name.prefix.where($this in ('Mr.'|'Miss'|'Mrs'|'Ms.'))[0]"
                    }
                  }
                ],
                "linkId" : "patientname.1",
                "text" : "Title",
                "type" : "string",
                "required" : true,
                "answerOption" : [
                  {
                    "valueString" : "Mr."
                  },
                  {
                    "valueString" : "Miss"
                  },
                  {
                    "valueString" : "Mrs."
                  },
                  {
                    "valueString" : "Ms."
                  }
                ]
              },
              {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                    "valueExpression" : {
                      "language" : "text/fhirpath",
                      "expression" : "%name.given[0]"
                    }
                  }
                ],
                "linkId" : "patientname.2",
                "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.name.first",
                "text" : "First",
                "type" : "string",
                "required" : true,
                "maxLength" : 100
              },
              {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                    "valueExpression" : {
                      "language" : "text/fhirpath",
                      "expression" : "%name.last"
                    }
                  }
                ],
                "linkId" : "patientname.3",
                "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.name.last",
                "text" : "Last",
                "type" : "string",
                "required" : true,
                "maxLength" : 100
              }
            ]
          },
          {
            "extension" : [
              {
                "url" : "http://hl7.org/fhir/StructureDefinition/minValue",
                "valueDate" : "1900-01-01"
              },
              {
                "url" : "http://hl7.org/fhir/StructureDefinition/maxValue",
                "_valueDate" : {
                  "extension" : [
                    {
                      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-expression",
                      "valueExpression" : {
                        "language" : "text/fhirpath",
                        "expression" : "now() as date + 1 day"
                      }
                    }
                  ]
                }
              }
            ],
            "linkId" : "2",
            "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.dob",
            "text" : "What is this person's date of birth?",
            "type" : "date",
            "required" : true
          },
          {
            "linkId" : "3",
            "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.sex",
            "text" : "What is this person's gender?",
            "type" : "choice",
            "required" : true,
            "answerValueSet" : "http://hl7.org/fhir/ValueSet/administrative-gender"
          },
          {
            "linkId" : "4",
            "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.address",
            "text" : "What is this person's current mailing address?",
            "type" : "group",
            "required" : true,
            "item" : [
              {
                "linkId" : "4.1",
                "type" : "display"
              },
              {
                "linkId" : "4Demographics.address.street",
                "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.address.street",
                "text" : "Street address",
                "type" : "string"
              },
              {
                "linkId" : "4Demographics.address.city",
                "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.address.city",
                "text" : "City/Town",
                "type" : "string"
              },
              {
                "linkId" : "4Demographics.address.state",
                "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.address.state",
                "text" : "State",
                "type" : "choice",
                "answerValueSet" : "http://hl7.org/fhir/uv/sdc/ValueSet/sdc-question-library-states"
              },
              {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/StructureDefinition/entryFormat",
                    "valueString" : "9999"
                  },
                  {
                    "url" : "http://hl7.org/fhir/StructureDefinition/regex",
                    "valueString" : "[\\d]{4}"
                  }
                ],
                "linkId" : "4Demographics.address.postalCode",
                "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.address.postalCode",
                "text" : "Postal Code",
                "type" : "string",
                "required" : true
              }
            ]
          },
          {
            "extension" : [
              {
                "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemPopulationContext",
                "valueExpression" : {
                  "name" : "person",
                  "language" : "text/fhirpath",
                  "expression" : "%patient.contact"
                }
              },
              {
                "url" : "http://hl7.org/fhir/StructureDefinition/variable",
                "valueExpression" : {
                  "name" : "linkIdPrefix",
                  "language" : "text/fhirpath",
                  "expression" : "'patientcontact.'"
                }
              }
            ],
            "linkId" : "5",
            "type" : "group",
            "required" : true,
            "item" : [
              {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/StructureDefinition/variable",
                    "valueExpression" : {
                      "name" : "linkIdPrefix",
                      "language" : "text/fhirpath",
                      "expression" : "%linkIdPrefix + 'name.'"
                    }
                  },
                  {
                    "extension" : [
                      {
                        "url" : "key",
                        "valueString" : "qcontact-1"
                      },
                      {
                        "url" : "severity",
                        "valueCode" : "error"
                      },
                      {
                        "url" : "human",
                        "valueString" : "Must have either first or last name"
                      },
                      {
                        "url" : "expression",
                        "valueString" : "item.where(linkId=%linkIdPrefix+'1').exists() or item.where(linkId=%linkIdPrefix+'2').exists()"
                      }
                    ],
                    "url" : "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint"
                  },
                  {
                    "url" : "http://hl7.org/fhir/StructureDefinition/variable",
                    "valueExpression" : {
                      "name" : "name",
                      "language" : "text/fhirpath",
                      "expression" : "iif(%person.name.where(use='official').exists(),%person.name.where(use='official')[0],%person.name[0])"
                    }
                  }
                ],
                "linkId" : "patientcontact.1",
                "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.name",
                "text" : "What is the person's official name?",
                "type" : "group",
                "item" : [
                  {
                    "extension" : [
                      {
                        "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                        "valueExpression" : {
                          "language" : "text/fhirpath",
                          "expression" : "%name.prefix.where($this in ('Mr.'|'Miss'|'Mrs'|'Ms.'))[0]"
                        }
                      }
                    ],
                    "linkId" : "patientcontact.name.1",
                    "type" : "string",
                    "required" : true,
                    "answerOption" : [
                      {
                        "valueString" : "Mr."
                      },
                      {
                        "valueString" : "Miss"
                      },
                      {
                        "valueString" : "Mrs."
                      },
                      {
                        "valueString" : "Ms."
                      }
                    ]
                  },
                  {
                    "extension" : [
                      {
                        "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                        "valueExpression" : {
                          "language" : "text/fhirpath",
                          "expression" : "%name.given[0]"
                        }
                      }
                    ],
                    "linkId" : "patientcontact.name.2",
                    "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.name.first",
                    "text" : "First",
                    "type" : "string",
                    "required" : true,
                    "maxLength" : 100
                  },
                  {
                    "extension" : [
                      {
                        "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                        "valueExpression" : {
                          "language" : "text/fhirpath",
                          "expression" : "%name.family"
                        }
                      }
                    ],
                    "linkId" : "patientcontact.name.3",
                    "definition" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-question-library#Demographics.name.last",
                    "text" : "Last",
                    "type" : "string",
                    "required" : true,
                    "maxLength" : 100
                  }
                ]
              },
              {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                    "valueExpression" : {
                      "language" : "text/fhirpath",
                      "expression" : "%person.telecom.where(use='phone').first()"
                    }
                  }
                ],
                "linkId" : "patientcontact.2",
                "definition" : "http://example.org/StructureDefinition/non-existent-library#Stuff.phone",
                "text" : "Phone number",
                "type" : "string",
                "required" : true
              }
            ]
          }
        ]
      }
    },
    {
      "name" : "outcome",
      "resource" : {
        "resourceType" : "OperationOutcome",
        "issue" : [
          {
            "severity" : "warning",
            "code" : "informational",
            "details" : {
              "text" : "Unable to resolve element definition http://example.org/StructureDefinition/non-existent-library#Stuff.phone when assembling Questionnaire/sdc-modular-contact.  Some constraints and behavior may not be represented"
            },
            "expression" : [
              "Questionnaire.item[1].definition"
            ]
          },
          {
            "severity" : "warning",
            "code" : "informational",
            "details" : {
              "text" : "Unable to resolve element definition http://example.org/StructureDefinition/non-existent-library#Stuff.phone when assembling Questionnaire/sdc-modular-contact.  Some constraints and behavior may not be represented"
            },
            "expression" : [
              "Questionnaire.item[1].definition"
            ]
          }
        ]
      }
    }
  ]
}