auscvdrisk_inferno 0.1.0 → 0.2.0
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 +4 -4
 - data/lib/auscvdrisk/prepop/diagnoses.rb +29 -4
 - data/lib/auscvdrisk/prepop/medications.rb +117 -12
 - data/lib/auscvdrisk/prepop/observations.rb +62 -4
 - data/lib/auscvdrisk/version.rb +1 -1
 - metadata +9 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: af0e1c12464e7a600252f0ae14e61e5f7f0e3684d70c5e0fb7a013fbe28bd4b0
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 368b1e767db1d8a1645ea6f62e7d79ce71377f51940aebc281bb038054cc7615
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7abc3d9f30144276281d695463190a2a9df924892fdd97ed0300ba9469b9c3e116155f94caedc0649b19f246277657464338b191876bb1f8027ca66e8d41cf07
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 6b2a7a22035af48f5ff43b8830ad49a962f40fe25da07991130ece8126dd6e1788b69d08fc0a08d985e9a057c0ab4d0ecb1072bff9abf753cdf7d32a1273dfae
         
     | 
| 
         @@ -38,7 +38,6 @@ module AusCVDRisk 
     | 
|
| 
       38 
38 
     | 
    
         
             
                  end
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
                  test do
         
     | 
| 
       41 
     | 
    
         
            -
                    optional
         
     | 
| 
       42 
41 
     | 
    
         
             
                    title 'Server declares support for Condition patient search parameter'
         
     | 
| 
       43 
