Module: Validation

Defined in:
lib/validation.rb

Defined Under Namespace

Classes: BaseValidator, FileValidator, InvalidValidatorException, ValidationRegistry, Validator

Constant Summary

C32_V2_1_2_3_TYPE =
'C32 v2.1/v2.3'
C32_V2_5_TYPE =
'C32 v2.5'
C32_NHIN_TYPE =
'NHIN C32'
CCR_TYPE =
'CCR'

Class Method Summary collapse

Class Method Details

.get_validator(type) ⇒ Object



16
17
18
# File 'lib/validation.rb', line 16

def Validation.get_validator(type)
  ValidationRegistry.instance.get_validator(type)
end

.register_validator(doc_type, validator) ⇒ Object



12
13
14
# File 'lib/validation.rb', line 12

def Validation.register_validator(doc_type, validator)
  ValidationRegistry.instance.register_validator(doc_type, validator)
end

.typesObject



24
25
26
# File 'lib/validation.rb', line 24

def Validation.types
  ValidationRegistry.instance.types
end

.unregister_validatorsObject



8
9
10
# File 'lib/validation.rb', line 8

def Validation.unregister_validators
  ValidationRegistry.instance.unregister_validators
end

.validate(patient_data, document) ⇒ Object



20
21
22
# File 'lib/validation.rb', line 20

def Validation.validate(patient_data, document)
  get_validator(document.doc_type).validate(patient_data,document)
end