Class: DaVinciPASTestKit::Generator::GroupGenerator
- Inherits:
-
Object
- Object
- DaVinciPASTestKit::Generator::GroupGenerator
- Defined in:
- lib/davinci_pas_test_kit/generator/group_generator.rb
Instance Attribute Summary collapse
-
#base_output_dir ⇒ Object
Returns the value of attribute base_output_dir.
-
#first_generate ⇒ Object
Returns the value of attribute first_generate.
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#ig_metadata ⇒ Object
Returns the value of attribute ig_metadata.
-
#system ⇒ Object
Returns the value of attribute system.
-
#use_case ⇒ Object
Returns the value of attribute use_case.
Class Method Summary collapse
Instance Method Summary collapse
- #all_test_ids ⇒ Object
- #all_tests ⇒ Object
- #alt_request_input_name(use_case, request_type) ⇒ Object
- #alt_request_input_title(use_case, request_type) ⇒ Object
- #alt_test_id(id, use_case) ⇒ Object
- #approval_denial_test_file_list ⇒ Object
- #approval_denial_test_ids ⇒ Object
- #base_metadata_file_name ⇒ Object
- #base_output_file_name ⇒ Object
- #claim_response_decision_file_name ⇒ Object
- #claim_response_decision_test_id ⇒ Object
- #class_name ⇒ Object
- #client_inquiry_request_must_support_test_file_list ⇒ Object
- #client_inquiry_request_must_support_test_ids ⇒ Object
- #client_submit_request_must_support_test_file_list ⇒ Object
- #client_submit_request_must_support_test_ids ⇒ Object
- #common_test_file_list(test_ids) ⇒ Object
- #description ⇒ Object
- #generate ⇒ Object
- #group_id ⇒ Object
- #grouped_approval_denial_test_ids ⇒ Object
- #grouped_must_support_test_ids ⇒ Object
- #grouped_pended_test_ids ⇒ Object
-
#initialize(ig_metadata, use_case, groups, base_output_dir, system = 'server', first_generate = false) ⇒ GroupGenerator
constructor
A new instance of GroupGenerator.
- #inquiry_notification_test_id ⇒ Object
- #inquiry_operation_test_ids ⇒ Object
- #inquiry_request_must_support_test_ids ⇒ Object
- #inquiry_request_validation_test_ids ⇒ Object
- #inquiry_response_must_support_test_ids ⇒ Object
- #inquiry_response_validation_test_ids ⇒ Object
- #metadata_file_name(group) ⇒ Object
- #module_name ⇒ Object
- #must_support_rename_input?(test_id) ⇒ Boolean
- #must_support_test_file_list ⇒ Object
- #must_support_test_ids ⇒ Object
- #output ⇒ Object
- #output_file_name ⇒ Object
- #pas_client_must_support_test_file ⇒ Object
-
#pas_client_must_support_test_id ⇒ Object
Client tests initiation for must support: tests to allow the client to send $submit/$inquire requests in addition to any already sent in previous test groups for Inferno to evaluate coverage of must support elements.
- #pas_submit_must_support_requirement_test_file ⇒ Object
- #pas_submit_must_support_requirement_test_id ⇒ Object
- #pended_test_file_list ⇒ Object
- #pended_test_ids ⇒ Object
- #profile_identifier(group_metadata) ⇒ Object
- #rename_input?(test_id) ⇒ Boolean
- #run_as_group ⇒ Object
- #select_test_ids(include_patterns, exclude_patterns = []) ⇒ Object
- #submit_operation_test_ids ⇒ Object
- #submit_request_must_support_test_ids ⇒ Object
- #submit_request_validation_test_ids ⇒ Object
- #submit_response_must_support_test_ids ⇒ Object
- #submit_response_validation_test_ids ⇒ Object
- #subscription_notification_conformance_test_ids ⇒ Object
- #subscription_notification_file_name ⇒ Object
- #template ⇒ Object
- #test_file_list ⇒ Object
- #test_id_list ⇒ Object
- #title ⇒ Object
- #verifies_requirements ⇒ Object
Constructor Details
#initialize(ig_metadata, use_case, groups, base_output_dir, system = 'server', first_generate = false) ⇒ GroupGenerator
Returns a new instance of GroupGenerator.
25 26 27 28 29 30 31 32 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 25 def initialize(, use_case, groups, base_output_dir, system = 'server', first_generate = false) self. = self.use_case = use_case self.groups = groups self.base_output_dir = base_output_dir self.system = system self.first_generate = first_generate end |
Instance Attribute Details
#base_output_dir ⇒ Object
Returns the value of attribute base_output_dir.
23 24 25 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 23 def base_output_dir @base_output_dir end |
#first_generate ⇒ Object
Returns the value of attribute first_generate.
23 24 25 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 23 def first_generate @first_generate end |
#groups ⇒ Object
Returns the value of attribute groups.
23 24 25 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 23 def groups @groups end |
#ig_metadata ⇒ Object
Returns the value of attribute ig_metadata.
23 24 25 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 23 def @ig_metadata end |
#system ⇒ Object
Returns the value of attribute system.
23 24 25 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 23 def system @system end |
#use_case ⇒ Object
Returns the value of attribute use_case.
23 24 25 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 23 def use_case @use_case end |
Class Method Details
.generate(ig_metadata, base_output_dir) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 7 def generate(, base_output_dir) groups = .groups.select { |group| group.tests.present? }.reject do |group| group.profile_name.include?('Base') end # Server Test Groups ['approval', 'denial', 'pended', 'must_support'].each_with_index do |use_case, index| new(, use_case, groups, base_output_dir, 'server', index.zero?).generate end # Client Test Groups ['submit_must_support', 'inquiry_must_support'].each do |use_case| new(, use_case, groups, base_output_dir, 'client', false).generate end end |
Instance Method Details
#all_test_ids ⇒ Object
105 106 107 108 109 110 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 105 def all_test_ids @all_test_ids = all_tests.map { |test| test[:id] }.reject do |id| id.include?('medication_request_must_support') || id.include?('service_request_must_support') || id.include?('device_request_must_support') || id.include?('nutrition_order_must_support') end end |
#all_tests ⇒ Object
101 102 103 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 101 def all_tests @all_tests ||= groups.flat_map(&:tests).compact end |
#alt_request_input_name(use_case, request_type) ⇒ Object
343 344 345 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 343 def alt_request_input_name(use_case, request_type) "#{use_case}_pa_#{request_type}_request_payload" end |
#alt_request_input_title(use_case, request_type) ⇒ Object
347 348 349 350 351 352 353 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 347 def alt_request_input_title(use_case, request_type) if use_case == 'must_support' "Additional PAS #{request_type.capitalize} Request Payloads" else "PAS #{request_type.capitalize} Request Payload for #{use_case.capitalize} Response" end end |
#alt_test_id(id, use_case) ⇒ Object
339 340 341 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 339 def alt_test_id(id, use_case) "#{id}_#{use_case}" end |
#approval_denial_test_file_list ⇒ Object
256 257 258 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 256 def approval_denial_test_file_list common_test_file_list(approval_denial_test_ids) << claim_response_decision_file_name end |
#approval_denial_test_ids ⇒ Object
176 177 178 179 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 176 def approval_denial_test_ids submit_request_validation_test_ids + submit_operation_test_ids + submit_response_validation_test_ids + [claim_response_decision_test_id] end |
#base_metadata_file_name ⇒ Object
46 47 48 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 46 def 'metadata.yml' end |
#base_output_file_name ⇒ Object
42 43 44 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 42 def base_output_file_name "#{class_name.underscore}.rb" end |
#claim_response_decision_file_name ⇒ Object
321 322 323 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 321 def claim_response_decision_file_name "../../custom_groups/#{.ig_version}/claim_response_decision/pas_claim_response_decision_test" end |
#claim_response_decision_test_id ⇒ Object
313 314 315 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 313 def claim_response_decision_test_id 'prior_auth_claim_response_decision_validation' end |
#class_name ⇒ Object
50 51 52 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 50 def class_name "PAS#{system.capitalize}#{use_case.camelize}UseCaseGroup" end |
#client_inquiry_request_must_support_test_file_list ⇒ Object
276 277 278 279 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 276 def client_inquiry_request_must_support_test_file_list common_test_file_list(client_inquiry_request_must_support_test_ids) .push(pas_client_must_support_test_file) end |
#client_inquiry_request_must_support_test_ids ⇒ Object
153 154 155 156 157 158 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 153 def client_inquiry_request_must_support_test_ids @client_inquiry_request_must_support_test_ids ||= select_test_ids( ['inquire_request', 'must_support_test'], ['server'] ).unshift(pas_client_must_support_test_id) end |
#client_submit_request_must_support_test_file_list ⇒ Object
271 272 273 274 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 271 def client_submit_request_must_support_test_file_list common_test_file_list(client_submit_request_must_support_test_ids) .push(pas_submit_must_support_requirement_test_file, pas_client_must_support_test_file) end |
#client_submit_request_must_support_test_ids ⇒ Object
142 143 144 145 146 147 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 142 def client_submit_request_must_support_test_ids @client_submit_request_must_support_test_ids ||= select_test_ids( ['submit_request', 'must_support_test'], ['server'] ).unshift(pas_client_must_support_test_id, pas_submit_must_support_requirement_test_id) end |
#common_test_file_list(test_ids) ⇒ Object
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 240 def common_test_file_list(test_ids) test_ids.map do |id| test = all_tests.find { |t| t[:id] == id } next unless test group = groups.find { |grp| grp.tests.include?(test) } name_without_suffix = test[:file_name].delete_suffix('.rb') test_file = if name_without_suffix.start_with?('..') name_without_suffix else "#{profile_identifier(group)}/#{name_without_suffix}" end test_file end.compact end |
#description ⇒ Object
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 382 def description case system when 'server' case use_case when 'approval' <<~DESCRIPTION Demonstrate the ability of the server to respond to a prior authorization request with an `approved` decision. DESCRIPTION when 'denial' <<~DESCRIPTION Demonstrate the ability of the server to respond to a prior authorization request with a `denied` decision. DESCRIPTION when 'pended' <<~DESCRIPTION Demonstrate a complete prior authorization workflow including a period during which the final decision is pending. This includes demonstrating the ability of the server to - Respond to a prior authorization request with a `pended` status. - Accept a Subscription creation request and send a notification when the pended claim has been finalized. - Respond to a subsequent inquiry request with a final decision for the request. DESCRIPTION else # must_support <<~DESCRIPTION Demonstrate the ability of the server to support all PAS-defined profiles and the must support elements defined in them. This includes - the ability to respond to prior authorization submission and inquiry requests that contain all PAS-defined profiles and their must support elements. - the ability to include in those responses all PAS-defined profiles and their must support elements. In order to allow Inferno to observe and validate these criteria, testers are required to provide a set of `$submit` and `$inquire` requests that collectively both themselves contain and elicit server responses that contain all PAS-defined profiles and their must support elements. DESCRIPTION end when 'client' if use_case.include?('submit') <<~DESCRIPTION Check that the client can demonstrate `$submit` requests that contain all PAS-defined profiles and their must support elements. For `$submit` requests, this includes the following profiles: - [PAS Request Bundle](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-pas-request-bundle.html) - [PAS Claim Update](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-claim-update.html) - [PAS Coverage](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-coverage.html) - [PAS Beneficiary Patient](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-beneficiary.html) - [PAS Subscriber Patient](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-subscriber.html) - [PAS Insurer Organization](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-insurer.html) - [PAS Requestor Organization](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-requestor.html) - [PAS Practitioner](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-practitioner.html) - [PAS PractitionerRole](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-practitionerrole.html) - [PAS Encounter](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-encounter.html) - At least one of the following request profiles - [PAS Device Request](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-devicerequest.html) - [PAS Medication Request](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-medicationrequest.html) - [PAS Nutrition Order](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-nutritionorder.html) - [PAS Service Request](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-servicerequest.html) DESCRIPTION else # inquire <<~DESCRIPTION Check that the client can demonstrate `$inquire` requests that contain all PAS-defined profiles and their must support elements. For `$inquire` requests, this includes the following profiles: - [PAS Inquiry Request Bundle](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-pas-inquiry-request-bundle.html) - [PAS Claim Inquiry](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-claim-inquiry.html) - [PAS Coverage](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-coverage.html) - [PAS Beneficiary Patient](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-beneficiary.html) - [PAS Subscriber Patient](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-subscriber.html) - [PAS Insurer Organization](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-insurer.html) - [PAS Requestor Organization](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-requestor.html) - [PAS Practitioner](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-practitioner.html) - [PAS PractitionerRole](https://hl7.org/fhir/us/davinci-pas/STU2/StructureDefinition-profile-practitionerrole.html) DESCRIPTION end end end |
#generate ⇒ Object
91 92 93 94 95 96 97 98 99 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 91 def generate File.write(output_file_name, output) .add_use_case_groups(group_id, base_output_file_name) return unless first_generate groups.each do || File.write((), YAML.dump(.to_hash)) end end |
#group_id ⇒ Object
87 88 89 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 87 def group_id "pas_#{system}_#{groups.first.reformatted_version}_#{use_case}_use_case" end |
#grouped_approval_denial_test_ids ⇒ Object
181 182 183 184 185 186 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 181 def grouped_approval_denial_test_ids { 'Server can respond to claims submitted for prior authorization' => approval_denial_test_ids } end |
#grouped_must_support_test_ids ⇒ Object
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 215 def grouped_must_support_test_ids submit_tests = submit_request_validation_test_ids + submit_operation_test_ids + submit_response_validation_test_ids inquiry_operation = inquiry_request_validation_test_ids + inquiry_operation_test_ids + inquiry_response_validation_test_ids { '$submit Element Support' => { 'Submission of claims to the $submit operation for must support validation' => submit_tests, "[USER INPUT VALIDATION] Submit Request Must Support'" \ "\n#{' ' * 10}verifies_requirements " \ "'hl7.fhir.us.davinci-pas_2.0.1@35" => submit_request_must_support_test_ids, 'Submit Response Must Support' => submit_response_must_support_test_ids }, '$inquire Element Support' => { 'Submission of claims to the $inquire operation for must support validation' => inquiry_operation, "[USER INPUT VALIDATION] Inquiry Request Must Support'" \ "\n#{' ' * 10}verifies_requirements " \ "'hl7.fhir.us.davinci-pas_2.0.1@36" => inquiry_request_must_support_test_ids, 'Inquiry Response Must Support' => inquiry_response_must_support_test_ids } } end |
#grouped_pended_test_ids ⇒ Object
197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 197 def grouped_pended_test_ids inquiry_operation = [inquiry_notification_test_id] + subscription_notification_conformance_test_ids + inquiry_request_validation_test_ids + inquiry_operation_test_ids + inquiry_response_validation_test_ids inquiry_tests = { 'Server can notify client of updates and respond to claims submitted for inquiry' => inquiry_operation } grouped_approval_denial_test_ids.merge(inquiry_tests) end |
#inquiry_notification_test_id ⇒ Object
317 318 319 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 317 def inquiry_notification_test_id 'prior_auth_claim_response_update_notification_validation' end |
#inquiry_operation_test_ids ⇒ Object
172 173 174 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 172 def inquiry_operation_test_ids @inquiry_operation_test_ids ||= select_test_ids(['operation_test', 'inquiry']) end |
#inquiry_request_must_support_test_ids ⇒ Object
149 150 151 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 149 def inquiry_request_must_support_test_ids @inquiry_request_must_support_test_ids ||= select_test_ids(['inquire_request', 'must_support_test'], ['client']) end |
#inquiry_request_validation_test_ids ⇒ Object
124 125 126 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 124 def inquiry_request_validation_test_ids @inquiry_request_validation_test_ids ||= select_test_ids(['request', 'validation_test', 'inquiry'], ['client']) end |
#inquiry_response_must_support_test_ids ⇒ Object
164 165 166 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 164 def inquiry_response_must_support_test_ids @inquiry_response_must_support_test_ids ||= select_test_ids(['inquire_response', 'must_support_test']) end |
#inquiry_response_validation_test_ids ⇒ Object
132 133 134 135 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 132 def inquiry_response_validation_test_ids @inquiry_response_validation_test_ids ||= select_test_ids(['response', 'validation_test', 'inquiry'], ['client']) end |
#metadata_file_name(group) ⇒ Object
79 80 81 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 79 def (group) File.join(base_output_dir, profile_identifier(group), ) end |
#module_name ⇒ Object
54 55 56 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 54 def module_name "DaVinciPAS#{groups.first.reformatted_version.upcase}" end |
#must_support_rename_input?(test_id) ⇒ Boolean
334 335 336 337 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 334 def must_support_rename_input?(test_id) (test_id.include?('request') && test_id.include?('validation')) || test_id.include?('operation_test') end |
#must_support_test_file_list ⇒ Object
267 268 269 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 267 def must_support_test_file_list common_test_file_list(must_support_test_ids).push(pas_submit_must_support_requirement_test_file) end |
#must_support_test_ids ⇒ Object
210 211 212 213 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 210 def must_support_test_ids pended_test_ids + submit_request_must_support_test_ids + submit_response_must_support_test_ids + inquiry_request_must_support_test_ids + inquiry_response_must_support_test_ids end |
#output ⇒ Object
38 39 40 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 38 def output @output ||= ERB.new(template, trim_mode: '-').result(binding) end |
#output_file_name ⇒ Object
75 76 77 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 75 def output_file_name File.join(base_output_dir, base_output_file_name) end |
#pas_client_must_support_test_file ⇒ Object
370 371 372 373 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 370 def pas_client_must_support_test_file request_type = use_case.include?('submit') ? 'submit' : 'inquire' "../../custom_groups/#{.ig_version}/client_tests/pas_client_#{request_type}_must_support_test" end |
#pas_client_must_support_test_id ⇒ Object
Client tests initiation for must support: tests to allow the client to send $submit/$inquire requests in addition to any already sent in previous test groups for Inferno to evaluate coverage of must support elements.
365 366 367 368 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 365 def pas_client_must_support_test_id request_type = use_case.include?('submit') ? 'submit' : 'inquire' "pas_client_#{request_type}_#{.reformatted_version}_must_support_test" end |
#pas_submit_must_support_requirement_test_file ⇒ Object
359 360 361 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 359 def pas_submit_must_support_requirement_test_file "../../custom_groups/#{.ig_version}/must_support/pas_#{system}_must_support_requirement_test" end |
#pas_submit_must_support_requirement_test_id ⇒ Object
355 356 357 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 355 def pas_submit_must_support_requirement_test_id "pas_#{system}_submit_#{.reformatted_version}_must_support_requirement" end |
#pended_test_file_list ⇒ Object
260 261 262 263 264 265 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 260 def pended_test_file_list common_test_file_list(pended_test_ids).push( claim_response_decision_file_name, subscription_notification_file_name ) end |
#pended_test_ids ⇒ Object
188 189 190 191 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 188 def pended_test_ids approval_denial_test_ids + inquiry_request_validation_test_ids + inquiry_operation_test_ids + inquiry_response_validation_test_ids end |
#profile_identifier(group_metadata) ⇒ Object
83 84 85 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 83 def profile_identifier() Naming.snake_case_for_profile() end |
#rename_input?(test_id) ⇒ Boolean
329 330 331 332 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 329 def rename_input?(test_id) (test_id.include?('request') && test_id.include?('validation') && !test_id.include?('inquiry')) || test_id.include?('operation_test') end |
#run_as_group ⇒ Object
69 70 71 72 73 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 69 def run_as_group return false if use_case.include?('must_support') && system == 'server' true end |
#select_test_ids(include_patterns, exclude_patterns = []) ⇒ Object
112 113 114 115 116 117 118 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 112 def select_test_ids(include_patterns, exclude_patterns = []) all_test_ids.select do |id| include_conditions = include_patterns.all? { |pattern| id.include?(pattern) } exclude_conditions = exclude_patterns.none? { |pattern| id.include?(pattern) } include_conditions && exclude_conditions end end |
#submit_operation_test_ids ⇒ Object
168 169 170 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 168 def submit_operation_test_ids @submit_operation_test_ids ||= select_test_ids(['operation_test'], ['inquiry']) end |
#submit_request_must_support_test_ids ⇒ Object
137 138 139 140 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 137 def submit_request_must_support_test_ids @submit_request_must_support_test_ids ||= select_test_ids(['submit_request', 'must_support_test'], ['client']) .unshift(pas_submit_must_support_requirement_test_id) end |
#submit_request_validation_test_ids ⇒ Object
120 121 122 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 120 def submit_request_validation_test_ids @submit_request_validation_test_ids ||= select_test_ids(['request', 'validation_test'], ['inquiry', 'client']) end |
#submit_response_must_support_test_ids ⇒ Object
160 161 162 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 160 def submit_response_must_support_test_ids @submit_response_must_support_test_ids ||= select_test_ids(['submit_response', 'must_support_test']) end |
#submit_response_validation_test_ids ⇒ Object
128 129 130 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 128 def submit_response_validation_test_ids @submit_response_validation_test_ids ||= select_test_ids(['response', 'validation_test'], ['inquiry', 'client']) end |
#subscription_notification_conformance_test_ids ⇒ Object
193 194 195 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 193 def subscription_notification_conformance_test_ids ['subscriptions_r4_server_notification_conformance', 'subscriptions_r4_server_id_only_conformance'] end |
#subscription_notification_file_name ⇒ Object
325 326 327 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 325 def subscription_notification_file_name "../../custom_groups/#{.ig_version}/notification/pas_subscription_notification_test" end |
#template ⇒ Object
34 35 36 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 34 def template @template ||= File.read(File.join(__dir__, 'templates', 'group.rb.erb')) end |
#test_file_list ⇒ Object
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 297 def test_file_list @test_file_list ||= if system == 'client' if use_case == 'submit_must_support' client_submit_request_must_support_test_file_list else client_inquiry_request_must_support_test_file_list end elsif ['approval', 'denial'].include?(use_case) approval_denial_test_file_list elsif use_case == 'pended' pended_test_file_list else must_support_test_file_list end end |
#test_id_list ⇒ Object
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 281 def test_id_list @test_id_list ||= if system == 'client' if use_case == 'submit_must_support' client_submit_request_must_support_test_ids else client_inquiry_request_must_support_test_ids end elsif ['approval', 'denial'].include?(use_case) grouped_approval_denial_test_ids elsif use_case == 'pended' grouped_pended_test_ids else grouped_must_support_test_ids end end |
#title ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 58 def title if use_case.include?('must_support') return 'Submit Request Must Support' if system == 'client' && use_case.include?('submit') return 'Inquiry Request Must Support' if system == 'client' 'Demonstrate Element Support' else "Successful #{use_case.capitalize} Workflow" end end |
#verifies_requirements ⇒ Object
375 376 377 378 379 380 |
# File 'lib/davinci_pas_test_kit/generator/group_generator.rb', line 375 def verifies_requirements case group_id when 'pas_server_v201_must_support_use_case' ['hl7.fhir.us.davinci-pas_2.0.1@33'] end end |