{
  "resourceType": "StructureDefinition",
  "id": "MedicalHistoryResponse",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Clinical.Diagnostics"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    }
  ],
  "url": "http://tiro.health/fhir/StructureDefinition/MedicalHistoryResponse",
  "version": "0.1.0",
  "name": "MedicalHistoryResponse",
  "title": "MedicalHistoryResponse",
  "status": "active",
  "description": "QuestionnaireResponse coming from a MedicalHistory Block in the Tiro.health Note Editor",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "QuestionnaireResponse",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "QuestionnaireResponse.identifier",
        "path": "QuestionnaireResponse.identifier",
        "min": 1
      },
      {
        "id": "QuestionnaireResponse.questionnaire",
        "path": "QuestionnaireResponse.questionnaire",
        "definition": "Unique identifier pointing to a versioned building block in the Tiro.health Note Editor",
        "fixedCanonical": "http://tiro.health/fhir/Questionnaire/medical-history|0.1"
      },
      {
        "id": "QuestionnaireResponse.item",
        "path": "QuestionnaireResponse.item",
        "slicing": {
          "ordered": true,
          "rules": "closed",
          "description": "Each item should represent a 'historic medical record' containing a 'Date' and a 'Description'."
        }
      },
      {
        "id": "QuestionnaireResponse.item:Record",
        "path": "QuestionnaireResponse.item",
        "sliceName": "Record",
        "definition": "A single medical happend in the past that happend to current subject. Such an event can be an observation a clinical finding or a procedure (ex. surgery or therapy).",
        "min": 0,
        "max": "*",
        "mustSupport": true
      },
      {
        "id": "QuestionnaireResponse.item:Record.linkId",
        "path": "QuestionnaireResponse.item.linkId",
        "fixedString": "HISTORIC_RECORD"
      },
      {
        "id": "QuestionnaireResponse.item:Record.item",
        "path": "QuestionnaireResponse.item.item",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "linkId"
            }
          ],
          "rules": "closed",
          "ordered": true
        },
        "min": 2,
        "max": "2"
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Date",
        "path": "QuestionnaireResponse.item.item",
        "sliceName": "Date",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Date.linkId",
        "path": "QuestionnaireResponse.item.item.linkId",
        "patternString": "DATE"
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Date.text",
        "path": "QuestionnaireResponse.item.item.text",
        "fixedString": "Date or period of event"
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Date.answer.value[x]",
        "path": "QuestionnaireResponse.item.item.answer.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Date.answer.valueDate",
        "path": "QuestionnaireResponse.item.item.answer.valueDate",
        "definition": "The date when the past medical event happend",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "date"
          }
        ]
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Description",
        "path": "QuestionnaireResponse.item.item",
        "sliceName": "Description",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Description.linkId",
        "path": "QuestionnaireResponse.item.item.linkId",
        "patternString": "DESCRIPTION"
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Description.text",
        "path": "QuestionnaireResponse.item.item.text",
        "fixedString": "Description of event"
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Description.answer.extension",
        "path": "QuestionnaireResponse.item.item.answer.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Description.answer.extension:markdown",
        "path": "QuestionnaireResponse.item.item.answer.extension",
        "sliceName": "markdown",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/rendering-markdown"
            ]
          }
        ]
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Description.answer.value[x]",
        "path": "QuestionnaireResponse.item.item.answer.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "QuestionnaireResponse.item:Record.item:Description.answer.valueString",
        "path": "QuestionnaireResponse.item.item.answer.valueString",
        "definition": "The description of the past medical event of current subject.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ]
      }
    ]
  }
}