@@ -29,31 +29,116 @@ def run(runnable, inputs = {})
2929 sessionId : 'b8cf5547-1dc7-4714-a797-dc2347b93fe2'
3030 }
3131 end
32+ let ( :fhir_bundle_corrina_rowe ) do
33+ FHIR ::Bundle . new (
34+ type : 'collection' ,
35+ entry : [
36+ {
37+ fullUrl : 'resource:0' ,
38+ resource : FHIR ::Patient . new (
39+ name : [
40+ {
41+ family : 'Rowe' ,
42+ given : [ 'Corrina' ]
43+ }
44+ ] ,
45+ birthDate : '1971-12-06' ,
46+ resourceType : 'Patient'
47+ )
48+ } ,
49+ {
50+ fullUrl : 'resource:1' ,
51+ resource : FHIR ::Immunization . new (
52+ status : 'completed' ,
53+ vaccineCode : {
54+ coding : [
55+ {
56+ system : 'http://hl7.org/fhir/sid/cvx' ,
57+ code : '207'
58+ }
59+ ]
60+ } ,
61+ patient : {
62+ reference : 'resource:0'
63+ } ,
64+ occurrenceDateTime : '2025-02-05' ,
65+ lotNumber : '1234567' ,
66+ resourceType : 'Immunization'
67+ )
68+ }
69+ ] ,
70+ resourceType : 'Bundle'
71+ )
72+ end
73+
74+ let ( :fhir_bundle_deanne_gleichner ) do
75+ FHIR ::Bundle . new (
76+ type : 'collection' ,
77+ entry : [
78+ {
79+ fullUrl : 'resource:0' ,
80+ resource : FHIR ::Patient . new (
81+ name : [
82+ {
83+ family : 'Gleichner' ,
84+ given : [
85+ 'Deanne'
86+ ]
87+ }
88+ ] ,
89+ birthDate : '2007-04-11' ,
90+ resourceType : 'Patient'
91+ )
92+ } ,
93+ {
94+ fullUrl : 'resource:1' ,
95+ resource : FHIR ::Immunization . new (
96+ status : 'completed' ,
97+ vaccineCode : {
98+ coding : [
99+ {
100+ system : 'http://hl7.org/fhir/sid/cvx' ,
101+ code : '210'
102+ }
103+ ]
104+ } ,
105+ patient : {
106+ reference : 'resource:0'
107+ } ,
108+ occurrenceDateTime : '2025-02-04' ,
109+ lotNumber : '1234567' ,
110+ resourceType : 'Immunization'
111+ )
112+ }
113+ ] ,
114+ resourceType : 'Bundle'
115+ )
116+ end
32117
33118 before do
34119 stub_request ( :post , "https://example.com/validatorapi/validate" )
35120 . to_return ( status : 200 , body : operation_outcome_success . to_json )
36121 end
37122
38- #TODO: update text with specific bundle type
39- it 'passes if the JWS payload conforms to the FHIR Bundle profile' do
40- credential_strings = 'eyJ6aXAiOiJERUYiLCJhbGciOiJFUzI1NiIsImtpZCI6IjRIVWIyYXJ2aFRTWHNzRW9NczJHNVRvRHBzWXZzajdoNXdUXzN6TkV0dWcifQ.hVLLjtQwEPyX5pqHk5nMI0fggoQAwcIFzcFxOhMjx45sJ2JY5d9pJ7tktLuz5BLZrq6uqu57kM5BCa33fZmmygiuWuN8uWGMQQS6aqDM9hu22xd5nkUwCijvwV96hPLnXOaoznXc-ha58m0iuK3dm-UQhwPR3MYJM8o6O76KkV03aPmHe2k0nCIQFmvUXnL1bah-ofBBUtNK-wOtC5gStglLMiINt28HXStcZYMwSlFVQEZARPZCXohhUOq7VQSw6MxgBZYhgsdDINC8wwXLO6moDD5y62aesxxRh0y-ctEiNYDTRForSWbecx_6ZsddFrMszo9XtHeLpi_kjqTANEUvKsmeKHGe-8HNZrpeoccQ88iFkBrfmXrGCFNLfZ71uovz2K2DbtU-MfachnxSJ-tUjL-JQMyVkLMDTKcpgv5BFZFZbNCiDt2v8yGQEWKw81PweSe7hSLfxhkju0SrjP80dBXaEEK-2Ra7_fMEPlxP-VYM-a0YGqm5-ufgVe_KSC2C-9VwwYrtId4vpt26VLdNY9OEFRpf8pwV8yzUME-CV4r-xNH7_whz2nRYJ1I3JnUkYJ3Hjm0OBWPHReCT4D5XDu34mNvp2fvD_k_0_QU.-jNkrXCHlq75fLCGvD8_7eF4iQ-XYQT7uZyiZ1Fqa33-ZQA1-aVEk519JZYGMDdJpO-mVqIC20Xh9sBsD8COzg'
41- result = run ( test , { file_download_url : url , url : url , credential_strings : credential_strings } )
123+ it 'passes if the input is an array with a single bundle conforms to the FHIR Bundle profile' do
124+ fhir_bundles = [ fhir_bundle_corrina_rowe ] . to_json
125+ result = run ( test , { file_download_url : url , url : url , fhir_bundles : fhir_bundles } )
42126 expect ( result . result ) . to eq ( 'pass' )
43127 end
44128
45- it 'passes if a comma-separated list of VCs all contain JWS payloads that conform to the FHIR Bundle profile' do
46- credential_strings = 'eyJ6aXAiOiJERUYiLCJhbGciOiJFUzI1NiIsImtpZCI6IjRIVWIyYXJ2aFRTWHNzRW9NczJHNVRvRHBzWXZzajdoNXdUXzN6TkV0dWcifQ.hVLLjtQwEPyX5pqHk5nMI0fggoQAwcIFzcFxOhMjx45sJ2JY5d9pJ7tktLuz5BLZrq6uqu57kM5BCa33fZmmygiuWuN8uWGMQQS6aqDM9hu22xd5nkUwCijvwV96hPLnXOaoznXc-ha58m0iuK3dm-UQhwPR3MYJM8o6O76KkV03aPmHe2k0nCIQFmvUXnL1bah-ofBBUtNK-wOtC5gStglLMiINt28HXStcZYMwSlFVQEZARPZCXohhUOq7VQSw6MxgBZYhgsdDINC8wwXLO6moDD5y62aesxxRh0y-ctEiNYDTRForSWbecx_6ZsddFrMszo9XtHeLpi_kjqTANEUvKsmeKHGe-8HNZrpeoccQ88iFkBrfmXrGCFNLfZ71uovz2K2DbtU-MfachnxSJ-tUjL-JQMyVkLMDTKcpgv5BFZFZbNCiDt2v8yGQEWKw81PweSe7hSLfxhkju0SrjP80dBXaEEK-2Ra7_fMEPlxP-VYM-a0YGqm5-ufgVe_KSC2C-9VwwYrtId4vpt26VLdNY9OEFRpf8pwV8yzUME-CV4r-xNH7_whz2nRYJ1I3JnUkYJ3Hjm0OBWPHReCT4D5XDu34mNvp2fvD_k_0_QU.-jNkrXCHlq75fLCGvD8_7eF4iQ-XYQT7uZyiZ1Fqa33-ZQA1-aVEk519JZYGMDdJpO-mVqIC20Xh9sBsD8COzg,eyJ6aXAiOiJERUYiLCJhbGciOiJFUzI1NiIsImtpZCI6IjRIVWIyYXJ2aFRTWHNzRW9NczJHNVRvRHBzWXZzajdoNXdUXzN6TkV0dWcifQ.fZDBTsMwEET_ZbkmaUJatfURVT0jFbigHhxnWxs5drV2IoUq_866oUJCAt_WfjOe2SuYEECAjvEiFgvrlbTahyjqsiwhA9ecQFTruqrrzWa1zGBQIK4QxwuCeL_JAutCJylqlDbqQklqw8M85Glgm7855QfTVtt_GdN1vTOfMhrv4JiBImzRRSPtoW8-UMUU6aQNvSGFxAhYFmVRsWm6fepda_EnNihvLasSmQEb0chd2KG39pUsA4TB96RQpBXch2TgZIczKztjWQZ7EzQSY2czoEs7OXiSo4TjxEkbw1V2MqZfq-3jKi_X-a3s3fRlTvTM3TgITEn06-07_sTnCw.pYwsdxlzdXVhnPzO_YDlMXnSHHz88XA3A9bGuzutySq2v3tO5lOWsfsOQGhoWiH7LCtUNpoizX5GSi5cXVI19g'
47- result = run ( test , { file_download_url : url , url : url , credential_strings : credential_strings } )
48-
129+ it 'passes if the input is an array of multiple bundles that all conform to the FHIR Bundle profile' do
130+ fhir_bundles = [
131+ fhir_bundle_corrina_rowe ,
132+ fhir_bundle_deanne_gleichner
133+ ] . to_json
134+ result = run ( test , { file_download_url : url , url : url , fhir_bundles : fhir_bundles } )
49135 expect ( result . result ) . to eq ( 'pass' )
50136 end
51137
52- it 'raises an error if the JWS payload does not conform to the FHIR Bundle profile ' do
53- credential_strings = 'asdf'
54- expect { result = run ( test , { file_download_url : url , url : url , credential_strings : credential_strings } ) } . to raise_error ( )
138+ it 'skips if the no FHIR bundles received ' do
139+ result = run ( test , { file_download_url : url , url : url , fhir_bundles : [ ] . to_json } )
140+ expect ( result . result ) . to eq ( 'skip' )
55141 end
56142
57143 end
58-
59144end
0 commit comments