Class: HQMF::DataCriteria

Inherits:
Object
  • Object
show all
Defined in:
lib/tpg/ext/data_criteria.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valuesObject

Returns the value of attribute values.



3
4
5
# File 'lib/tpg/ext/data_criteria.rb', line 3

def values
  @values
end

Instance Method Details

#modify_patient(patient, time, value_sets) ⇒ Object

Modify a Record with this data criteria.

Parameters:

  • patient (Record)

    The Record that is being modified.

  • time (Range)

    The period of time during which the data criteria happens.

  • value_sets (Hash)

    The value sets that this data criteria references.

Returns:

  • The modified patient.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/tpg/ext/data_criteria.rb', line 11

def modify_patient(patient, time, value_sets)
  # Modify the patient with a characteristic if this data criteria defines one
  modify_patient_with_characteristic(patient, time, value_sets)

  # Otherwise we're dealing with a data criteria that describes a coded entry, so we create it and add it to the patient
  entry = derive_entry(time, value_sets)
  modify_entry_with_values(entry, value_sets)
  modify_entry_with_negation(entry, value_sets)
  modify_entry_with_fields(entry, value_sets)
  modify_patient_with_entry(patient, entry)
end