Sha256: be58a2cd3ef052d61e34f77f764bce48306e30cbdc46ea65bde71cfd67fc70f1

Contents?: true

Size: 1.41 KB

Versions: 7

Compression:

Stored size: 1.41 KB

Contents

module USCoreTestKit
  module USCoreV400
    class DeviceUdiPiTest < Inferno::Test
      id :us_core_v400_device_udi_pi_test
      title 'Device resources returned during previous tests have UDI-PI elements'
      description %(
        This test verifies implantable medical devices that have UDI information represent all of the UDI-PI elements that are present in the UDI code
        in the corresponding US Core Implantable Device Profile element.
      )

      def scratch_resources
        scratch[:device_resources] ||= {}
      end

      run do
        resources = scratch_resources[:all] || []

        skip_if resources.blank?,
                'No Devices resources appeart to be available. ' \
                'Please use patients with more information.'

        resources.each do |device|
          if device.udiCarrier&.first&.carrierHRF.present? &&
            !(
              device.manufactureDate.present? ||
              device.expirationDate.present? ||
              device.lotNumber.present? ||
              device.serialNumber.present? ||
              device.distinctIdentifier.present?
            )
            add_message('error',
                        "Device/#{device.id} has UDI information but does not have any UDI-PI elements presented")
          end
        end

        assert messages.blank?, "Resource has UDI information but does not have any UDI-PI elements presented"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
us_core_test_kit-0.3.0 lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb
us_core_test_kit-0.2.5 lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb
us_core_test_kit-0.2.4 lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb
us_core_test_kit-0.2.3 lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb
us_core_test_kit-0.2.2 lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb
us_core_test_kit-0.2.1 lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb
us_core_test_kit-0.2.0 lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb