Class: XdsPlan

Inherits:
TestPlan
  • Object
show all
Defined in:
app/models/xds_plan.rb

Defined Under Namespace

Modules: Actions

Instance Method Summary collapse

Methods inherited from TestPlan

#clone, completed_actions, #completed_actions, #count_errors, #count_warnings, manual_inspection, #manual_inspection?, manual_inspection?, normalize_name, #override_state!, #parameterized_name, #pending_actions, pending_actions, #test_actions, #test_name, test_name, test_types, #to_s

Instance Method Details

#fetch_xds_metadata(patient_identifier) ⇒ Object

Return a list of XDS metadata objects corresponding to the current patient identifier



6
7
8
# File 'app/models/xds_plan.rb', line 6

def  patient_identifier
  XDSUtils.(patient_identifier) || []
end

#test_type_data=(raw_metadata) ⇒ Object

Accepts metadata as a string or hash.

When passing a hash, expects a :patient_id key pointing to the template patient ID.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/models/xds_plan.rb', line 14

def test_type_data=()
  if .instance_of? XDS::Metadata
    super
  elsif .kind_of?(String)
    super YAML.load()         
  else
    patient = Patient.find .delete(:patient_id)
    [:source_patient_info] = patient.source_patient_info
    md = XDS::Metadata.new
    md.from_hash(, AFFINITY_DOMAIN_CONFIG)
    md.repository_unique_id = Setting.xds_repository_unique_id
    md.patient_id = patient.patient_identifier
    super md
  end
end