{
  "resourceType": "StructureDefinition",
  "id": "Group",
  "meta": {
    "lastUpdated": "2021-01-01T21:58:31.578+00:00"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Base.Individuals"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode": "trial-use"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 0
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "business"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "fhir"
    },
    {
      "url": "http://hl7.org/fhir/build/StructureDefinition/entered-in-error-status",
      "valueCode": ".active = false"
    }
  ],
  "url": "http://hl7.org/fhir/StructureDefinition/Group",
  "version": "4.6.0",
  "name": "Group",
  "status": "draft",
  "date": "2021-01-01T21:58:31+00:00",
  "publisher": "Health Level Seven International (FHIR Infrastructure)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/fhir"
        }
      ]
    },
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/fiwg/index.cfm"
        }
      ]
    }
  ],
  "description": "Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.",
  "fhirVersion": "4.6.0",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "interface",
      "uri": "http://hl7.org/fhir/interface",
      "name": "Interface Pattern"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Group",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DomainResource",
  "derivation": "specialization",
  "differential": {
    "element": [
      {
        "id": "Group",
        "extension": [
          {
            "url": "http://hl7.org/fhir/build/StructureDefinition/svg",
            "valueCode": "0,0"
          }
        ],
        "path": "Group",
        "short": "Group of multiple entities",
        "definition": "Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.",
        "comment": "If both Group.characteristic and Group.member are present, then the members are the individuals who were found who met the characteristic.  It's possible that there might be other candidate members who meet the characteristic and aren't (yet) in the list.  All members SHALL have the listed characteristics.",
        "min": 0,
        "max": "*",
        "constraint": [
          {
            "key": "grp-1",
            "severity": "error",
            "human": "Can only have members if group is \"actual\"",
            "expression": "member.empty() or (actual = true)",
            "xpath": "f:actual/@value=true() or not(exists(f:member))",
            "source": "http://hl7.org/fhir/StructureDefinition/Group"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "Entity[determinerCode=\"GRP\" or determinerCode=\"GRP_KIND\"]"
          },
          {
            "identity": "interface",
            "map": "Participant"
          },
          {
            "identity": "w5",
            "map": "administrative.group"
          }
        ]
      },
      {
        "id": "Group.identifier",
        "path": "Group.identifier",
        "short": "Unique id",
        "definition": "A unique business identifier for this group.",
        "requirements": "Allows the group to be referenced from external specifications.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Identifier"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.identifier"
          },
          {
            "identity": "rim",
            "map": "unique(./id[displayable=\"true\" and scope=\"OBJ\"])"
          },
          {
            "identity": "interface",
            "map": "Participant.identifier"
          }
        ]
      },
      {
        "id": "Group.active",
        "path": "Group.active",
        "short": "Whether this group's record is in active use",
        "definition": "Indicates whether the record for the group is available for use or is merely being retained for historical purposes.",
        "requirements": "Need to be able to mark a group record as not to be used because it was created in error or is otherwise no longer available (e.g. a herd that no longer exists).",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "boolean"
          }
        ],
        "meaningWhenMissing": "This resource is generally assumed to be active if no value is provided for the active element",
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.status"
          },
          {
            "identity": "rim",
            "map": "./statusCode"
          },
          {
            "identity": "interface",
            "map": "Participant.active"
          }
        ]
      },
      {
        "id": "Group.type",
        "extension": [
          {
            "url": "http://hl7.org/fhir/build/StructureDefinition/committee-notes",
            "valueString": "Do we need \"mixed\" groups?"
          }
        ],
        "path": "Group.type",
        "short": "person | animal | practitioner | device | medication | substance",
        "definition": "Identifies the broad classification of the kind of resources the group includes.",
        "comment": "Group members SHALL be of the appropriate resource type (Patient for person or animal; or Practitioner, Device, Medication or Substance for the other types.).",
        "requirements": "Identifies what type of resources the group is made up of.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "GroupType"
            }
          ],
          "strength": "required",
          "description": "Types of resources that are part of group.",
          "valueSet": "http://hl7.org/fhir/ValueSet/group-type"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.class"
          },
          {
            "identity": "rim",
            "map": "person: ./classCode=\"PSN\"  animal: ./classCode=\"ANM\"  device: ./classCode=\"DEV\"  medication: ./classCode=\"MMAT\" and ./playedRole[isNormalRole() and classCode=\"THER\"]  food: ./classCode=\"FOOD\""
          }
        ]
      },
      {
        "id": "Group.actual",
        "path": "Group.actual",
        "short": "Descriptive or actual",
        "definition": "If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.",
        "requirements": "There are use-cases for groups that define specific collections of individuals, and other groups that define \"types\" of intended individuals.  The requirements for both kinds of groups are similar, so we use a single resource, distinguished by this flag.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "boolean"
          }
        ],
        "condition": [
          "grp-1"
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.class"
          },
          {
            "identity": "rim",
            "map": "true: ./determinerCode=\"GRP\"  false: ./determinerCode=\"GRP_KIND\""
          }
        ]
      },
      {
        "id": "Group.code",
        "path": "Group.code",
        "short": "Kind of Group members",
        "definition": "Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc.",
        "comment": "This would generally be omitted for Person resources.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "GroupKind"
            }
          ],
          "strength": "example",
          "description": "Kind of particular resource; e.g. cow, syringe, lake, etc."
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": "./code"
          }
        ]
      },
      {
        "id": "Group.name",
        "path": "Group.name",
        "short": "Label for Group",
        "definition": "A label assigned to the group for human identification and communication.",
        "requirements": "Used to identify the group in human communication.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "./name[type=\"ST\"]"
          },
          {
            "identity": "interface",
            "map": "Participant.name"
          }
        ]
      },
      {
        "id": "Group.quantity",
        "path": "Group.quantity",
        "short": "Number of members",
        "definition": "A count of the number of resource instances that are part of the group.",
        "comment": "Note that the quantity may be less than the number of members if some of the members are not active.",
        "requirements": "Group size is a common defining characteristic.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "unsignedInt"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "./quantity"
          }
        ]
      },
      {
        "id": "Group.managingEntity",
        "path": "Group.managingEntity",
        "short": "Entity that is the custodian of the Group's definition",
        "definition": "Entity responsible for defining and maintaining Group characteristics and/or registered members.",
        "comment": "This does not strictly align with ownership of a herd or flock, but may suffice to represent that relationship in simple cases. More complex cases will require an extension.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole"
            ]
          }
        ],
        "isSummary": true
      },
      {
        "id": "Group.characteristic",
        "extension": [
          {
            "url": "http://hl7.org/fhir/build/StructureDefinition/svg",
            "valueCode": "300,0"
          }
        ],
        "path": "Group.characteristic",
        "short": "Include / Exclude group members by Trait",
        "definition": "Identifies traits whose presence r absence is shared by members of the group.",
        "comment": "All the identified characteristics must be true for an entity to a member of the group.",
        "requirements": "Needs to be a generic mechanism for identifying what individuals can be part of a group.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "./playedRole[isNormalRole()]/participation[isNormalParticipation() and typeCode=\"SBJ\"]/act[isNormalAct and classCode=\"OBS\" and moodCode=\"EVN\"]"
          }
        ]
      },
      {
        "id": "Group.characteristic.code",
        "path": "Group.characteristic.code",
        "short": "Kind of characteristic",
        "definition": "A code that identifies the kind of trait being asserted.",
        "requirements": "Need a formal way of identifying the characteristic being described.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "GroupCharacteristicKind"
            }
          ],
          "strength": "example",
          "description": "List of characteristics used to describe group members; e.g. gender, age, owner, location, etc."
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "./code"
          }
        ]
      },
      {
        "id": "Group.characteristic.value[x]",
        "path": "Group.characteristic.value[x]",
        "short": "Value held by characteristic",
        "definition": "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.",
        "comment": "For Range, it means members of the group have a value that falls somewhere within the specified range.",
        "requirements": "The value of the characteristic is what determines group membership.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          },
          {
            "code": "boolean"
          },
          {
            "code": "Quantity"
          },
          {
            "code": "Range"
          },
          {
            "code": "Reference"
          }
        ],
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "GroupCharacteristicValue"
            }
          ],
          "strength": "example",
          "description": "Value of descriptive member characteristic; e.g. red, male, pneumonia, Caucasian, etc."
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "./value"
          }
        ]
      },
      {
        "id": "Group.characteristic.exclude",
        "path": "Group.characteristic.exclude",
        "short": "Group includes or excludes",
        "definition": "If true, indicates the characteristic is one that is NOT held by members of the group.",
        "comment": "This is labeled as \"Is Modifier\" because applications cannot wrongly include excluded members as included or vice versa.",
        "requirements": "Sometimes group membership is determined by characteristics not possessed.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "./valueNegationInd"
          }
        ]
      },
      {
        "id": "Group.characteristic.period",
        "path": "Group.characteristic.period",
        "short": "Period over which characteristic is tested",
        "definition": "The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Period"
          }
        ]
      },
      {
        "id": "Group.member",
        "extension": [
          {
            "url": "http://hl7.org/fhir/build/StructureDefinition/committee-notes",
            "valueString": "Is \"group of groups\" in the 80%?"
          },
          {
            "url": "http://hl7.org/fhir/build/StructureDefinition/svg",
            "valueCode": "200,180"
          }
        ],
        "path": "Group.member",
        "short": "Who or what is in group",
        "definition": "Identifies the resource instances that are members of the group.",
        "requirements": "Often the only thing of interest about a group is \"who's in it\".",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "grp-1"
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "./scopedRole[isNormalRole() and classCode=\"MBR\"]/player"
          }
        ]
      },
      {
        "id": "Group.member.entity",
        "path": "Group.member.entity",
        "short": "Reference to the group member",
        "definition": "A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/Device",
              "http://hl7.org/fhir/StructureDefinition/Medication",
              "http://hl7.org/fhir/StructureDefinition/Substance",
              "http://hl7.org/fhir/StructureDefinition/Group"
            ]
          }
        ]
      },
      {
        "id": "Group.member.period",
        "path": "Group.member.period",
        "short": "Period member belonged to the group",
        "definition": "The period that the member was in the group, if known.",
        "requirements": "Need to track who was in a group at a  particular time.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Period"
          }
        ],
        "meaningWhenMissing": "The member is in the group at this time"
      },
      {
        "id": "Group.member.inactive",
        "path": "Group.member.inactive",
        "short": "If member is no longer in group",
        "definition": "A flag to indicate that the member is no longer in the group, but previously may have been a member.",
        "requirements": "Sometimes you don't know when someone stopped being in a group, but not when.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "boolean"
          }
        ],
        "meaningWhenMissing": "Members are considered active unless explicitly specified otherwise"
      }
    ]
  }
}