This is a HL7 FHIR server, and as you appear to be accessing this page from a web browser you are seeing a HTML version of the requested resource(s). You can also access this URL from a FHIR client as a ReSTful API call. For more details please see the HL7 FHIR specification.
{
  "resourceType": "StructureDefinition",
  "id": "CareConnect-Medication-Flag-1",
  "meta": {
    "lastUpdated": "2017-03-08T09:33:05.689+00:00"
  },
  "url": "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Medication-Flag-1",
  "version": "1.0.0",
  "name": "CareConnect-Medication-Flag-1",
  "status": "draft",
  "publisher": "HL7 UK",
  "date": "2017-02-24T15:11:33.5617384Z",
  "description": "This Flag Resource carries prospective warnings of potential issues related to the patient's medications.",
  "copyright": "Copyright © 2016+ HL7 UK\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\r\n\r\nhttp://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\r\n\r\nHL7® FHIR® standard Copyright © 2011+ HL7\r\n\r\nThe HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at\r\n\r\nhttps://www.hl7.org/fhir/license.html",
  "fhirVersion": "1.0.2",
  "kind": "resource",
  "constrainedType": "Flag",
  "abstract": false,
  "base": "http://hl7.org/fhir/StructureDefinition/Flag",
  "snapshot": {
    "element": [
      {
        "path": "Flag",
        "short": "Key information to flag to healthcare providers",
        "definition": "Prospective warnings of potential issues when providing care to the patient.",
        "alias": [
          "Barriers to Care",
          "Alert",
          "Warning"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Resource",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "DomainResource"
          }
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()"
              }
            ],
            "key": "dom-4",
            "severity": "error",
            "human": "If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated",
            "xpath": "not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "contained.where(('#'+id in %resource.descendants().reference).not()).empty()"
              }
            ],
            "key": "dom-3",
            "severity": "error",
            "human": "If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource",
            "xpath": "not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))]))"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "contained.contained.empty()"
              }
            ],
            "key": "dom-2",
            "severity": "error",
            "human": "If the resource is contained in another resource, it SHALL NOT contain nested Resources",
            "xpath": "not(parent::f:contained and f:contained)"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "contained.text.empty()"
              }
            ],
            "key": "dom-1",
            "severity": "error",
            "human": "If the resource is contained in another resource, it SHALL NOT contain any narrative",
            "xpath": "not(parent::f:contained and f:text)"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "Entity. Role, or Act"
          },
          {
            "identity": "rim",
            "map": "Observation[classCode=ISSUE, moodCode=EVN]"
          },
          {
            "identity": "w5",
            "map": "workflow.encounter"
          }
        ]
      },
      {
        "path": "Flag.id",
        "short": "Logical id of this artifact",
        "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.",
        "comments": "The only time that a resource does not have an id is when it is being submitted to the server using a create operation. Bundles always have an id, though it is usually a generated UUID.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Resource.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.meta",
        "short": "Metadata about the resource",
        "definition": "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Resource.meta",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Meta"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.implicitRules",
        "short": "A set of rules under which this content was created",
        "definition": "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.",
        "comments": "Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element as much as possible.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Resource.implicitRules",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isModifier": true,
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.language",
        "short": "Language of the resource content",
        "definition": "The base language in which the resource is written.",
        "comments": "Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies  to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource  Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Resource.language",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "binding": {
          "strength": "required",
          "description": "A human language.",
          "valueSetUri": "http://tools.ietf.org/html/bcp47"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.text",
        "short": "Text summary of the resource, for human interpretation",
        "definition": "A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.",
        "comments": "Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative.",
        "alias": [
          "narrative",
          "html",
          "xhtml",
          "display"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "DomainResource.text",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Narrative"
          }
        ],
        "condition": [
          "ele-1",
          "dom-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          },
          {
            "identity": "rim",
            "map": "Act.text?"
          }
        ]
      },
      {
        "path": "Flag.contained",
        "short": "Contained, inline Resources",
        "definition": "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.",
        "comments": "This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again.",
        "alias": [
          "inline resources",
          "anonymous resources",
          "contained resources"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "DomainResource.contained",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Resource"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "Entity. Role, or Act"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.extension",
        "slicing": {
          "discriminator": [
            "url"
          ],
          "rules": "open"
        },
        "short": "Additional Content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the resource. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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": "DomainResource.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.extension",
        "name": "medication",
        "short": "Associated medication",
        "definition": "Optional Extensions Element - found in all resources.",
        "comments": "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": 1,
        "max": "*",
        "base": {
          "path": "DomainResource.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/Extension-CareConnect-MedicationFlagAssociation-1"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.modifierExtension",
        "short": "Extensions that cannot be ignored",
        "definition": "May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order 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 is allowed to 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.",
        "comments": "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": "DomainResource.modifierExtension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isModifier": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.identifier",
        "short": "Business identifier",
        "definition": "Identifier assigned to the flag for external use (outside the FHIR environment).",
        "min": 0,
        "max": "*",
        "base": {
          "path": "Flag.identifier",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Identifier"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CX / EI (occasionally, more often EI maps to a resource id or a URL)"
          },
          {
            "identity": "rim",
            "map": "II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs.  Also maps to Role[classCode=IDENT]"
          },
          {
            "identity": "servd",
            "map": "Identifier"
          },
          {
            "identity": "rim",
            "map": ".id"
          },
          {
            "identity": "w5",
            "map": "id"
          }
        ]
      },
      {
        "path": "Flag.identifier.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.identifier.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.identifier.use",
        "short": "usual | official | temp | secondary (If known)",
        "definition": "The purpose of this identifier.",
        "comments": "This is labeled as \"Is Modifier\" because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.",
        "requirements": "Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Identifier.use",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isModifier": true,
        "isSummary": true,
        "binding": {
          "strength": "required",
          "description": "Identifies the purpose for this identifier, if known .",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/identifier-use"
          }
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "N/A"
          },
          {
            "identity": "rim",
            "map": "Role.code or implied by context"
          }
        ]
      },
      {
        "path": "Flag.identifier.type",
        "short": "Description of identifier",
        "definition": "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.",
        "comments": "This element deals only with general categories of identifiers.  It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage.   Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.",
        "requirements": "Allows users to make use of identifiers when the identifier system is not known.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Identifier.type",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "binding": {
          "strength": "extensible",
          "description": "A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/identifier-type"
          }
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CE/CNE/CWE"
          },
          {
            "identity": "rim",
            "map": "CD"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept rdfs:subClassOf dt:CD"
          },
          {
            "identity": "v2",
            "map": "CX.5"
          },
          {
            "identity": "rim",
            "map": "Role.code or implied by context"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.coding",
        "short": "Code defined by a terminology system",
        "definition": "A reference to a code defined by a terminology system.",
        "comments": "Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labelled as UserSelected = true.",
        "requirements": "Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "CodeableConcept.coding",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Coding"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
          },
          {
            "identity": "rim",
            "map": "CV"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
          },
          {
            "identity": "v2",
            "map": "C*E.1-8, C*E.10-22"
          },
          {
            "identity": "rim",
            "map": "union(., ./translation)"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.coding.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.coding.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.coding.system",
        "short": "Identity of the terminology system",
        "definition": "The identification of the code system that defines the meaning of the symbol in the code.",
        "comments": "The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously.",
        "requirements": "Need to be unambiguous about the source of the definition of the symbol.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Coding.system",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.3"
          },
          {
            "identity": "rim",
            "map": "./codeSystem"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.coding.version",
        "short": "Version of the system - if relevant",
        "definition": "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.",
        "comments": "Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Coding.version",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.7"
          },
          {
            "identity": "rim",
            "map": "./codeSystemVersion"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.coding.code",
        "short": "Symbol in syntax defined by the system",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).",
        "comments": "Note that FHIR strings may not exceed 1MB in size",
        "requirements": "Need to refer to a particular code in the system.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Coding.code",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.1"
          },
          {
            "identity": "rim",
            "map": "./code"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.coding.display",
        "short": "Representation defined by the system",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.",
        "comments": "Note that FHIR strings may not exceed 1MB in size",
        "requirements": "Need to be able to carry a human-readable meaning of the code for readers that do not know  the system.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Coding.display",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.2 - but note this is not well followed"
          },
          {
            "identity": "rim",
            "map": "CV.displayName"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.coding.userSelected",
        "short": "If this coding was chosen directly by the user",
        "definition": "Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).",
        "comments": "Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.",
        "requirements": "This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Coding.userSelected",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "boolean"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "Sometimes implied by being first"
          },
          {
            "identity": "rim",
            "map": "CD.codingRationale"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [     fhir:source \"true\";     fhir:target dt:CDCoding.codingRationale\\#O   ]"
          }
        ]
      },
      {
        "path": "Flag.identifier.type.text",
        "short": "Plain text representation of the concept",
        "definition": "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.",
        "comments": "Very often the text is the same as a displayName of one of the codings.",
        "requirements": "The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "CodeableConcept.text",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.9. But note many systems use C*E.2 for this"
          },
          {
            "identity": "rim",
            "map": "./originalText[mediaType/code=\"text/plain\"]/data"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"
          }
        ]
      },
      {
        "path": "Flag.identifier.system",
        "short": "The namespace for the identifier",
        "definition": "Establishes the namespace in which set of possible id values is unique.",
        "comments": "see http://en.wikipedia.org/wiki/Uniform_resource_identifier",
        "requirements": "There are many sequences of identifiers.  To perform matching, we need to know what sequence we're dealing with. The system identifies a particular sequence or set of unique identifiers.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Identifier.system",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "exampleUri": "http://www.acme.com/identifiers/patient or urn:ietf:rfc:3986 if the Identifier.value itself is a full uri",
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CX.4 / EI-2-4"
          },
          {
            "identity": "rim",
            "map": "II.root or Role.id.root"
          },
          {
            "identity": "servd",
            "map": "./IdentifierType"
          }
        ]
      },
      {
        "path": "Flag.identifier.value",
        "short": "The value that is unique",
        "definition": "The portion of the identifier typically displayed to the user and which is unique within the context of the system.",
        "comments": "If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Identifier.value",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "exampleString": "123456",
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CX.1 / EI.1"
          },
          {
            "identity": "rim",
            "map": "II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)"
          },
          {
            "identity": "servd",
            "map": "./Value"
          }
        ]
      },
      {
        "path": "Flag.identifier.period",
        "short": "Time period when id is/was valid for use",
        "definition": "Time period during which identifier is/was valid for use.",
        "comments": "This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. \"the patient was an inpatient of the hospital for this time range\") or one value from the range applies (e.g. \"give to the patient between these two times\"). If duration is required, specify the type as Interval|Duration.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Identifier.period",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Period"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "start.empty() or end.empty() or (start <= end)"
              }
            ],
            "key": "per-1",
            "severity": "error",
            "human": "If present, start SHALL have a lower value than end",
            "xpath": "not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "DR"
          },
          {
            "identity": "rim",
            "map": "IVL[lowClosed=\"true\" and highClosed=\"true\"] or URG[lowClosed=\"true\" and highClosed=\"true\"]"
          },
          {
            "identity": "v2",
            "map": "CX.7 + CX.8"
          },
          {
            "identity": "rim",
            "map": "Role.effectiveTime or implied by context"
          },
          {
            "identity": "servd",
            "map": "./StartDate and ./EndDate"
          }
        ]
      },
      {
        "path": "Flag.identifier.period.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.identifier.period.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.identifier.period.start",
        "short": "Starting time with inclusive boundary",
        "definition": "The start of the period. The boundary is inclusive.",
        "comments": "If the low element is missing, the meaning is that the low boundary is not known.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Period.start",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "condition": [
          "ele-1",
          "per-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "DR.1"
          },
          {
            "identity": "rim",
            "map": "./low"
          }
        ]
      },
      {
        "path": "Flag.identifier.period.end",
        "short": "End time with inclusive boundary, if not ongoing",
        "definition": "The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.",
        "comments": "The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has a end value of 2012-02-03.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Period.end",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "meaningWhenMissing": "If the end of the period is missing, it means that the period is ongoing",
        "condition": [
          "ele-1",
          "per-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "DR.2"
          },
          {
            "identity": "rim",
            "map": "./high"
          }
        ]
      },
      {
        "path": "Flag.identifier.assigner",
        "short": "Organization that issued id (may be just text)",
        "definition": "Organization that issued/manages the identifier.",
        "comments": "The reference may be just a text description of the assigner.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Identifier.assigner",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Organization-1"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))"
              }
            ],
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a local reference if the resource is provided inline",
            "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
          },
          {
            "identity": "v2",
            "map": "CX.4 / (CX.4,CX.9,CX.10)"
          },
          {
            "identity": "rim",
            "map": "II.assigningAuthorityName but note that this is an improper use by the definition of the field.  Also Role.scoper"
          },
          {
            "identity": "servd",
            "map": "./IdentifierIssuingAuthority"
          }
        ]
      },
      {
        "path": "Flag.identifier.assigner.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.identifier.assigner.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.identifier.assigner.reference",
        "short": "Relative, internal or absolute URL reference",
        "definition": "A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.",
        "comments": "Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries.   Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure \"/[type]/[id]\" then it should be assumed that the reference is to a FHIR RESTful server.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Reference.reference",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1",
          "ref-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.identifier.assigner.display",
        "short": "Text alternative for the resource",
        "definition": "Plain text narrative that identifies the resource in addition to the resource reference.",
        "comments": "This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Reference.display",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.category",
        "short": "Clinical, administrative, etc.",
        "definition": "Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.",
        "comments": "Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Flag.category",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "binding": {
          "strength": "example",
          "description": "A general category for flags for filtering/display purposes.",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/flag-category"
          }
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CE/CNE/CWE"
          },
          {
            "identity": "rim",
            "map": "CD"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept rdfs:subClassOf dt:CD"
          },
          {
            "identity": "rim",
            "map": ".code"
          },
          {
            "identity": "w5",
            "map": "class"
          }
        ]
      },
      {
        "path": "Flag.category.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.category.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.category.coding",
        "short": "Code defined by a terminology system",
        "definition": "A reference to a code defined by a terminology system.",
        "comments": "Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labelled as UserSelected = true.",
        "requirements": "Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "CodeableConcept.coding",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Coding"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
          },
          {
            "identity": "rim",
            "map": "CV"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
          },
          {
            "identity": "v2",
            "map": "C*E.1-8, C*E.10-22"
          },
          {
            "identity": "rim",
            "map": "union(., ./translation)"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"
          }
        ]
      },
      {
        "path": "Flag.category.coding.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.category.coding.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.category.coding.system",
        "short": "Identity of the terminology system",
        "definition": "The identification of the code system that defines the meaning of the symbol in the code.",
        "comments": "The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously.",
        "requirements": "Need to be unambiguous about the source of the definition of the symbol.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Coding.system",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "http://hl7.org/fhir/flag-category",
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.3"
          },
          {
            "identity": "rim",
            "map": "./codeSystem"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"
          }
        ]
      },
      {
        "path": "Flag.category.coding.version",
        "short": "Version of the system - if relevant",
        "definition": "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.",
        "comments": "Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.",
        "min": 0,
        "max": "0",
        "base": {
          "path": "Coding.version",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.7"
          },
          {
            "identity": "rim",
            "map": "./codeSystemVersion"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"
          }
        ]
      },
      {
        "path": "Flag.category.coding.code",
        "short": "Symbol in syntax defined by the system",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).",
        "comments": "Note that FHIR strings may not exceed 1MB in size",
        "requirements": "Need to refer to a particular code in the system.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Coding.code",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "fixedCode": "drug",
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.1"
          },
          {
            "identity": "rim",
            "map": "./code"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"
          }
        ]
      },
      {
        "path": "Flag.category.coding.display",
        "short": "Representation defined by the system",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.",
        "comments": "Note that FHIR strings may not exceed 1MB in size",
        "requirements": "Need to be able to carry a human-readable meaning of the code for readers that do not know  the system.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Coding.display",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "fixedString": "Drug",
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.2 - but note this is not well followed"
          },
          {
            "identity": "rim",
            "map": "CV.displayName"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"
          }
        ]
      },
      {
        "path": "Flag.category.coding.userSelected",
        "short": "If this coding was chosen directly by the user",
        "definition": "Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).",
        "comments": "Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.",
        "requirements": "This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.",
        "min": 0,
        "max": "0",
        "base": {
          "path": "Coding.userSelected",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "boolean"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "Sometimes implied by being first"
          },
          {
            "identity": "rim",
            "map": "CD.codingRationale"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [     fhir:source \"true\";     fhir:target dt:CDCoding.codingRationale\\#O   ]"
          }
        ]
      },
      {
        "path": "Flag.category.text",
        "short": "Plain text representation of the concept",
        "definition": "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.",
        "comments": "Very often the text is the same as a displayName of one of the codings.",
        "requirements": "The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "CodeableConcept.text",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.9. But note many systems use C*E.2 for this"
          },
          {
            "identity": "rim",
            "map": "./originalText[mediaType/code=\"text/plain\"]/data"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"
          }
        ]
      },
      {
        "path": "Flag.status",
        "short": "active | inactive | entered-in-error",
        "definition": "Supports basic workflow.",
        "comments": "Note that FHIR strings may not exceed 1MB in size",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Flag.status",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isModifier": true,
        "isSummary": true,
        "binding": {
          "strength": "required",
          "description": "Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or entered in error.",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/flag-status"
          }
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": ".status"
          },
          {
            "identity": "w5",
            "map": "status"
          }
        ]
      },
      {
        "path": "Flag.period",
        "short": "Time period when flag is active",
        "definition": "The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.",
        "comments": "This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. \"the patient was an inpatient of the hospital for this time range\") or one value from the range applies (e.g. \"give to the patient between these two times\"). If duration is required, specify the type as Interval|Duration.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Flag.period",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Period"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "start.empty() or end.empty() or (start <= end)"
              }
            ],
            "key": "per-1",
            "severity": "error",
            "human": "If present, start SHALL have a lower value than end",
            "xpath": "not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "DR"
          },
          {
            "identity": "rim",
            "map": "IVL[lowClosed=\"true\" and highClosed=\"true\"] or URG[lowClosed=\"true\" and highClosed=\"true\"]"
          },
          {
            "identity": "w5",
            "map": "context"
          }
        ]
      },
      {
        "path": "Flag.period.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.period.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.period.start",
        "short": "Starting time with inclusive boundary",
        "definition": "The start of the period. The boundary is inclusive.",
        "comments": "If the low element is missing, the meaning is that the low boundary is not known.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Period.start",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "condition": [
          "ele-1",
          "per-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "DR.1"
          },
          {
            "identity": "rim",
            "map": "./low"
          }
        ]
      },
      {
        "path": "Flag.period.end",
        "short": "End time with inclusive boundary, if not ongoing",
        "definition": "The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.",
        "comments": "The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has a end value of 2012-02-03.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Period.end",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "meaningWhenMissing": "If the end of the period is missing, it means that the period is ongoing",
        "condition": [
          "ele-1",
          "per-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "DR.2"
          },
          {
            "identity": "rim",
            "map": "./high"
          }
        ]
      },
      {
        "path": "Flag.subject",
        "short": "Who/What is flag about?",
        "definition": "The patient, location, group , organization , or practitioner this is about record this flag is associated with.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Flag.subject",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/Group"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Organization-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Patient-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Location-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Practitioner-1"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))"
              }
            ],
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a local reference if the resource is provided inline",
            "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
          },
          {
            "identity": "rim",
            "map": ".participation[typeCode=SBJ].role[classCode=PAT | LOCE | ASSIGNED]"
          },
          {
            "identity": "w5",
            "map": "who.focus"
          }
        ]
      },
      {
        "path": "Flag.encounter",
        "short": "Alert relevant during encounter",
        "definition": "This alert is only relevant during the encounter.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Flag.encounter",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Encounter-1"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))"
              }
            ],
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a local reference if the resource is provided inline",
            "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
          },
          {
            "identity": "w5",
            "map": "context"
          }
        ]
      },
      {
        "path": "Flag.encounter.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.encounter.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.encounter.reference",
        "short": "Relative, internal or absolute URL reference",
        "definition": "A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.",
        "comments": "Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries.   Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure \"/[type]/[id]\" then it should be assumed that the reference is to a FHIR RESTful server.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Reference.reference",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1",
          "ref-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.encounter.display",
        "short": "Text alternative for the resource",
        "definition": "Plain text narrative that identifies the resource in addition to the resource reference.",
        "comments": "This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Reference.display",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.author",
        "short": "Flag creator",
        "definition": "The person, organization or device that created the flag.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Flag.author",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/Device"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Organization-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Patient-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Practitioner-1"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))"
              }
            ],
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a local reference if the resource is provided inline",
            "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
          },
          {
            "identity": "rim",
            "map": ".participation[typeCode=AUT].role"
          },
          {
            "identity": "w5",
            "map": "who.author"
          }
        ]
      },
      {
        "path": "Flag.code",
        "short": "Partially deaf, Requires easy open caps, No permanent address, etc.",
        "definition": "The coded value or textual component of the flag to display to the user.",
        "comments": "Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Flag.code",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "binding": {
          "strength": "extensible",
          "description": "List of detail codes for flagged medication issues.",
          "valueSetReference": {
            "reference": "https://fhir.hl7.org.uk/ValueSet/CareConnect-MedicationFlag-1"
          }
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CE/CNE/CWE"
          },
          {
            "identity": "rim",
            "map": "CD"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept rdfs:subClassOf dt:CD"
          },
          {
            "identity": "rim",
            "map": ".value"
          },
          {
            "identity": "w5",
            "map": "what"
          }
        ]
      },
      {
        "path": "Flag.code.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.code.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.code.coding",
        "short": "Code defined by a terminology system",
        "definition": "A reference to a code defined by a terminology system.",
        "comments": "Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labelled as UserSelected = true.",
        "requirements": "Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings.",
        "min": 1,
        "max": "*",
        "base": {
          "path": "CodeableConcept.coding",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Coding"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
          },
          {
            "identity": "rim",
            "map": "CV"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
          },
          {
            "identity": "v2",
            "map": "C*E.1-8, C*E.10-22"
          },
          {
            "identity": "rim",
            "map": "union(., ./translation)"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"
          }
        ]
      },
      {
        "path": "Flag.code.coding.id",
        "short": "xml:id (or equivalent in JSON)",
        "definition": "unique id for the element within a resource (for internal references).",
        "comments": "RFC 4122",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "id"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "path": "Flag.code.coding.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. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comments": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "path": "Flag.code.coding.system",
        "short": "Identity of the terminology system",
        "definition": "The identification of the code system that defines the meaning of the symbol in the code.",
        "comments": "The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously.",
        "requirements": "Need to be unambiguous about the source of the definition of the symbol.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Coding.system",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "https://fhir.hl7.org.uk/CareConnect-MedicationFlag-1",
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.3"
          },
          {
            "identity": "rim",
            "map": "./codeSystem"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"
          }
        ]
      },
      {
        "path": "Flag.code.coding.version",
        "short": "Version of the system - if relevant",
        "definition": "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.",
        "comments": "Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.",
        "min": 0,
        "max": "0",
        "base": {
          "path": "Coding.version",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.7"
          },
          {
            "identity": "rim",
            "map": "./codeSystemVersion"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"
          }
        ]
      },
      {
        "path": "Flag.code.coding.code",
        "short": "Symbol in syntax defined by the system",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).",
        "comments": "Note that FHIR strings may not exceed 1MB in size",
        "requirements": "Need to refer to a particular code in the system.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Coding.code",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.1"
          },
          {
            "identity": "rim",
            "map": "./code"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"
          }
        ]
      },
      {
        "path": "Flag.code.coding.display",
        "short": "Representation defined by the system",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.",
        "comments": "Note that FHIR strings may not exceed 1MB in size",
        "requirements": "Need to be able to carry a human-readable meaning of the code for readers that do not know  the system.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Coding.display",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.2 - but note this is not well followed"
          },
          {
            "identity": "rim",
            "map": "CV.displayName"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"
          }
        ]
      },
      {
        "path": "Flag.code.coding.userSelected",
        "short": "If this coding was chosen directly by the user",
        "definition": "Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).",
        "comments": "Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.",
        "requirements": "This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.",
        "min": 0,
        "max": "0",
        "base": {
          "path": "Coding.userSelected",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "boolean"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "Sometimes implied by being first"
          },
          {
            "identity": "rim",
            "map": "CD.codingRationale"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [     fhir:source \"true\";     fhir:target dt:CDCoding.codingRationale\\#O   ]"
          }
        ]
      },
      {
        "path": "Flag.code.text",
        "short": "Plain text representation of the concept",
        "definition": "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.",
        "comments": "Very often the text is the same as a displayName of one of the codings.",
        "requirements": "The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "CodeableConcept.text",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-expression",
                "valueString": "children()"
              }
            ],
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "xpath": "@value|f:*|h:div"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "C*E.9. But note many systems use C*E.2 for this"
          },
          {
            "identity": "rim",
            "map": "./originalText[mediaType/code=\"text/plain\"]/data"
          },
          {
            "identity": "orim",
            "map": "fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "path": "Flag"
      },
      {
        "path": "Flag.extension",
        "slicing": {
          "discriminator": [
            "url"
          ],
          "rules": "open"
        }
      },
      {
        "path": "Flag.extension",
        "name": "medication",
        "short": "Associated medication",
        "min": 1,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/Extension-CareConnect-MedicationFlagAssociation-1"
            ]
          }
        ]
      },
      {
        "path": "Flag.identifier.system",
        "min": 1
      },
      {
        "path": "Flag.identifier.value",
        "min": 1
      },
      {
        "path": "Flag.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Organization-1"
            ]
          }
        ]
      },
      {
        "path": "Flag.category",
        "min": 1
      },
      {
        "path": "Flag.category.coding",
        "min": 1,
        "max": "1"
      },
      {
        "path": "Flag.category.coding.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/flag-category"
      },
      {
        "path": "Flag.category.coding.version",
        "max": "0"
      },
      {
        "path": "Flag.category.coding.code",
        "min": 1,
        "fixedCode": "drug"
      },
      {
        "path": "Flag.category.coding.display",
        "min": 1,
        "fixedString": "Drug"
      },
      {
        "path": "Flag.category.coding.userSelected",
        "max": "0"
      },
      {
        "path": "Flag.subject",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/Group"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Organization-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Patient-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Location-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Practitioner-1"
            ]
          }
        ]
      },
      {
        "path": "Flag.encounter",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Encounter-1"
            ]
          }
        ]
      },
      {
        "path": "Flag.author",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/Device"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Organization-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Patient-1"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/CareConnect-Practitioner-1"
            ]
          }
        ]
      },
      {
        "path": "Flag.code",
        "binding": {
          "strength": "extensible",
          "description": "List of detail codes for flagged medication issues.",
          "valueSetReference": {
            "reference": "https://fhir.hl7.org.uk/ValueSet/CareConnect-MedicationFlag-1"
          }
        }
      },
      {
        "path": "Flag.code.coding",
        "min": 1
      },
      {
        "path": "Flag.code.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.hl7.org.uk/CareConnect-MedicationFlag-1"
      },
      {
        "path": "Flag.code.coding.version",
        "max": "0"
      },
      {
        "path": "Flag.code.coding.code",
        "min": 1
      },
      {
        "path": "Flag.code.coding.display",
        "min": 1
      },
      {
        "path": "Flag.code.coding.userSelected",
        "max": "0"
      }
    ]
  }
}