{
  "resourceType": "StructureDefinition",
  "id": "hspc-householdSize",
  "url": "http://fhir.org/guides/hspc/StructureDefinition/hspc-householdSize",
  "name": "HSPC Household Size Profile",
  "status": "draft",
  "date": "2017-05-11",
  "publisher": "HSPC",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://healthcaresoa.org"
        }
      ]
    }
  ],
  "fhirVersion": "3.0.0",
  "mapping": [
    {
      "identity": "argonaut-dq-dstu2",
      "uri": "http://unknown.org/Argonaut DQ DSTU2",
      "name": "Argonaut DQ DSTU2"
    },
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Mapping"
    },
    {
      "identity": "sct-concept",
      "uri": "http://snomed.info/conceptdomain",
      "name": "SNOMED CT Concept Domain Binding"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/w5",
      "name": "W5 Mapping"
    },
    {
      "identity": "sct-attr",
      "uri": "http://snomed.info/sct",
      "name": "SNOMED CT Attribute Binding"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observationresults",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation:hspchouseholdsize",
        "path": "Observation",
        "sliceName": "hspchouseholdsize",
        "short": "HSPC Household Size Profile",
        "definition": "HSPC Household Size Profile is based on the US Core Result Observation profile.",
        "comment": "Client’s self-report of the numeric value of the total number of persons living in the household, including the client.",
        "alias": [
          "Obs"
        ],
        "constraint": [
          {
            "key": "us-core-2",
            "severity": "error",
            "human": "If there is no component or related element then either a value[x] or a data absent reason must be present",
            "expression": "(component.empty() and related.empty()) implies (dataAbsentReason or value)",
            "xpath": "exists(f:component) or exists(f:related) or exists(f:*[starts-with(local-name(.), 'value)]) or exists(f:dataAbsentReason)"
          }
        ],
        "mustSupport": false,
        "isModifier": false,
        "mapping": [
          {
            "identity": "argonaut-dq-dstu2",
            "map": "Observation"
          }
        ]
      },
      {
        "id": "Observation:hspchouseholdsize.code",
        "path": "Observation.code",
        "short": "Laboratory Test Name",
        "definition": "The test that was performed.  A LOINC **SHALL** be used if the concept is present in LOINC.",
        "comment": "The typical patterns for codes are:  1)  a LOINC code either as a  translation from a \"local\" code or as a primary code, or 2)  a local code only if no suitable LOINC exists,  or 3)  both the local and the LOINC translation.   Systems SHALL be capable of sending the local code if one exists.  When using LOINC , Use either the SHORTNAME or LONG_COMMON_NAME field for the display.",
        "alias": [
          "Test Name",
          "Observation Identifer"
        ],
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "mustSupport": false,
        "isModifier": false
      },
      {
        "id": "Observation:hspchouseholdsize.performer",
        "path": "Observation.performer",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "profile": "http://fhir.org/guides/hspc/StructureDefinition/hspc-provpract"
          },
          {
            "code": "Reference",
            "profile": "http://fhir.org/guides/hspc/StructureDefinition/hspc-organization"
          },
          {
            "code": "Reference",
            "profile": "http://fhir.org/guides/hspc/StructureDefinition/hspc-patient"
          },
          {
            "code": "Reference",
            "profile": "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
          }
        ],
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.valueQuantity",
        "path": "Observation.valueQuantity",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Quantity",
            "profile": "http://hl7.org/fhir/StructureDefinition/Quantity"
          }
        ],
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.valueQuantity.system",
        "path": "Observation.valueQuantity.system",
        "type": [
          {
            "code": "uri",
            "profile": "http://hl7.org/fhir/StructureDefinition/uri"
          }
        ],
        "fixedUri": "http://unitsofmeasure.org",
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.valueQuantity.code",
        "path": "Observation.valueQuantity.code",
        "type": [
          {
            "code": "code"
          }
        ],
        "fixedCode": "{count}",
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.bodySite",
        "path": "Observation.bodySite",
        "min": 0,
        "max": "0",
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.method",
        "path": "Observation.method",
        "min": 0,
        "max": "0",
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.specimen",
        "path": "Observation.specimen",
        "min": 0,
        "max": "0",
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.device",
        "path": "Observation.device",
        "short": "(Measurement) Device",
        "definition": "The device used to generate the observation data.",
        "comment": "An extension should be used if further typing of the device is needed.  Devices used to support obtaining an observation can be represented using either an extension or through the Observation.related element.",
        "min": 0,
        "max": "0",
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.referenceRange",
        "path": "Observation.referenceRange",
        "short": "Provides guide for interpretation",
        "definition": "Guidance on how to interpret the value by comparison to a normal or recommended range.",
        "comment": "Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this may not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.",
        "requirements": "Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.",
        "min": 0,
        "max": "0",
        "mustSupport": false,
        "isModifier": false,
        "isSummary": false
      },
      {
        "id": "Observation:hspchouseholdsize.related",
        "path": "Observation.related",
        "short": "Resource related to this observation",
        "definition": "A  reference to another resource (usually another Observation) whose relationship is defined by the relationship type code.",
        "comment": "For a discussion on the ways Observations can assembled in groups together see [Notes below](observation.html#4.20.4).",
        "requirements": "Normally, an observation will have either a value or a set of related observations. A few observations (e.g. Apgar score) may have both a value and a set of related observations or sometimes a QuestionnaireResponse from which the measure is derived.",
        "min": 0,
        "max": "0",
        "base": {
          "path": "Observation.related",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "children().count() > id.count()",
            "xpath": "@value|f:*|h:div",
            "source": "Element"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "v2",
            "map": "Relationships established by OBX-4 usage"
          },
          {
            "identity": "rim",
            "map": "outBoundRelationship"
          }
        ]
      },
      {
        "id": "Observation:hspchouseholdsize.component",
        "path": "Observation.component",
        "short": "Component results",
        "definition": "Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.",
        "comment": "For a discussion on the ways Observations can be assembled in groups together see [Notes](observation.html#notes) below.",
        "requirements": "Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable).   However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.",
        "min": 0,
        "max": "0",
        "base": {
          "path": "Observation.component",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "children().count() > id.count()",
            "xpath": "@value|f:*|h:div",
            "source": "Element"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "v2",
            "map": "containment by OBX-4?"
          },
          {
            "identity": "rim",
            "map": "outBoundRelationship[typeCode=COMP]"
          }
        ]
      }
    ]
  }
}