Module: DaVinciCRDTestKit::MockEHREndpoints
- Defined in:
- lib/davinci_crd_test_kit/server/endpoints/mock_ehr_endpoints.rb
Overview
Include this module within a suite class to add Mock FHIR Server endpoints with data supplied by an input containing a Bundle that can be accessed and updated by calls to the suite’s endpoints. Defaults to driving the CapabilityStatement and supported search parameters off of US Core 6.1.0, but a different set of metadata can be provided at inclusion time by using ‘with` and specifying either a `metadata_dir:` or providing a block that resolves to a list of metadata files to use.
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
38 39 40 |
# File 'lib/davinci_crd_test_kit/server/endpoints/mock_ehr_endpoints.rb', line 38 def self.included(base) configure(base) end |
.with(metadata_dir: nil, &block) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/davinci_crd_test_kit/server/endpoints/mock_ehr_endpoints.rb', line 42 def self.with(metadata_dir: nil, &block) Module.new do define_singleton_method(:included) do |base| MockEHREndpoints.send(:configure, base, metadata_dir:, metadata_files_proc: block) end end end |