inferno_core 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno/apps/cli/evaluate.rb +64 -0
  3. data/lib/inferno/apps/cli/main.rb +38 -0
  4. data/lib/inferno/apps/cli/templates/%library_name%.gemspec.tt +10 -3
  5. data/lib/inferno/apps/cli/templates/Dockerfile.tt +3 -2
  6. data/lib/inferno/apps/cli/templates/lib/%library_name%/metadata.rb.tt +18 -0
  7. data/lib/inferno/apps/cli/templates/lib/%library_name%/suite.rb.tt +59 -0
  8. data/lib/inferno/apps/cli/templates/lib/%library_name%/version.rb.tt +3 -0
  9. data/lib/inferno/apps/cli/templates/lib/%library_name%.rb.tt +1 -58
  10. data/lib/inferno/apps/web/serializers/input.rb +2 -1
  11. data/lib/inferno/apps/web/serializers/markdown_extractor.rb +16 -0
  12. data/lib/inferno/config/boot/presets.rb +18 -1
  13. data/lib/inferno/dsl/fhir_evaluation/config.rb +21 -0
  14. data/lib/inferno/dsl/fhir_evaluation/dataset_loader.rb +33 -0
  15. data/lib/inferno/dsl/fhir_evaluation/evaluation_context.rb +25 -0
  16. data/lib/inferno/dsl/fhir_evaluation/evaluation_result.rb +62 -0
  17. data/lib/inferno/dsl/fhir_evaluation/evaluator.rb +36 -0
  18. data/lib/inferno/dsl/fhir_evaluation/rule.rb +13 -0
  19. data/lib/inferno/dsl/suite_endpoint.rb +58 -58
  20. data/lib/inferno/dsl.rb +2 -0
  21. data/lib/inferno/entities/test_kit.rb +4 -2
  22. data/lib/inferno/entities/test_suite.rb +23 -3
  23. data/lib/inferno/entities.rb +1 -0
  24. data/lib/inferno/public/bundle.js +34 -34
  25. data/lib/inferno/repositories/presets.rb +12 -6
  26. data/lib/inferno/result_summarizer.rb +2 -0
  27. data/lib/inferno/utils/named_thor_actions.rb +5 -1
  28. data/lib/inferno/version.rb +1 -1
  29. metadata +14 -3
@@ -8,14 +8,20 @@ module Inferno
8
8
  # Repository that deals with persistence for the `Preset` entity.
9
9
  class Presets < InMemoryRepository
10
10
  def insert_from_file(path)
11
- case path
12
- when /\.json$/
13
- preset_hash = JSON.parse(File.read(path))
14
- when /\.erb$/
15
- templated = ERB.new(File.read(path)).result
16
- preset_hash = JSON.parse(templated)
11
+ raw_contents =
12
+ case path
13
+ when /\.json$/
14
+ File.read(path)
15
+ when /\.erb$/
16
+ ERB.new(File.read(path)).result
17
+ end
18
+
19
+ if Application['base_url'].start_with? 'https://inferno-qa.healthit.gov'
20
+ raw_contents.gsub!('https://inferno.healthit.gov', 'https://inferno-qa.healthit.gov')
17
21
  end
18
22
 
23
+ preset_hash = JSON.parse(raw_contents)
24
+
19
25
  preset_hash.deep_symbolize_keys!
20
26
  preset_hash[:id] ||= SecureRandom.uuid
21
27
  preset = Entities::Preset.new(preset_hash)
@@ -12,6 +12,8 @@ module Inferno
12
12
  end
13
13
 
14
14
  def summarize
15
+ return 'wait' if results.any? { |result| result.result == 'wait' }
16
+
15
17
  return 'pass' if optional_results_passing_criteria_met?
16
18
 
17
19
  prioritized_result_strings.find { |result_string| unique_result_strings.include? result_string }
@@ -25,8 +25,12 @@ module Inferno
25
25
  human_name.split.map(&:capitalize).join(' ')
