Structured Data Capture
3.0.0 - STU 3 International flag

This page is part of the Structured Data Capture FHIR IG (v3.0.0: STU 3) based on FHIR R4. This is the current published version in its permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions

: Example $assemble operation response - JSON Representation

Raw json | Download


{
  "resourceType" : "Parameters",
  "id" : "sdc-modular-root-assembled",
  "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"
          },
          {
            "url" : "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext",
            "extension" : [
              {
                "url" : "name",
                "valueCoding" : {
                  "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
                  "code" : "patient"
                }
              },
              {
                "url" : "type",
                "valueCode" : "Patient"
              }
            ]
          },
          {
            "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.'"
                }
              },
              {
                "url" : "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint",
                "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/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.'"
                    }
                  },
                  {
                    "url" : "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint",
                    "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/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[use='phone'][0]"
                    }
                  }
                ],
                "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"
            ]
          }
        ]
      }
    }
  ]
}