{
  "resourceType": "StructureDefinition",
  "id": "ed4c4412-2dcd-4e1e-b6d4-c0cc618c2132",
  "meta": {
    "lastUpdated": "2017-11-07T22:27:38.178+00:00"
  },
  "url": "http://premierincfhir.com/CS/StructureDefinition/TDAFEncounter",
  "name": "TDAFEncounter",
  "status": "draft",
  "date": "2017-10-31T17:01:06.402+00:00",
  "description": "Defines constraints and extensions on the Encounter resource for use in querying and retrieving a patient's encounter related information.",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Encounter",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Encounter",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Encounter.id",
        "path": "Encounter.id",
        "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes",
        "mapping": [
          {
            "identity": "OLKP",
            "map": "TD_ENCOUNTER.TD_ENCOUNTER_ID",
            "comment": "Encounter ID"
          }
        ]
      },
      {
        "id": "Encounter.identifier",
        "path": "Encounter.identifier",
        "min": 1,
        "example": [
          {
            "label": "VisitNum",
            "valueIdentifier": {
              "type": {
                "coding": [
                  {
                    "system": "http://premierinc.com/fhir/identifier-type",
                    "code": "VSTNUM",
                    "display": "VISIT NUMBER"
                  }
                ]
              },
              "system": "http://premierinc.com/fhir/identifier-type",
              "value": "VSTNUM"
            }
          }
        ],
        "mapping": [
          {
            "identity": "OLKP",
            "map": "TD_ENCOUNTER.VISIT_NUM"
          }
        ]
      },
      {
        "id": "Encounter.identifier.use",
        "path": "Encounter.identifier.use",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.type.coding.system",
        "path": "Encounter.identifier.type.coding.system",
        "fixedUri": "http://premierinc.com/fhir/identifier-type"
      },
      {
        "id": "Encounter.identifier.type.coding.version",
        "path": "Encounter.identifier.type.coding.version",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.type.coding.code",
        "path": "Encounter.identifier.type.coding.code",
        "fixedCode": "VSTNUM"
      },
      {
        "id": "Encounter.identifier.type.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Encounter.identifier.type.coding.display",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.type.coding.userSelected",
        "path": "Encounter.identifier.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Encounter.identifier.type.text",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.system",
        "path": "Encounter.identifier.system",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.period",
        "path": "Encounter.identifier.period",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.assigner",
        "path": "Encounter.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Encounter.status",
        "path": "Encounter.status",
        "mapping": [
          {
            "identity": "OLKP",
            "map": "TD_ENCOUNTER.DISCHARGE_DATE; NULL = in-progress, NOT NULL = finished"
          }
        ]
      },
      {
        "id": "Encounter.statusHistory",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "StatusHistory"
          }
        ],
        "path": "Encounter.statusHistory",
        "max": "0"
      },
      {
        "id": "Encounter.class",
        "path": "Encounter.class",
        "example": [
          {
            "label": "Inpatient",
            "valueCoding": {
              "system": "http://hl7.org/fhir/encounter-class",
              "code": "INPATIENT",
              "display": "inpatient"
            }
          }
        ],
        "mapping": [
          {
            "identity": "OLKP",
            "map": "TD_ENCOUNTER.PAT_CLASS",
            "comment": "I,O,E mapped to Inpatient, outpatient, emergency"
          }
        ]
      },
      {
        "id": "Encounter.class.system",
        "path": "Encounter.class.system",
        "fixedUri": "http://hl7.org/fhir/encounter-class"
      },
      {
        "id": "Encounter.classHistory",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "ClassHistory"
          }
        ],
        "path": "Encounter.classHistory",
        "max": "0"
      },
      {
        "id": "Encounter.type",
        "path": "Encounter.type",
        "max": "0"
      },
      {
        "id": "Encounter.priority",
        "path": "Encounter.priority",
        "max": "0"
      },
      {
        "id": "Encounter.subject",
        "path": "Encounter.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": "http://premierincfhir.com/CS/StructureDefinition/TDAFPatient",
            "aggregation": [
              "contained",
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.episodeOfCare",
        "path": "Encounter.episodeOfCare",
        "max": "0"
      },
      {
        "id": "Encounter.incomingReferral",
        "path": "Encounter.incomingReferral",
        "max": "0"
      },
      {
        "id": "Encounter.participant.type",
        "path": "Encounter.participant.type",
        "example": [
          {
            "label": "Attending",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://hl7.org/fhir/ValueSet/encounter-participant-type",
                  "code": "ATND",
                  "display": "Attending"
                }
              ]
            }
          },
          {
            "label": "Admitting",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://hl7.org/fhir/ValueSet/encounter-participant-type",
                  "code": "ADM",
                  "display": "Admitting"
                }
              ]
            }
          }
        ]
      },
      {
        "id": "Encounter.participant.period",
        "path": "Encounter.participant.period",
        "max": "0"
      },
      {
        "id": "Encounter.participant.individual",
        "path": "Encounter.participant.individual",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://premierincfhir.com/CS/StructureDefinition/TDAFPractitioner",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Encounter.appointment",
        "path": "Encounter.appointment",
        "max": "0"
      },
      {
        "id": "Encounter.period.start",
        "path": "Encounter.period.start",
        "min": 1,
        "mapping": [
          {
            "identity": "OLKP",
            "map": "TDDATA.TD_ENCOUNTER.ADMIT_DATE"
          }
        ]
      },
      {
        "id": "Encounter.period.end",
        "path": "Encounter.period.end",
        "mapping": [
          {
            "identity": "OLKP",
            "map": "TDDATA.TD_ENCOUNTER.DISCHARGE_DATE"
          }
        ]
      },
      {
        "id": "Encounter.length",
        "path": "Encounter.length",
        "max": "0"
      },
      {
        "id": "Encounter.reason",
        "path": "Encounter.reason",
        "max": "0"
      }
    ]
  }
}