42 
     | 
    
         
             
                    description %(
         
     | 
| 
       44 
43 
     | 
    
         
             
                    The server should declare support for the Condition patient search parameter
         
     | 
| 
         @@ -141,11 +140,37 @@ module AusCVDRisk 
     | 
|
| 
       141 
140 
     | 
    
         
             
                    end
         
     | 
| 
       142 
141 
     | 
    
         
             
                  end
         
     | 
| 
       143 
142 
     | 
    
         | 
| 
      
 143 
     | 
    
         
            +
                  test do
         
     | 
| 
      
 144 
     | 
    
         
            +
                    title 'Server declares support for Condition patient+category search parameters'
         
     | 
| 
      
 145 
     | 
    
         
            +
                    description %(
         
     | 
| 
      
 146 
     | 
    
         
            +
                    The server SHALL declare support for the combined Condition search parameters
         
     | 
| 
      
 147 
     | 
    
         
            +
                    (patient+category) as specified in the Aus CVD Risk Calculator Launch Server CapabilityStatement.
         
     | 
| 
      
 148 
     | 
    
         
            +
                  )
         
     | 
| 
      
 149 
     | 
    
         
            +
             
     | 
| 
      
 150 
     | 
    
         
            +
                    run do
         
     | 
| 
      
 151 
     | 
    
         
            +
                      fhir_get_capability_statement
         
     | 
| 
      
 152 
     | 
    
         
            +
             
     | 
| 
      
 153 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 154 
     | 
    
         
            +
                      assert_resource_type(:capability_statement)
         
     | 
| 
      
 155 
     | 
    
         
            +
                      capability_statement = resource
         
     | 
| 
      
 156 
     | 
    
         
            +
             
     | 
| 
      
 157 
     | 
    
         
            +
                      resource_type = 'Condition'
         
     | 
| 
      
 158 
     | 
    
         
            +
                      required_params = %w[patient category]
         
     | 
| 
      
 159 
     | 
    
         
            +
                      combined_params = 'patient+category'
         
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
                      if check_search_combination_support(capability_statement, resource_type, required_params)
         
     | 
| 
      
 162 
     | 
    
         
            +
                        pass "Server declares support for combined Condition search parameters: #{combined_params}"
         
     | 
| 
      
 163 
     | 
    
         
            +
                      else
         
     | 
| 
      
 164 
     | 
    
         
            +
                        assert false, "Server does not declare support for required combined Condition search parameters: #{combined_params}"
         
     | 
| 
      
 165 
     | 
    
         
            +
                      end
         
     | 
| 
      
 166 
     | 
    
         
            +
                    end
         
     | 
| 
      
 167 
     | 
    
         
            +
                  end
         
     | 
| 
      
 168 
     | 
    
         
            +
             
     | 
| 
       144 
169 
     | 
    
         
             
                  test do
         
     | 
| 
       145 
170 
     | 
    
         
             
                    optional
         
     | 
| 
       146 
     | 
    
         
            -
                    title 'Server declares support for Condition  
     | 
| 
      
 171 
     | 
    
         
            +
                    title 'Server declares support for Condition patient+clinical-status+category+_sort search parameters'
         
     | 
| 
       147 
172 
     | 
    
         
             
                    description %(
         
     | 
| 
       148 
     | 
    
         
            -
                    The server  
     | 
| 
      
 173 
     | 
    
         
            +
                    The server MAY declare support for the combined Condition search parameters
         
     | 
| 
       149 
174 
     | 
    
         
             
                    (patient+clinical-status+category+_sort) as specified in the Aus CVD Risk Calculator Launch Server CapabilityStatement.
         
     | 
| 
       150 
175 
     | 
    
         
             
                  )
         
     | 
| 
       151 
176 
     | 
    
         | 
| 
         @@ -163,7 +188,7 @@ module AusCVDRisk 
     | 
|
| 
       163 
188 
     | 
    
         
             
                      if check_search_combination_support(capability_statement, resource_type, required_params)
         
     | 
| 
       164 
189 
     | 
    
         
             
                        pass "Server declares support for combined Condition search parameters: #{combined_params}"
         
     | 
| 
       165 
190 
     | 
    
         
             
                      else
         
     | 
| 
       166 
     | 
    
         
            -
                         
     | 
| 
      
 191 
     | 
    
         
            +
                        warning "Server does not declare support for optional combined Condition search parameters: #{combined_params}"
         
     | 
| 
       167 
192 
     | 
    
         
             
                      end
         
     | 
| 
       168 
193 
     | 
    
         
             
                    end
         
     | 
| 
       169 
194 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -113,11 +113,64 @@ module AusCVDRisk 
     | 
|
| 
       113 
113 
     | 
    
         
             
                    end
         
     | 
| 
       114 
114 
     | 
    
         
             
                  end
         
     | 
| 
       115 
115 
     | 
    
         | 
| 
      
 116 
     | 
    
         
            +
                  test do
         
     | 
| 
      
 117 
     | 
    
         
            +
                    title 'Server declares support for MedicationRequest patient+status search parameters'
         
     | 
| 
      
 118 
     | 
    
         
            +
                    description %(
         
     | 
| 
      
 119 
     | 
    
         
            +
                    The server SHALL declare support for the combined MedicationRequest search parameters
         
     | 
| 
      
 120 
     | 
    
         
            +
                    (patient+status) as specified in the Aus CVD Risk Calculator Launch Server CapabilityStatement.
         
     | 
| 
      
 121 
     | 
    
         
            +
                  )
         
     | 
| 
      
 122 
     | 
    
         
            +
             
     | 
| 
      
 123 
     | 
    
         
            +
                    run do
         
     | 
| 
      
 124 
     | 
    
         
            +
                      fhir_get_capability_statement
         
     | 
| 
      
 125 
     | 
    
         
            +
             
     | 
| 
      
 126 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 127 
     | 
    
         
            +
                      assert_resource_type(:capability_statement)
         
     | 
| 
      
 128 
     | 
    
         
            +
                      capability_statement = resource
         
     | 
| 
      
 129 
     | 
    
         
            +
             
     | 
| 
      
 130 
     | 
    
         
            +
                      resource_type = 'MedicationRequest'
         
     | 
| 
      
 131 
     | 
    
         
            +
                      required_params = %w[patient status]
         
     | 
| 
      
 132 
     | 
    
         
            +
                      combined_params = 'patient+status'
         
     | 
| 
      
 133 
     | 
    
         
            +
             
     | 
| 
      
 134 
     | 
    
         
            +
                      if check_search_combination_support(capability_statement, resource_type, required_params)
         
     | 
| 
      
 135 
     | 
    
         
            +
                        pass "Server declares support for combined MedicationRequest search parameters: #{combined_params}"
         
     | 
| 
      
 136 
     | 
    
         
            +
                      else
         
     | 
| 
      
 137 
     | 
    
         
            +
                        assert false, "Server does not declare support for required combined MedicationRequest search parameters: #{combined_params}"
         
     | 
| 
      
 138 
     | 
    
         
            +
                      end
         
     | 
| 
      
 139 
     | 
    
         
            +
                    end
         
     | 
| 
      
 140 
     | 
    
         
            +
                  end
         
     | 
| 
      
 141 
     | 
    
         
            +
             
     | 
| 
      
 142 
     | 
    
         
            +
                  test do
         
     | 
| 
      
 143 
     | 
    
         
            +
                    optional
         
     | 
| 
      
 144 
     | 
    
         
            +
                    title 'Server declares support for MedicationRequest patient+status+_include search parameters'
         
     | 
| 
      
 145 
     | 
    
         
            +
                    description %(
         
     | 
| 
      
 146 
     | 
    
         
            +
                    The server SHOULD declare support for the combined MedicationRequest search parameters
         
     | 
| 
      
 147 
     | 
    
         
            +
                    (patient+status+_include) as specified in the Aus CVD Risk Calculator Launch Server CapabilityStatement.
         
     | 
| 
      
 148 
     | 
    
         
            +
                  )
         
     | 
| 
      
 149 
     | 
    
         
            +
             
     | 
| 
      
 150 
     | 
    
         
            +
                    run do
         
     | 
| 
      
 151 
     | 
    
         
            +
                      fhir_get_capability_statement
         
     | 
| 
      
 152 
     | 
    
         
            +
             
     | 
| 
      
 153 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 154 
     | 
    
         
            +
                      assert_resource_type(:capability_statement)
         
     | 
| 
      
 155 
     | 
    
         
            +
                      capability_statement = resource
         
     | 
| 
      
 156 
     | 
    
         
            +
             
     | 
| 
      
 157 
     | 
    
         
            +
                      resource_type = 'MedicationRequest'
         
     | 
| 
      
 158 
     | 
    
         
            +
                      required_params = %w[patient status _include]
         
     | 
| 
      
 159 
     | 
    
         
            +
                      combined_params = 'patient+status+_include'
         
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
                      if check_search_combination_support(capability_statement, resource_type, required_params)
         
     | 
| 
      
 162 
     | 
    
         
            +
                        pass "Server declares support for combined MedicationRequest search parameters: #{combined_params}"
         
     | 
| 
      
 163 
     | 
    
         
            +
                      else
         
     | 
| 
      
 164 
     | 
    
         
            +
                        warning "Server does not declare support for recommended combined MedicationRequest search parameters: #{combined_params}"
         
     | 
| 
      
 165 
     | 
    
         
            +
                      end
         
     | 
| 
      
 166 
     | 
    
         
            +
                    end
         
     | 
| 
      
 167 
     | 
    
         
            +
                  end
         
     | 
| 
      
 168 
     | 
    
         
            +
             
     | 
| 
       116 
169 
     | 
    
         
             
                  test do
         
     | 
| 
       117 
170 
     | 
    
         
             
                    optional
         
     | 
| 
       118 
     | 
    
         
            -
                    title 'Server declares support for MedicationRequest  
     | 
| 
      
 171 
     | 
    
         
            +
                    title 'Server declares support for MedicationRequest patient+status+intent search parameters'
         
     | 
| 
       119 
172 
     | 
    
         
             
                    description %(
         
     | 
| 
       120 
     | 
    
         
            -
                    The server  
     | 
| 
      
 173 
     | 
    
         
            +
                    The server MAY declare support for the combined MedicationRequest search parameters
         
     | 
| 
       121 
174 
     | 
    
         
             
                    (patient+status+intent) as specified in the Aus CVD Risk Calculator Launch Server CapabilityStatement.
         
     | 
| 
       122 
175 
     | 
    
         
             
                  )
         
     | 
| 
       123 
176 
     | 
    
         | 
| 
         @@ -135,16 +188,16 @@ module AusCVDRisk 
     | 
|
| 
       135 
188 
     | 
    
         
             
                      if check_search_combination_support(capability_statement, resource_type, required_params)
         
     | 
| 
       136 
189 
     | 
    
         
             
                        pass "Server declares support for combined MedicationRequest search parameters: #{combined_params}"
         
     | 
| 
       137 
190 
     | 
    
         
             
                      else
         
     | 
| 
       138 
     | 
    
         
            -
                         
     | 
| 
      
 191 
     | 
    
         
            +
                        warning "Server does not declare support for optional combined MedicationRequest search parameters: #{combined_params}"
         
     | 
| 
       139 
192 
     | 
    
         
             
                      end
         
     | 
| 
       140 
193 
     | 
    
         
             
                    end
         
     | 
| 
       141 
194 
     | 
    
         
             
                  end
         
     | 
| 
       142 
195 
     | 
    
         | 
| 
       143 
196 
     | 
    
         
             
                  test do
         
     | 
| 
       144 
197 
     | 
    
         
             
                    optional
         
     | 
| 
       145 
     | 
    
         
            -
                    title 'Server declares support for MedicationRequest  
     | 
| 
      
 198 
     | 
    
         
            +
                    title 'Server declares support for MedicationRequest patient+status+intent+_include search parameters'
         
     | 
| 
       146 
199 
     | 
    
         
             
                    description %(
         
     | 
| 
       147 
     | 
    
         
            -
                    The server  
     | 
| 
      
 200 
     | 
    
         
            +
                    The server MAY declare support for the combined MedicationRequest search parameters
         
     | 
| 
       148 
201 
     | 
    
         
             
                    (patient+status+intent+_include) as specified in the Aus CVD Risk Calculator Launch Server CapabilityStatement.
         
     | 
| 
       149 
202 
     | 
    
         
             
                  )
         
     | 
| 
       150 
203 
     | 
    
         | 
| 
         @@ -160,9 +213,9 @@ module AusCVDRisk 
     | 
|
| 
       160 
213 
     | 
    
         
             
                      combined_params = 'patient+status+intent+_include'
         
     | 
| 
       161 
214 
     | 
    
         | 
| 
       162 
215 
     | 
    
         
             
                      if check_search_combination_support(capability_statement, resource_type, required_params)
         
     | 
| 
       163 
     | 
    
         
            -
                        pass "Server declares support for combined MedicationRequest search parameters 
     | 
| 
      
 216 
     | 
    
         
            +
                        pass "Server declares support for combined MedicationRequest search parameters: #{combined_params}"
         
     | 
| 
       164 
217 
     | 
    
         
             
                      else
         
     | 
| 
       165 
     | 
    
         
            -
                         
     | 
| 
      
 218 
     | 
    
         
            +
                        warning "Server does not declare support for optional combined MedicationRequest search parameters: #{combined_params}"
         
     | 
| 
       166 
219 
     | 
    
         
             
                      end
         
     | 
| 
       167 
220 
     | 
    
         
             
                    end
         
     | 
| 
       168 
221 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -260,9 +313,61 @@ module AusCVDRisk 
     | 
|
| 
       260 
313 
     | 
    
         
             
                    end
         
     | 
| 
       261 
314 
     | 
    
         
             
                  end
         
     | 
| 
       262 
315 
     | 
    
         | 
| 
      
 316 
     | 
    
         
            +
                  test do
         
     | 
| 
      
 317 
     | 
    
         
            +
                    title 'MedicationRequest search with patient+status parameters is successful'
         
     | 
| 
      
 318 
     | 
    
         
            +
             
     | 
| 
      
 319 
     | 
    
         
            +
                    run do
         
     | 
| 
      
 320 
     | 
    
         
            +
                      fhir_read(:patient, patient_id)
         
     | 
| 
      
 321 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 322 
     | 
    
         
            +
             
     | 
| 
      
 323 
     | 
    
         
            +
                      search_params = "status=active,completed&patient=#{patient_id}"
         
     | 
| 
      
 324 
     | 
    
         
            +
             
     | 
| 
      
 325 
     | 
    
         
            +
                      fhir_search(:medication_request, params: {
         
     | 
| 
      
 326 
     | 
    
         
            +
                        status: 'active,completed',
         
     | 
| 
      
 327 
     | 
    
         
            +
                        patient: patient_id
         
     | 
| 
      
 328 
     | 
    
         
            +
                      })
         
     | 
| 
      
 329 
     | 
    
         
            +
             
     | 
| 
      
 330 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 331 
     | 
    
         
            +
                      bundle = JSON.parse(response[:body])
         
     | 
| 
      
 332 
     | 
    
         
            +
                      verify_search_parameters_in_self_link(bundle, search_params)
         
     | 
| 
      
 333 
     | 
    
         
            +
                      pass 'Successfully searched for MedicationRequests with patient+status parameters'
         
     | 
| 
      
 334 
     | 
    
         
            +
                    end
         
     | 
| 
      
 335 
     | 
    
         
            +
                  end
         
     | 
| 
      
 336 
     | 
    
         
            +
             
     | 
| 
      
 337 
     | 
    
         
            +
                  test do
         
     | 
| 
      
 338 
     | 
    
         
            +
                    optional
         
     | 
| 
      
 339 
     | 
    
         
            +
                    title 'MedicationRequest search with patient+status+_include parameters is successful'
         
     | 
| 
      
 340 
     | 
    
         
            +
             
     | 
| 
      
 341 
     | 
    
         
            +
                    run do
         
     | 
| 
      
 342 
     | 
    
         
            +
                      fhir_read(:patient, patient_id)
         
     | 
| 
      
 343 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 344 
     | 
    
         
            +
             
     | 
| 
      
 345 
     | 
    
         
            +
                      search_params = "_include=MedicationRequest:medication&status=active,completed&patient=#{patient_id}"
         
     | 
| 
      
 346 
     | 
    
         
            +
             
     | 
| 
      
 347 
     | 
    
         
            +
                      fhir_search(:medication_request, params: {
         
     | 
| 
      
 348 
     | 
    
         
            +
                        _include: 'MedicationRequest:medication',
         
     | 
| 
      
 349 
     | 
    
         
            +
                        status: 'active,completed',
         
     | 
| 
      
 350 
     | 
    
         
            +
                        patient: patient_id
         
     | 
| 
      
 351 
     | 
    
         
            +
                      })
         
     | 
| 
      
 352 
     | 
    
         
            +
             
     | 
| 
      
 353 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 354 
     | 
    
         
            +
                      bundle = JSON.parse(response[:body])
         
     | 
| 
      
 355 
     | 
    
         
            +
                      verify_search_parameters_in_self_link(bundle, search_params)
         
     | 
| 
      
 356 
     | 
    
         
            +
             
     | 
| 
      
 357 
     | 
    
         
            +
                      # Check if any Medication resources are included in the bundle
         
     | 
| 
      
 358 
     | 
    
         
            +
                      medication_entries = bundle['entry']&.select { |entry| entry['resource']['resourceType'] == 'Medication' }
         
     | 
| 
      
 359 
     | 
    
         
            +
             
     | 
| 
      
 360 
     | 
    
         
            +
                      if medication_entries&.any?
         
     | 
| 
      
 361 
     | 
    
         
            +
                        pass 'Successfully searched for MedicationRequests with patient+status+_include parameters and found included Medication resources'
         
     | 
| 
      
 362 
     | 
    
         
            +
                      else
         
     | 
| 
      
 363 
     | 
    
         
            +
                        warning 'Successfully searched with patient+status+_include parameters but no Medication resources were included in the response'
         
     | 
| 
      
 364 
     | 
    
         
            +
                      end
         
     | 
| 
      
 365 
     | 
    
         
            +
                    end
         
     | 
| 
      
 366 
     | 
    
         
            +
                  end
         
     | 
| 
      
 367 
     | 
    
         
            +
             
     | 
| 
       263 
368 
     | 
    
         
             
                  test do
         
     | 
| 
       264 
369 
     | 
    
         
             
                    optional
         
     | 
| 
       265 
     | 
    
         
            -
                    title 'MedicationRequest search with  
     | 
| 
      
 370 
     | 
    
         
            +
                    title 'MedicationRequest search with patient+status+intent parameters is successful'
         
     | 
| 
       266 
371 
     | 
    
         | 
| 
       267 
372 
     | 
    
         
             
                    run do
         
     | 
| 
       268 
373 
     | 
    
         
             
                      fhir_read(:patient, patient_id)
         
     | 
| 
         @@ -279,13 +384,13 @@ module AusCVDRisk 
     | 
|
| 
       279 
384 
     | 
    
         
             
                      assert_response_status(200)
         
     | 
| 
       280 
385 
     | 
    
         
             
                      bundle = JSON.parse(response[:body])
         
     | 
| 
       281 
386 
     | 
    
         
             
                      verify_search_parameters_in_self_link(bundle, search_params)
         
     | 
| 
       282 
     | 
    
         
            -
                      pass 'Successfully searched for MedicationRequests with  
     | 
| 
      
 387 
     | 
    
         
            +
                      pass 'Successfully searched for MedicationRequests with patient+status+intent parameters'
         
     | 
| 
       283 
388 
     | 
    
         
             
                    end
         
     | 
| 
       284 
389 
     | 
    
         
             
                  end
         
     | 
| 
       285 
390 
     | 
    
         | 
| 
       286 
391 
     | 
    
         
             
                  test do
         
     | 
| 
       287 
392 
     | 
    
         
             
                    optional
         
     | 
| 
       288 
     | 
    
         
            -
                    title 'MedicationRequest search with  
     | 
| 
      
 393 
     | 
    
         
            +
                    title 'MedicationRequest search with patient+status+intent+_include parameters is successful'
         
     | 
| 
       289 
394 
     | 
    
         | 
| 
       290 
395 
     | 
    
         
             
                    run do
         
     | 
| 
       291 
396 
     | 
    
         
             
                      fhir_read(:patient, patient_id)
         
     | 
| 
         @@ -308,9 +413,9 @@ module AusCVDRisk 
     | 
|
| 
       308 
413 
     | 
    
         
             
                      medication_entries = bundle['entry']&.select { |entry| entry['resource']['resourceType'] == 'Medication' }
         
     | 
| 
       309 
414 
     | 
    
         | 
| 
       310 
415 
     | 
    
         
             
                      if medication_entries&.any?
         
     | 
| 
       311 
     | 
    
         
            -
                        pass 'Successfully searched for MedicationRequests with  
     | 
| 
      
 416 
     | 
    
         
            +
                        pass 'Successfully searched for MedicationRequests with patient+status+intent+_include parameters and found included Medication resources'
         
     | 
| 
       312 
417 
     | 
    
         
             
                      else
         
     | 
| 
       313 
     | 
    
         
            -
                         
     | 
| 
      
 418 
     | 
    
         
            +
                        warning 'Successfully searched with patient+status+intent+_include parameters but no Medication resources were included in the response'
         
     | 
| 
       314 
419 
     | 
    
         
             
                      end
         
     | 
| 
       315 
420 
     | 
    
         
             
                    end
         
     | 
| 
       316 
421 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -130,9 +130,39 @@ module AusCVDRisk 
     | 
|
| 
       130 
130 
     | 
    
         
             
                    end
         
     | 
| 
       131 
131 
     | 
    
         
             
                  end
         
     | 
| 
       132 
132 
     | 
    
         | 
| 
      
 133 
     | 
    
         
            +
                  test do
         
     | 
| 
      
 134 
     | 
    
         
            +
                    title 'Server declares support for Observation patient+code search parameters'
         
     | 
| 
      
 135 
     | 
    
         
            +
                    description %(
         
     | 
| 
      
 136 
     | 
    
         
            +
                    The server SHALL declare support for the combined Observation search parameters
         
     | 
| 
      
 137 
     | 
    
         
            +
                    (patient+code) as specified in the Aus CVD Risk Calculator Launch Server CapabilityStatement.
         
     | 
| 
      
 138 
     | 
    
         
            +
                  )
         
     | 
| 
      
 139 
     | 
    
         
            +
             
     | 
| 
      
 140 
     | 
    
         
            +
                    run do
         
     | 
| 
      
 141 
     | 
    
         
            +
                      fhir_get_capability_statement
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 144 
     | 
    
         
            +
                      assert_resource_type(:capability_statement)
         
     | 
| 
      
 145 
     | 
    
         
            +
                      capability_statement = resource
         
     | 
| 
      
 146 
     | 
    
         
            +
             
     | 
| 
      
 147 
     | 
    
         
            +
                      resource_type = 'Observation'
         
     | 
| 
      
 148 
     | 
    
         
            +
                      required_params = %w[patient code]
         
     | 
| 
      
 149 
     | 
    
         
            +
                      combined_params = 'patient+code'
         
     | 
| 
      
 150 
     | 
    
         
            +
             
     | 
| 
      
 151 
     | 
    
         
            +
                      if check_search_combination_support(capability_statement, resource_type, required_params)
         
     | 
| 
      
 152 
     | 
    
         
            +
                        pass "Server declares support for combined Observation search parameters: #{combined_params}"
         
     | 
| 
      
 153 
     | 
    
         
            +
                      else
         
     | 
| 
      
 154 
     | 
    
         
            +
                        assert false, "Server does not declare support for required combined Observation search parameters: #{combined_params}"
         
     | 
| 
      
 155 
     | 
    
         
            +
                      end
         
     | 
| 
      
 156 
     | 
    
         
            +
                    end
         
     | 
| 
      
 157 
     | 
    
         
            +
                  end
         
     | 
| 
      
 158 
     | 
    
         
            +
             
     | 
| 
       133 
159 
     | 
    
         
             
                  test do
         
     | 
| 
       134 
160 
     | 
    
         
             
                    optional
         
     | 
| 
       135 
     | 
    
         
            -
                    title 'Server declares support for Observation  
     | 
| 
      
 161 
     | 
    
         
            +
                    title 'Server declares support for Observation patient+code+status+_count+_sort search parameters'
         
     | 
| 
      
 162 
     | 
    
         
            +
                    description %(
         
     | 
| 
      
 163 
     | 
    
         
            +
                    The server MAY declare support for the combined Observation search parameters
         
     | 
| 
      
 164 
     | 
    
         
            +
                    (patient+code+status+_count+_sort) as specified in the Aus CVD Risk Calculator Launch Server CapabilityStatement.
         
     | 
| 
      
 165 
     | 
    
         
            +
                  )
         
     | 
| 
       136 
166 
     | 
    
         | 
| 
       137 
167 
     | 
    
         
             
                    run do
         
     | 
| 
       138 
168 
     | 
    
         
             
                      fhir_get_capability_statement
         
     | 
| 
         @@ -148,7 +178,7 @@ module AusCVDRisk 
     | 
|
| 
       148 
178 
     | 
    
         
             
                      if check_search_combination_support(capability_statement, resource_type, required_params)
         
     | 
| 
       149 
179 
     | 
    
         
             
                        pass "Server declares support for combined Observation search parameters: #{combined_params}"
         
     | 
| 
       150 
180 
     | 
    
         
             
                      else
         
     | 
| 
       151 
     | 
    
         
            -
                         
     | 
| 
      
 181 
     | 
    
         
            +
                        warning "Server does not declare support for optional combined Observation search parameters: #{combined_params}"
         
     | 
| 
       152 
182 
     | 
    
         
             
                      end
         
     | 
| 
       153 
183 
     | 
    
         
             
                    end
         
     | 
| 
       154 
184 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -302,9 +332,37 @@ module AusCVDRisk 
     | 
|
| 
       302 
332 
     | 
    
         
             
                    end
         
     | 
| 
       303 
333 
     | 
    
         
             
                  end
         
     | 
| 
       304 
334 
     | 
    
         | 
| 
      
 335 
     | 
    
         
            +
                  test do
         
     | 
| 
      
 336 
     | 
    
         
            +
                    title 'Observation search with patient+code parameters is successful'
         
     | 
| 
      
 337 
     | 
    
         
            +
             
     | 
| 
      
 338 
     | 
    
         
            +
                    input :patient_id,
         
     | 
| 
      
 339 
     | 
    
         
            +
                          title: 'Patient ID',
         
     | 
| 
      
 340 
     | 
    
         
            +
                          description: 'ID of a patient resource on the server'
         
     | 
| 
      
 341 
     | 
    
         
            +
             
     | 
| 
      
 342 
     | 
    
         
            +
                    run do
         
     | 
| 
      
 343 
     | 
    
         
            +
                      skip_if patient_id.blank?, 'No patient ID provided'
         
     | 
| 
      
 344 
     | 
    
         
            +
             
     | 
| 
      
 345 
     | 
    
         
            +
                      # Using LOINC code for total cholesterol as an example
         
     | 
| 
      
 346 
     | 
    
         
            +
                      code = 'http://loinc.org|2093-3'
         
     | 
| 
      
 347 
     | 
    
         
            +
             
     | 
| 
      
 348 
     | 
    
         
            +
                      search_params = "code=#{code}&patient=#{patient_id}"
         
     | 
| 
      
 349 
     | 
    
         
            +
             
     | 
| 
      
 350 
     | 
    
         
            +
                      fhir_search(:observation, params: {
         
     | 
| 
      
 351 
     | 
    
         
            +
                        code: code,
         
     | 
| 
      
 352 
     | 
    
         
            +
                        patient: patient_id
         
     | 
| 
      
 353 
     | 
    
         
            +
                      })
         
     | 
| 
      
 354 
     | 
    
         
            +
             
     | 
| 
      
 355 
     | 
    
         
            +
                      assert_response_status(200)
         
     | 
| 
      
 356 
     | 
    
         
            +
                      bundle = JSON.parse(response[:body])
         
     | 
| 
      
 357 
     | 
    
         
            +
                      verify_search_parameters_in_self_link(bundle, search_params)
         
     | 
| 
      
 358 
     | 
    
         
            +
             
     | 
| 
      
 359 
     | 
    
         
            +
                      pass 'Successfully searched for Observations with patient+code parameters'
         
     | 
| 
      
 360 
     | 
    
         
            +
                    end
         
     | 
| 
      
 361 
     | 
    
         
            +
                  end
         
     | 
| 
      
 362 
     | 
    
         
            +
             
     | 
| 
       305 
363 
     | 
    
         
             
                  test do
         
     | 
| 
       306 
364 
     | 
    
         
             
                    optional
         
     | 
| 
       307 
     | 
    
         
            -
                    title 'Observation search with  
     | 
| 
      
 365 
     | 
    
         
            +
                    title 'Observation search with patient+code+status+_count+_sort parameters is successful'
         
     | 
| 
       308 
366 
     | 
    
         | 
| 
       309 
367 
     | 
    
         
             
                    input :patient_id,
         
     | 
| 
       310 
368 
     | 
    
         
             
                          title: 'Patient ID',
         
     | 
| 
         @@ -353,7 +411,7 @@ module AusCVDRisk 
     | 
|
| 
       353 
411 
     | 
    
         
             
                        end
         
     | 
| 
       354 
412 
     | 
    
         
             
                      end
         
     | 
| 
       355 
413 
     | 
    
         | 
| 
       356 
     | 
    
         
            -
                      pass 'Successfully searched for Observations with  
     | 
| 
      
 414 
     | 
    
         
            +
                      pass 'Successfully searched for Observations with patient+code+status+_count+_sort parameters'
         
     | 
| 
       357 
415 
     | 
    
         
             
                    end
         
     | 
| 
       358 
416 
     | 
    
         
             
                  end
         
     | 
| 
       359 
417 
     | 
    
         | 
    
        data/lib/auscvdrisk/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: auscvdrisk_inferno
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Australian e-Health Research Centre, CSIRO
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       8 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       9 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       10 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-07-15 00:00:00.000000000 Z
         
     | 
| 
       11 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       12 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       13 
14 
     | 
    
         
             
              name: inferno_core
         
     | 
| 
         @@ -23,6 +24,8 @@ dependencies: 
     | 
|
| 
       23 
24 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       24 
25 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       25 
26 
     | 
    
         
             
                    version: 0.6.2
         
     | 
| 
      
 27 
     | 
    
         
            +
            description:
         
     | 
| 
      
 28 
     | 
    
         
            +
            email:
         
     | 
| 
       26 
29 
     | 
    
         
             
            executables: []
         
     | 
| 
       27 
30 
     | 
    
         
             
            extensions: []
         
     | 
| 
       28 
31 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
         @@ -42,9 +45,11 @@ files: 
     | 
|
| 
       42 
45 
     | 
    
         
             
            - lib/auscvdrisk/suite.rb
         
     | 
| 
       43 
46 
     | 
    
         
             
            - lib/auscvdrisk/version.rb
         
     | 
| 
       44 
47 
     | 
    
         
             
            - lib/auscvdrisk/write_back.rb
         
     | 
| 
      
 48 
     | 
    
         
            +
            homepage:
         
     | 
| 
       45 
49 
     | 
    
         
             
            licenses: []
         
     | 
| 
       46 
50 
     | 
    
         
             
            metadata:
         
     | 
| 
       47 
51 
     | 
    
         
             
              inferno_test_kit: 'true'
         
     | 
| 
      
 52 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       48 
53 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       49 
54 
     | 
    
         
             
            require_paths:
         
     | 
| 
       50 
55 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -59,7 +64,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       59 
64 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       60 
65 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       61 
66 
     | 
    
         
             
            requirements: []
         
     | 
| 
       62 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 67 
     | 
    
         
            +
            rubygems_version: 3.5.22
         
     | 
| 
      
 68 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       63 
69 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       64 
70 
     | 
    
         
             
            summary: Aus CVD Risk-i Test Kit
         
     | 
| 
       65 
71 
     | 
    
         
             
            test_files: []
         
     |