### ----------------------------------------------------
### -- FHIR
### -- Licenses: Artistic-2.0
### -- Authors: Hugh Simpson
### -- File: t/resources/structureDefinition/Group.json
### ----------------------------------------------------
### -- Chunk 6 of 6
 }],
      "isModifier" : false,
      "isSummary" : false
    },
    {
      "id" : "Group.member",
      "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" : "*",
      "base" : {
        "path" : "Group.member",
        "min" : 0,
        "max" : "*"
      },
      "type" : [{
        "code" : "BackboneElement"
      }],
      "condition" : ["grp-1"],
      "constraint" : [{
        "key" : "ele-1",
        "severity" : "error",
        "human" : "All FHIR elements must have a @value or children",
        "expression" : "hasValue() or (children().count() > id.count())",
        "xpath" : "@value|f:*|h:div",
        "source" : "Element"
      }],
      "isModifier" : false,
      "isSummary" : false,
      "mapping" : [{
        "identity" : "rim",
        "map" : "./scopedRole[isNormalRole() and classCode=\"MBR\"]/player"
      }]
    },
    {
      "id" : "Group.member.id",
      "path" : "Group.member.id",
      "representation" : ["xmlAttr"],
      "short" : "Unique id for inter-element referencing",
      "definition" : "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
      "min" : 0,
      "max" : "1",
      "base" : {
        "path" : "Element.id",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "string"
      }],
      "isModifier" : false,
      "isSummary" : false,
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Group.member.extension",
      "path" : "Group.member.extension",
      "short" : "Additional content defined by implementations",
      "definition" : "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
      "comment" : "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
      "alias" : ["extensions",
      "user content"],
      "min" : 0,
      "max" : "*",
      "base" : {
        "path" : "Element.extension",
        "min" : 0,
        "max" : "*"
      },
      "type" : [{
        "code" : "Extension"
      }],
      "isModifier" : false,
      "isSummary" : false,
      "mapping" : [{
        "identity" : "rim",
        "map" : "n/a"
      }]
    },
    {
      "id" : "Group.member.modifierExtension",
      "path" : "Group.member.modifierExtension",
      "short" : "Extensions that cannot be ignored even if unrecognized",
      "definition" : "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).",
      "comment" : "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
      "requirements" : "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored.  This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).",
      "alias" : ["extensions",
      "user content",
      "modifiers"],
      "min" : 0,
      "max" : "*",
      "base" : {
        "path" : "BackboneElement.modifierExtension",
        "min" : 0,
        "max" : "*"
      },
      "type" : [{
        "code" : "Extension"
      }],
      "isModifier" : true,
      "isModifierReason" : "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them",
      "isSummary" : true,
      "mapping" : [{
        "identity" : "rim",
        "map" : "N/A"
      }]
    },
    {
      "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",
      "base" : {
        "path" : "Group.member.entity",
        "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"]
      }],
      "isModifier" : false,
      "isSummary" : false
    },
    {
      "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",
      "base" : {
        "path" : "Group.member.period",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "Period"
      }],
      "meaningWhenMissing" : "The member is in the group at this time",
      "isModifier" : false,
      "isSummary" : false
    },
    {
      "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",
      "base" : {
        "path" : "Group.member.inactive",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "boolean"
      }],
      "meaningWhenMissing" : "Members are considered active unless explicitly specified otherwise",
      "isModifier" : false,
      "isSummary" : false
    }]
  },
  "differential" : {
    "element" : [{
      "id" : "Group",
      "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))"
      }],
      "mapping" : [{
        "identity" : "rim",
        "map" : "Entity[determinerCode=\"GRP\" or determinerCode=\"GRP_KIND\"]"
      }]
    },
    {
      "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\"])"
      }]
    },
    {
      "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"
      }]
    },
    {
      "id" : "Group.type",
      "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|4.0.0"
      },
      "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\"]"
      }]
    },
    {
      "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",
      "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",
      "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"
    }]
  }
}


