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