Module: FHIR::Sections::Validate
- Included in:
- Client
- Defined in:
- lib/fhir_client/sections/validate.rb
Instance Method Summary collapse
-
#validate(resource, options = {}, format = @default_format) ⇒ Object
Validate resource payload.
- #validate_existing(resource, id, options = {}, format = @default_format) ⇒ Object
Instance Method Details
#validate(resource, options = {}, format = @default_format) ⇒ Object
Validate resource payload.
public <T extends Resource> AtomEntry<OperationOutcome> validate(Class<T> resourceClass, T resource, String id);
13 14 15 16 17 18 19 |
# File 'lib/fhir_client/sections/validate.rb', line 13 def validate(resource, = {}, format = @default_format) .merge!(resource: resource.class, validate: true, format: format) params = FHIR::Parameters.new add_resource_parameter(params, 'resource', resource) add_parameter(params, 'profile', 'Uri', [:profile_uri]) unless [:profile_uri].nil? post resource_url(), params, fhir_headers() end |
#validate_existing(resource, id, options = {}, format = @default_format) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/fhir_client/sections/validate.rb', line 21 def validate_existing(resource, id, = {}, format = @default_format) .merge!(resource: resource.class, id: id, validate: true, format: format) params = FHIR::Parameters.new add_resource_parameter(params, 'resource', resource) add_parameter(params, 'profile', 'Uri', [:profile_uri]) unless [:profile_uri].nil? post resource_url(), params, fhir_headers() end |