PackagesCanonicalsLogsProblems
    Packages
    hl7.cda.us.ccda@3.0.0-ballot
    http://hl7.org/cda/us/ccda/StructureDefinition/DischargeMedication
description: This template represents medications that the patient is intended to take (or stop) after discharge.
package_name: hl7.cda.us.ccda
derivation: constraint
name: DischargeMedication
type: http://hl7.org/cda/stds/core/StructureDefinition/Act
elements:
  templateId:
    index: 0
    slicing:
      rules: open
      discriminator:
      - {path: root, type: value}
      - {path: extension, type: value}
      min: 1
      slices:
        discharge-med:
          match: {root: 2.16.840.1.113883.10.20.22.4.35, extension: '2016-03-01'}
          schema:
            _required: true
            index: 1
            elements:
              root:
                pattern: {type: String, value: 2.16.840.1.113883.10.20.22.4.35}
                index: 2
              extension:
                pattern: {type: String, value: '2016-03-01'}
                index: 3
            required: [root, extension]
            extensions: {}
  classCode:
    pattern: {type: Code, value: ACT}
    index: 4
  moodCode:
    pattern: {type: Code, value: EVN}
    index: 5
  code:
    short: Hospital discharge medication
    index: 6
    elements:
      code:
        pattern: {type: Code, value: 10183-2}
        index: 7
      codeSystem:
        short: LOINC
        pattern: {type: String, value: 2.16.840.1.113883.6.1}
        index: 8
      translation:
        short: Discharge Medication
        index: 9
        elements:
          code:
            pattern: {type: Code, value: 75311-1}
            index: 10
          codeSystem:
            short: LOINC
            pattern: {type: String, value: 2.16.840.1.113883.6.1}
            index: 11
        required: [codeSystem, code]
    required: [codeSystem, code, translation]
  text:
    short: SHOULD reference the portion of section narrative text corresponding to this entry
    index: 12
    elements:
      reference:
        constraint:
          value-starts-octothorpe: {human: 'If reference/@value is present, it SHALL begin with a ''#'' and SHALL point to its corresponding narrative', source: 'http://hl7.org/cda/us/ccda/StructureDefinition/DischargeMedication', severity: error, expression: value.exists() implies value.startsWith('#')}
        index: 13
  statusCode:
    index: 14
    elements:
      code:
        pattern: {type: Code, value: completed}
        index: 15
    required: [code]
  entryRelationship:
    index: 16
    slicing:
      rules: open
      discriminator:
      - {path: substanceAdministration, type: profile}
      - {path: typeCode, type: value}
      min: 1
      slices:
        medicationActivity:
          match: {typeCode: SUBJ}
          schema:
            array: true
            min: 1
            _required: true
            index: 17
            elements:
              typeCode:
                pattern: {type: Code, value: SUBJ}
                index: 18
              substanceAdministration: {type: 'http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration', index: 19}
            required: [substanceAdministration]
package_version: 3.0.0-ballot
class: logical
kind: logical
url: http://hl7.org/cda/us/ccda/StructureDefinition/DischargeMedication
base: http://hl7.org/cda/stds/core/StructureDefinition/Act
version: 3.0.0-ballot
required: [statusCode, templateId, entryRelationship]