{
  "resourceType": "StructureDefinition",
  "id": "NHSHC-Observation-SocialHistory",
  "url": "https://fhir.nhs.uk/StructureDefinition/NHSHC-Observation-SocialHistory",
  "version": "0.2.0",
  "name": "NHSHCObservationSocialHistory",
  "title": "NHSHC Observation - Social History",
  "status": "draft",
  "date": "2026-10-01",
  "publisher": "NHS England",
  "description": "Derived profile from NHSHC-Observation for individual social history observations in NHS Health Check Online. Constrains category to social-history and provides code slices for family history, smoking status, and AUDIT-C alcohol consumption. Social history is organized by the Composition section rather than a parent Observation.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "https://fhir.nhs.uk/StructureDefinition/NHSHC-Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "constraint": [
          {
            "key": "nhshc-sh-1",
            "severity": "error",
            "human": "At least one of value[x] or dataAbsentReason must be present.",
            "expression": "value.exists() or dataAbsentReason.exists()"
          }
        ]
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "min": 1,
        "fixedCode": "final"
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/observation-category",
              "code": "social-history"
            }
          ]
        }
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.nhs.uk/ValueSet/NHSHC-SocialHistoryCode"
        }
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"
            ]
          }
        ]
      },
      {
        "id": "Observation.encounter",
        "path": "Observation.encounter",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.uk/StructureDefinition/NHSHC-Encounter"
            ]
          }
        ]
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "min": 1
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner"
            ]
          }
        ]
      }
    ]
  }
}