Class: Inferno::DSL::FHIRResourceValidation::ValidatorIssue

Inherits:
Object
  • Object
show all
Defined in:
lib/inferno/dsl/fhir_resource_validation.rb

Overview

ValidatorIssue represents a single validation issue returned from the FHIR validator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_issue:, target:, slice_info: [], filtered: false) ⇒ ValidatorIssue

Creates a new ValidatorIssue

Parameters:

  • raw_issue (Hash) —

    the raw issue hash from the validator response

  • target (FHIR::Model, Hash) —

    the object being validated

  • slice_info (Array<ValidatorIssue>) (defaults to: []) —

    nested slice information as ValidatorIssue objects

  • filtered (Boolean) (defaults to: false) —

    whether this issue has been filtered out



851
852
853
854
855
856
# File 'lib/inferno/dsl/fhir_resource_validation.rb', line 851

def initialize(raw_issue:, target:, slice_info: [], filtered: false)
  @raw_issue = raw_issue
  @target = target
  @slice_info = slice_info
  @filtered = filtered
end

Instance Attribute Details

#filtered ⇒ Object

Returns the value of attribute filtered.



843
844
845
# File 'lib/inferno/dsl/fhir_resource_validation.rb', line 843

def filtered
  @filtered
end

#raw_issue ⇒ Object

Returns the value of attribute raw_issue.



843
844
845
# File 'lib/inferno/dsl/fhir_resource_validation.rb', line 843

def raw_issue
  @raw_issue
end

#slice_info ⇒ Object

Returns the value of attribute slice_info.



843
844
845
# File 'lib/inferno/dsl/fhir_resource_validation.rb', line 843

def slice_info
  @slice_info
end

#target ⇒ Object (readonly)

Returns the value of attribute target.



844
845
846
# File 'lib/inferno/dsl/fhir_resource_validation.rb', line 844

def target
  @target
end

Instance Method Details

#location ⇒ String

Extracted location from the issue

Returns:

  • (String) —

    the location string



872
873
874
# File 'lib/inferno/dsl/fhir_resource_validation.rb', line 872

def location
  @location ||= extract_location
end

#message ⇒ String

Lazily calculated formatted message

Returns:

  • (String) —

    the formatted message for the issue



860
861
862
# File 'lib/inferno/dsl/fhir_resource_validation.rb', line 860

def message
  @message ||= format_message
end

#severity ⇒ String

Lazily calculated severity level

Returns:

  • (String) —

    'error', 'warning', or 'info'



866
867
868
# File 'lib/inferno/dsl/fhir_resource_validation.rb', line 866

def severity
  @severity ||= calculate_severity
end