inferno_core 0.2.0.rc3 → 0.3.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,8 @@ object-assign
11
11
  * @license MIT
12
12
  */
13
13
 
14
+ /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
15
+
14
16
  /**
15
17
  * A better abstraction over CSS.
16
18
  *
Binary file
@@ -60,8 +60,8 @@ module Inferno
60
60
 
61
61
  def run_test(test, scratch)
62
62
  inputs = load_inputs(test)
63
+ input_json_string = inputs_as_json(test, inputs)
63
64
 
64
- input_json_string = JSON.generate(inputs)
65
65
  test_instance = test.new(inputs: inputs, test_session_id: test_session.id, scratch: scratch)
66
66
 
67
67
  result = begin
@@ -107,6 +107,16 @@ module Inferno
107
107
  end
108
108
 
109
109
  def run_group(group, scratch)
110
+ group_inputs_with_values = group.available_inputs.map do |_input_identifier, input|
111
+ {
112
+ name: input.name,
113
+ label: input.title,
114
+ description: input.description,
115
+ value: session_data_repo.load(test_session_id: test_session.id, name: input.name, type: input.type),
116
+ type: input.type
117
+ }
118
+ end
119
+
110
120
  results = []
111
121
  group.children.each do |child|
112
122
  result = run(child, scratch)
@@ -116,7 +126,8 @@ module Inferno
116
126
 
117
127
  results.flatten!
118
128
 
119
- group_result = persist_result(group.reference_hash.merge(result: roll_up_result(results)))
129
+ group_result = persist_result(group.reference_hash.merge(result: roll_up_result(results),
130
+ input_json: JSON.generate(group_inputs_with_values)))
120
131
 
121
132
  update_parent_result(group.parent)
122
133
 
@@ -153,6 +164,17 @@ module Inferno
153
164
  end
154
165
  end
155
166
 
167
+ def inputs_as_json(runnable, input_values)
168
+ inputs_array = runnable.inputs.map do |input_identifier|
169
+ {
170
+ name: runnable.config.input_name(input_identifier),
171
+ value: input_values[input_identifier],
172
+ type: runnable.config.input_type(input_identifier)
173
+ }
174
+ end
175
+ JSON.generate(inputs_array)
176
+ end
177
+
156
178
  def save_outputs(runnable_instance)
157
179
  outputs =
158
180
  runnable_instance.outputs_to_persist.map do |output_identifier, value|
@@ -7,17 +7,16 @@ module Inferno
7
7
  self.runnable = runnable
8
8
  end
9
9
 
10
- def input_definitions
11
- @input_definitions ||= runnable.available_input_definitions
10
+ def available_inputs
11
+ @available_inputs ||= runnable.available_inputs.transform_values(&:to_hash)
12
12
  end
13
13
 
14
14
  def inputs
15
15
  # The rubocop rule is disabled because `each_value` returns the hash,
16
16
  # while `values.each` will return the array of values. We want the array
17
17
  # of values here.
18
- input_definitions.values.each do |input_definition| # rubocop:disable Style/HashEachMethods
19
- input_definition[:value] =
20
- (input_definition.delete(:default) if input_definition.key? :default)
18
+ available_inputs.values.each do |input| # rubocop:disable Style/HashEachMethods
19
+ input[:value] = (input.delete(:default) if input.key? :default)
21
20
  end
22
21
  end
23
22
 
@@ -1,3 +1,4 @@
1
1
  module Inferno
2
- VERSION = '0.2.0.rc3'.freeze
2
+ # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
+ VERSION = '0.3.0.rc1'.freeze
3
4
  end
@@ -15,6 +15,7 @@ FactoryBot.define do
15
15
  test_group_id { runnable[:test_group_id] }
16
16
  test_id { runnable[:test_id] }
17
17
  output_json { '[]' }
18
+ input_json { '[]' }
18
19
 
19
20
  result { 'pass' }
20
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inferno_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.rc3
4
+ version: 0.3.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-03-02 00:00:00.000000000 Z
13
+ date: 2022-04-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -520,6 +520,7 @@ files:
520
520
  - lib/inferno/dsl/fhir_validation.rb
521
521
  - lib/inferno/dsl/http_client.rb
522
522
  - lib/inferno/dsl/http_client_builder.rb
523
+ - lib/inferno/dsl/input_output_handling.rb
523
524
  - lib/inferno/dsl/oauth_credentials.rb
524
525
  - lib/inferno/dsl/request_storage.rb
525
526
  - lib/inferno/dsl/results.rb
@@ -530,6 +531,7 @@ files:
530
531
  - lib/inferno/entities/entity.rb
531
532
  - lib/inferno/entities/has_runnable.rb
532
533
  - lib/inferno/entities/header.rb
534
+ - lib/inferno/entities/input.rb
533
535
  - lib/inferno/entities/message.rb
534
536
  - lib/inferno/entities/preset.rb
535
537
  - lib/inferno/entities/request.rb
@@ -542,18 +544,18 @@ files:
542
544
  - lib/inferno/entities/test_suite.rb
543
545
  - lib/inferno/exceptions.rb
544
546
  - lib/inferno/ext/fhir_client.rb
547
+ - lib/inferno/ext/fhir_models.rb
545
548
  - lib/inferno/jobs.rb
546
549
  - lib/inferno/jobs/execute_test_run.rb
547
550
  - lib/inferno/jobs/resume_test_run.rb
551
+ - lib/inferno/public/0e0b993fd6ff351f435ff1c2938daf2d.png
548
552
  - lib/inferno/public/217.bundle.js
549
- - lib/inferno/public/72a5cd989e6aea904540824ec865a0f8.png
553
+ - lib/inferno/public/a5cd39450ab0336db73c5e57228b649d.png
550
554
  - lib/inferno/public/assets.json
551
555
  - lib/inferno/public/bundle.js
552
556
  - lib/inferno/public/bundle.js.LICENSE.txt
553
- - lib/inferno/public/e09b16f5cb645eb05f90c8f38f3409fb.png
554
557
  - lib/inferno/public/favicon.ico
555
558
  - lib/inferno/public/logo192.png
556
- - lib/inferno/public/logo512.png
557
559
  - lib/inferno/repositories.rb
558
560
  - lib/inferno/repositories/headers.rb
559
561
  - lib/inferno/repositories/in_memory_repository.rb
@@ -587,13 +589,13 @@ files:
587
589
  - spec/fixtures/basic_test_group.rb
588
590
  - spec/fixtures/basic_test_suite.rb
589
591
  - spec/support/factory_bot.rb
590
- homepage: https://github.com/inferno_community/inferno-core
592
+ homepage: https://github.com/inferno-framework/inferno-core
591
593
  licenses:
592
594
  - Apache-2.0
593
595
  metadata:
594
- homepage_uri: https://github.com/inferno_community/inferno-core
595
- source_code_uri: https://github.com/inferno_community/inferno-core
596
- changelog_uri: https://github.com/inferno_community/inferno-core/CHANGELOG.md
596
+ homepage_uri: https://github.com/inferno-framework/inferno-core
597
+ source_code_uri: https://github.com/inferno-framework/inferno-core
598
+ changelog_uri: https://github.com/inferno-framework/inferno-core/blob/main/CHANGELOG.md
597
599
  post_install_message:
598
600
  rdoc_options: []
599
601
  require_paths:
Binary file