PackagesCanonicalsLogsProblems
    Packages
    hl7.fhir.us.carin@bb-1.0.0
    http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Pharmacy
description: This profile is used for Explanation of Benefits (EOBs) based on claims submitted by retail pharmacies. \nThe claims data is based on submission standards adopted by the Department of Health and Human Services defined by NCPDP (National Council for Prescription Drug Program)
package_name: hl7.fhir.us.carin
derivation: constraint
name: C4BBExplanationOfBenefitPharmacy
type: ExplanationOfBenefit
elements:
  processNote:
    elements:
      text: {mustSupport: true, index: 61}
  adjudication: {index: 50}
  supportingInfo:
    array: true
    min: 3
    index: 4
    slicing:
      rules: open
      ordered: false
      description: Slice based on $this pattern
      discriminator:
      - {path: category, type: pattern}
      min: 3
      slices:
        dayssupply:
          match:
            category:
              coding:
              - {code: dayssupply, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
          schema:
            _required: true
            index: 5
            elements:
              category:
                mustSupport: true
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: dayssupply, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
                index: 6
              value:
                mustSupport: true
                choices: [valueQuantity]
                index: 8
              valueQuantity: {type: Quantity, mustSupport: true, choiceOf: value, index: 9}
            required: [value, valueQuantity]
        dawcode:
          match:
            category:
              coding:
              - {code: dawcode, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
          schema:
            _required: true
            index: 10
            elements:
              category:
                mustSupport: true
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: dawcode, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
                index: 11
              code:
                binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/NCPDPDispensedAsWrittenOrProductSelectionCode'}
                mustSupport: true
                index: 12
            required: [code]
        refillNum:
          match:
            category:
              coding:
              - {code: refillnum, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
          schema:
            _required: true
            index: 13
            elements:
              category:
                mustSupport: true
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: refillnum, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
                index: 14
              value:
                mustSupport: true
                choices: [valueQuantity]
                index: 16
              valueQuantity: {type: Quantity, mustSupport: true, choiceOf: value, index: 17}
            required: [value, valueQuantity]
        billingnetworkcontractingstatus:
          match:
            category:
              coding:
              - {code: billingnetworkcontractingstatus, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
          schema:
            index: 18
            elements:
              category:
                mustSupport: true
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: billingnetworkcontractingstatus, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
                index: 19
              code:
                binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBPayerProviderContractingStatus'}
                mustSupport: true
                index: 20
            required: [code]
        brandgenericcode:
          match:
            category:
              coding:
              - {code: brandgenericcode, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
          schema:
            index: 21
            elements:
              category:
                mustSupport: true
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: brandgenericcode, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
                index: 22
              code:
                binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/NCPDPBrandGenericCode'}
                mustSupport: true
                index: 23
            required: [code]
        rxoriginCode:
          match:
            category:
              coding:
              - {code: rxorigincode, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
          schema:
            index: 24
            elements:
              category:
                mustSupport: true
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: rxorigincode, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
                index: 25
              code:
                binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/NCPDPPrescriptionOriginCode'}
                mustSupport: true
                index: 26
            required: [code]
        clmrecvddate:
          match:
            category:
              coding:
              - {code: clmrecvddate, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
          schema:
            index: 27
            elements:
              category:
                mustSupport: true
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: clmrecvddate, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
                index: 28
              timing:
                mustSupport: true
                choices: [timingDate]
                index: 30
              timingDate: {type: date, mustSupport: true, choiceOf: timing, index: 31}
            required: [timingDate, timing]
        compoundcode:
          match:
            category:
              coding:
              - {code: compoundcode, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
          schema:
            index: 32
            elements:
              category:
                mustSupport: true
                pattern:
                  type: CodeableConcept
                  value:
                    coding:
                    - {code: compoundcode, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType'}
                index: 33
              code:
                binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/NCPDPCompoundCode'}
                mustSupport: true
                index: 34
            required: [code]
  payment:
    elements:
      date: {mustSupport: true, index: 60}
  item:
    elements:
      productOrService:
        binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/FDANDCOrCompound'}
        mustSupport: true
        index: 35
      serviced:
        mustSupport: true
        choices: []
        index: 37
      quantity: {mustSupport: true, index: 38}
      adjudication:
        mustSupport: true
        index: 39
        elements:
          category:
            binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBAdjudicationCategoryDiscriminator'}
            index: 40
        slicing:
          rules: closed
          ordered: false
          description: Slice based on value pattern
          discriminator:
          - {path: category, type: pattern}
          min: 1
          slices:
            adjudicationamounttype:
              match: {category: null}
              schema:
                array: true
                min: 1
                _required: true
                index: 41
                elements:
                  category:
                    binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBAdjudication'}
                    index: 42
                  amount: {mustSupport: true, index: 43}
            denialreason:
              match:
                category:
                  coding:
                  - {code: denialreason, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudicationDiscriminator'}
              schema:
                index: 44
                elements:
                  category:
                    pattern:
                      type: CodeableConcept
                      value:
                        coding:
                        - {code: denialreason, system: 'http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudicationDiscriminator'}
                    index: 45
                  reason:
                    binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/NCPDPRejectCode'}
                    mustSupport: true
                    index: 46
                required: [reason]
      detail:
        mustSupport: true
        index: 47
        elements:
          productOrService:
            binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/FDANationalDrugCode'}
            mustSupport: true
            index: 48
          quantity: {mustSupport: true, index: 49}
    required: [adjudication]
  type:
    pattern:
      type: CodeableConcept
      value:
        coding:
        - {code: pharmacy, system: 'http://terminology.hl7.org/CodeSystem/claim-type'}
    index: 0
  created: {mustSupport: true, index: 1}
  total:
    array: true
    min: 2
    index: 51
    elements:
      category:
        binding: {strength: extensible, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBTotalCategoryDiscriminator'}
        mustSupport: true
        index: 52
      amount: {mustSupport: true, index: 53}
    slicing:
      rules: open
      ordered: false
      description: Slice based on value pattern
      discriminator:
      - {path: category, type: pattern}
      min: 2
      slices:
        adjudicationamounttype:
          match: {category: null}
          schema:
            array: true
            min: 1
            _required: true
            index: 54
            elements:
              category:
                binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBAdjudication'}
                index: 55
              amount: {mustSupport: true, index: 56}
        inoutnetwork:
          match: {category: null}
          schema:
            _required: true
            index: 57
            elements:
              category:
                binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBPayerBenefitPaymentStatus'}
                index: 58
              amount: {mustSupport: true, index: 59}
  careTeam:
    constraint:
      ele-1: {human: All FHIR elements must have a @value or children, source: 'http://hl7.org/fhir/StructureDefinition/Element', severity: error, expression: hasValue() or (children().count() > id.count())}
      EOB-pharm-careTeam-practitioner:
        human: 'Pharmacy EOB:  Careteam roles refer to a practitioner'
        source: http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Pharmacy
        severity: error
        expression: |-
          (
          role.where(coding.where(code in ('primary' | 'prescribing' )).exists()).exists() implies
          role.where(coding.where(code in ('primary' | 'prescribing' )).exists()).exists().provider.all(resolve() is Organization)
          )
      EOB-pharm-careTeam-organization:
        human: 'Pharmacy EOB:  Careteam roles refer to an organization'
        source: http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Pharmacy
        severity: error
        expression: |-
          (
          role.where(coding.where(code in ('performing' )).exists()).exists() implies
          role.where(coding.where(code in ('performing' )).exists()).exists().provider.all(resolve() is Organization)
          )
    index: 2
    elements:
      role:
        binding: {strength: required, valueSet: 'http://hl7.org/fhir/us/carin-bb/ValueSet/C4BBClaimPharmacyTeamRole'}
        index: 3
    required: [role]
package_version: bb-1.0.0
class: profile
kind: resource
url: http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit-Pharmacy
base: http://hl7.org/fhir/us/carin-bb/StructureDefinition/C4BB-ExplanationOfBenefit
version: 1.0.0