ips_test_kit 0.10.1 → 0.10.2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bf1e1afde4fe4c962c01345f752d36f1880cdf3ce82eb9cb8841daf0272e977
|
4
|
+
data.tar.gz: 251446a0ac6e0b99f59fda08da687691379bf44715f52bf4e9cbda288e608f58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2069617050a4c57f988895c77f811532688593df278cb0ebf9c9363359e520544ae5c13d2b25355557ced8be9e07d7dfc34e47d539958f13d957b54ec1ea454
|
7
|
+
data.tar.gz: 8fa079fcf40b882ba93c53216b5d99b9947b00cee6597c6a921213e3ee5b5f19abca7f2331203bf445ef9dbb8dcdf50c0f57122b975543328d6baa8c6f5c761c
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require_relative './summary_operation_return_bundle'
|
2
|
+
require_relative './summary_operation_support'
|
3
|
+
require_relative './summary_operation_valid_composition'
|
1
4
|
module IPS
|
2
5
|
class SummaryOperation < Inferno::TestGroup
|
3
6
|
title 'Summary Operation Tests'
|
@@ -8,77 +11,11 @@ module IPS
|
|
8
11
|
id :ips_summary_operation
|
9
12
|
run_as_group
|
10
13
|
|
11
|
-
test
|
12
|
-
title 'IPS Server declares support for $summary operation in CapabilityStatement'
|
13
|
-
description %(
|
14
|
-
The IPS Server declares support for Patient/[id]/$summary operation in its server CapabilityStatement
|
15
|
-
)
|
16
|
-
|
17
|
-
run do
|
18
|
-
fhir_get_capability_statement
|
19
|
-
assert_response_status(200)
|
20
|
-
|
21
|
-
operations = resource.rest&.flat_map do |rest|
|
22
|
-
rest.resource
|
23
|
-
&.select { |r| r.type == 'Patient' && r.respond_to?(:operation) }
|
24
|
-
&.flat_map(&:operation)
|
25
|
-
end&.compact
|
26
|
-
|
27
|
-
operation_defined = operations.any? do |operation|
|
28
|
-
operation.definition == 'http://hl7.org/fhir/uv/ips/OperationDefinition/summary' ||
|
29
|
-
['summary', 'patient-summary'].include?(operation.name.downcase)
|
30
|
-
end
|
31
|
-
|
32
|
-
assert operation_defined, 'Server CapabilityStatement did not declare support for $summary operation in Patient resource.'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
test do
|
37
|
-
title 'IPS Server returns Bundle resource for Patient/[id]/$summary GET operation'
|
38
|
-
description %(
|
39
|
-
IPS Server returns a valid IPS Bundle resource as successful result of
|
40
|
-
$summary operation.
|
41
|
-
|
42
|
-
This test currently only issues a GET request for the summary due to a
|
43
|
-
limitation in Inferno in issuing POST requests that omit a Content-Type
|
44
|
-
header when the body is empty. Inferno currently adds a `Content-Type:
|
45
|
-
application/x-www-form-urlencoded` header when issuing a POST with no
|
46
|
-
body, which causes issues in known reference implementations.
|
47
|
-
|
48
|
-
A future update to this test suite should include a required POST
|
49
|
-
request as well as an optional GET request for this content.
|
50
|
-
)
|
14
|
+
test from: :ips_summary_operation_support
|
51
15
|
|
52
|
-
|
53
|
-
makes_request :summary_operation
|
16
|
+
test from: :ips_summary_operation_return_bundle
|
54
17
|
|
55
|
-
|
56
|
-
fhir_operation("Patient/#{patient_id}/$summary", name: :summary_operation, operation_method: :get)
|
57
|
-
assert_response_status(200)
|
58
|
-
assert_resource_type(:bundle)
|
59
|
-
assert_valid_resource(profile_url: 'http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips')
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
test do
|
64
|
-
title 'IPS Server returns Bundle resource containing valid IPS Composition entry'
|
65
|
-
description %(
|
66
|
-
IPS Server return valid IPS Composition resource in the Bundle as first entry
|
67
|
-
)
|
68
|
-
# link 'http://hl7.org/fhir/uv/ips/StructureDefinition-Composition-uv-ips.html'
|
69
|
-
uses_request :summary_operation
|
70
|
-
|
71
|
-
run do
|
72
|
-
skip_if !resource.is_a?(FHIR::Bundle), 'No Bundle returned from document operation'
|
73
|
-
|
74
|
-
assert resource.entry.length.positive?, 'Bundle has no entries'
|
75
|
-
|
76
|
-
first_resource = resource.entry.first.resource
|
77
|
-
|
78
|
-
assert first_resource.is_a?(FHIR::Composition), 'The first entry in the Bundle is not a Composition'
|
79
|
-
assert_valid_resource(resource: first_resource, profile_url: 'http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips')
|
80
|
-
end
|
81
|
-
end
|
18
|
+
test from: :ips_summary_operation_valid_composition
|
82
19
|
|
83
20
|
test do
|
84
21
|
title 'IPS Server returns Bundle resource containing valid IPS MedicationStatement entry'
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module IPS
|
4
|
+
class SummaryOperationReturnBundle < Inferno::Test
|
5
|
+
title 'IPS Server returns Bundle resource for Patient/[id]/$summary GET operation'
|
6
|
+
description %(
|
7
|
+
IPS Server returns a valid IPS Bundle resource as successful result of
|
8
|
+
$summary operation.
|
9
|
+
|
10
|
+
This test currently only issues a GET request for the summary due to a
|
11
|
+
limitation in Inferno in issuing POST requests that omit a Content-Type
|
12
|
+
header when the body is empty. Inferno currently adds a `Content-Type:
|
13
|
+
application/x-www-form-urlencoded` header when issuing a POST with no
|
14
|
+
body, which causes issues in known reference implementations.
|
15
|
+
|
16
|
+
A future update to this test suite should include a required POST
|
17
|
+
request as well as an optional GET request for this content.
|
18
|
+
)
|
19
|
+
id :ips_summary_operation_return_bundle
|
20
|
+
|
21
|
+
input :patient_id
|
22
|
+
makes_request :summary_operation
|
23
|
+
|
24
|
+
class << self
|
25
|
+
def profile_url
|
26
|
+
@profile_url ||= config.options[:ips_bundle_profile_url] || 'http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
run do
|
31
|
+
fhir_operation("Patient/#{patient_id}/$summary", name: :summary_operation, operation_method: :get)
|
32
|
+
assert_response_status(200)
|
33
|
+
assert_resource_type(:bundle)
|
34
|
+
assert_valid_resource(profile_url: self.class.profile_url)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module IPS
|
4
|
+
class SummaryOperationSupport < Inferno::Test
|
5
|
+
title 'IPS Server declares support for $summary operation in CapabilityStatement'
|
6
|
+
description %(
|
7
|
+
The IPS Server declares support for Patient/[id]/$summary operation in its server CapabilityStatement
|
8
|
+
)
|
9
|
+
id :ips_summary_operation_support
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def ips_summary_operation_definition_url
|
13
|
+
@ips_summary_operation_definition_url ||= config.options[:ips_summary_operation_definition_url] || 'http://hl7.org/fhir/uv/ips/OperationDefinition/summary'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
run do
|
18
|
+
fhir_get_capability_statement
|
19
|
+
assert_response_status(200)
|
20
|
+
|
21
|
+
operations = resource.rest&.flat_map do |rest|
|
22
|
+
rest.resource
|
23
|
+
&.select { |r| r.type == 'Patient' && r.respond_to?(:operation) }
|
24
|
+
&.flat_map(&:operation)
|
25
|
+
end&.compact
|
26
|
+
|
27
|
+
operation_defined = operations.any? do |operation|
|
28
|
+
operation.definition == self.class.ips_summary_operation_definition_url ||
|
29
|
+
%w[summary patient-summary].include?(operation.name.downcase)
|
30
|
+
end
|
31
|
+
|
32
|
+
assert operation_defined,
|
33
|
+
'Server CapabilityStatement did not declare support for $summary operation in Patient resource.'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module IPS
|
4
|
+
class SummaryOperationValidComposition < Inferno::Test
|
5
|
+
title 'IPS Server returns Bundle resource containing valid IPS Composition entry'
|
6
|
+
description 'IPS Server return valid IPS Composition resource in the Bundle as first entry'
|
7
|
+
id :ips_summary_operation_valid_composition
|
8
|
+
uses_request :summary_operation
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def profile_url
|
12
|
+
@profile_url ||= config.options[:ips_composition_profile_url] || 'http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
run do
|
17
|
+
skip_if !resource.is_a?(FHIR::Bundle), 'No Bundle returned from document operation'
|
18
|
+
assert resource.entry.length.positive?, 'Bundle has no entries'
|
19
|
+
|
20
|
+
first_resource = resource.entry.first.resource
|
21
|
+
|
22
|
+
assert first_resource.is_a?(FHIR::Composition), 'The first entry in the Bundle is not a Composition'
|
23
|
+
assert_valid_resource(resource: first_resource, profile_url: self.class.profile_url)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/ips/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ips_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MITRE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inferno_core
|
@@ -120,6 +120,9 @@ files:
|
|
120
120
|
- lib/ips/procedure.rb
|
121
121
|
- lib/ips/specimen.rb
|
122
122
|
- lib/ips/summary_operation.rb
|
123
|
+
- lib/ips/summary_operation_return_bundle.rb
|
124
|
+
- lib/ips/summary_operation_support.rb
|
125
|
+
- lib/ips/summary_operation_valid_composition.rb
|
123
126
|
- lib/ips/version.rb
|
124
127
|
- lib/ips_test_kit.rb
|
125
128
|
homepage: https://github.com/inferno-framework/ips-test-kit
|
@@ -143,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
146
|
- !ruby/object:Gem::Version
|
144
147
|
version: '0'
|
145
148
|
requirements: []
|
146
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.5.9
|
147
150
|
signing_key:
|
148
151
|
specification_version: 4
|
149
152
|
summary: IPS Tests
|