26
26
  end
27
27
 
28
+ def test_kit_id
29
+ library_name.delete_suffix('_test_kit')
30
+ end
31
+
28
32
  def test_suite_id
29
- "#{library_name}_test_suite"
33
+ test_kit_id
30
34
  end
31
35
  end
32
36
  end
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '0.5.2'.freeze
3
+ VERSION = '0.5.3'.freeze
4
4
  end
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.5.2
4
+ version: 0.5.3
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: 2024-12-06 00:00:00.000000000 Z
13
+ date: 2024-12-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -390,6 +390,7 @@ files:
390
390
  - lib/inferno.rb
391
391
  - lib/inferno/apps/cli.rb
392
392
  - lib/inferno/apps/cli/console.rb
393
+ - lib/inferno/apps/cli/evaluate.rb
393
394
  - lib/inferno/apps/cli/execute.rb
394
395
  - lib/inferno/apps/cli/execute/console_outputter.rb
395
396
  - lib/inferno/apps/cli/execute/json_outputter.rb
@@ -432,7 +433,10 @@ files:
432
433
  - lib/inferno/apps/cli/templates/lib/%library_name%/igs/.keep
433
434
  - lib/inferno/apps/cli/templates/lib/%library_name%/igs/README.md
434
435
  - lib/inferno/apps/cli/templates/lib/%library_name%/igs/put_ig_package_dot_tgz_here
436
+ - lib/inferno/apps/cli/templates/lib/%library_name%/metadata.rb.tt
435
437
  - lib/inferno/apps/cli/templates/lib/%library_name%/patient_group.rb.tt
438
+ - lib/inferno/apps/cli/templates/lib/%library_name%/suite.rb.tt
439
+ - lib/inferno/apps/cli/templates/lib/%library_name%/version.rb.tt
436
440
  - lib/inferno/apps/cli/templates/run.sh
437
441
  - lib/inferno/apps/cli/templates/setup.sh
438
442
  - lib/inferno/apps/cli/templates/spec/%library_name%/patient_group_spec.rb.tt
@@ -461,6 +465,7 @@ files:
461
465
  - lib/inferno/apps/web/serializers/hash_value_extractor.rb
462
466
  - lib/inferno/apps/web/serializers/header.rb
463
467
  - lib/inferno/apps/web/serializers/input.rb
468
+ - lib/inferno/apps/web/serializers/markdown_extractor.rb
464
469
  - lib/inferno/apps/web/serializers/message.rb
465
470
  - lib/inferno/apps/web/serializers/preset.rb
466
471
  - lib/inferno/apps/web/serializers/request.rb
@@ -500,6 +505,12 @@ files:
500
505
  - lib/inferno/dsl/configurable.rb
501
506
  - lib/inferno/dsl/fhir_client.rb
502
507
  - lib/inferno/dsl/fhir_client_builder.rb
508
+ - lib/inferno/dsl/fhir_evaluation/config.rb
509
+ - lib/inferno/dsl/fhir_evaluation/dataset_loader.rb
510
+ - lib/inferno/dsl/fhir_evaluation/evaluation_context.rb
511
+ - lib/inferno/dsl/fhir_evaluation/evaluation_result.rb
512
+ - lib/inferno/dsl/fhir_evaluation/evaluator.rb
513
+ - lib/inferno/dsl/fhir_evaluation/rule.rb
503
514
  - lib/inferno/dsl/fhir_resource_validation.rb
504
515
  - lib/inferno/dsl/fhir_validation.rb
505
516
  - lib/inferno/dsl/fhirpath_evaluation.rb
@@ -627,7 +638,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
627
638
  - !ruby/object:Gem::Version
628
639
  version: '0'
629
640
  requirements: []
630
- rubygems_version: 3.5.9
641
+ rubygems_version: 3.3.7
631
642
  signing_key:
632
643
  specification_version: 4
633
644
  summary: Inferno Core is an open source tool for testing data exchanges enabled by