Module: FHIR::Sections::Operations
- Included in:
- Client
- Defined in:
- lib/fhir_client/sections/operations.rb
Instance Method Summary collapse
-
#closure_table_maintenance(params = {}, format = @default_format) ⇒ Object
ConceptMap Closure Table Maintenance.
-
#code_system_lookup(params = {}, format = @default_format) ⇒ Object
Concept Look Up [base]/CodeSystem/$lookup.
-
#concept_map_translate(params = {}, format = @default_format) ⇒ Object
ConceptMap Translation.
- #fetch_encounter_record(id = nil, method = 'GET', format = @default_format) ⇒ Object
-
#fetch_patient_record(id = nil, startTime = nil, endTime = nil, method = 'GET', format = @default_format) ⇒ Object
Fetch Patient Record [base]/Patient/$everything | [base]/Patient//$everything hl7.org/implement/standards/FHIR-Develop/patient-operations.html#everything Fetches resources for a given patient record, scoped by a start and end time, and returns a Bundle of results.
- #fetch_record(id = nil, time = [nil, nil], method = 'GET', klass = FHIR::Patient, format = @default_format) ⇒ Object
- #terminology_operation(params = {}, format = @default_format) ⇒ Object
-
#value_set_code_validation(params = {}, format = @default_format) ⇒ Object
Value Set based Validation [base]/ValueSet/$validate | [base]/ValueSet//$validate hl7.org/implement/standards/FHIR-Develop/valueset-operations.html#validate Validate that a coded value is in the set of codes allowed by a value set.
-
#value_set_expansion(params = {}, format = @default_format) ⇒ Object
Value Set Expansion [base]/ValueSet/$expand | [base]/ValueSet//$expand hl7.org/implement/standards/FHIR-Develop/valueset-operations.html#expand The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation.
Instance Method Details
#closure_table_maintenance(params = {}, format = @default_format) ⇒ Object
ConceptMap Closure Table Maintenance
85 86 87 88 89 |
# File 'lib/fhir_client/sections/operations.rb', line 85 def closure_table_maintenance(params = {}, format = @default_format) = { operation: { name: :closure_table_maintenance } } .deep_merge!(params) terminology_operation(, format) end |
#code_system_lookup(params = {}, format = @default_format) ⇒ Object
Concept Look Up [base]/CodeSystem/$lookup
71 72 73 74 75 |
# File 'lib/fhir_client/sections/operations.rb', line 71 def code_system_lookup(params = {}, format = @default_format) = { resource: FHIR::CodeSystem, operation: { name: :code_system_lookup } } .deep_merge!(params) terminology_operation(, format) end |
#concept_map_translate(params = {}, format = @default_format) ⇒ Object
ConceptMap Translation
78 79 80 81 82 |
# File 'lib/fhir_client/sections/operations.rb', line 78 def concept_map_translate(params = {}, format = @default_format) = { resource: FHIR::ConceptMap, operation: { name: :concept_map_translate } } .deep_merge!(params) terminology_operation(, format) end |
#fetch_encounter_record(id = nil, method = 'GET', format = @default_format) ⇒ Object
17 18 19 |
# File 'lib/fhir_client/sections/operations.rb', line 17 def fetch_encounter_record(id = nil, method = 'GET', format = @default_format) fetch_record(id, [nil, nil], method, FHIR::Encounter, format) end |
#fetch_patient_record(id = nil, startTime = nil, endTime = nil, method = 'GET', format = @default_format) ⇒ Object
Fetch Patient Record [base]/Patient/$everything | [base]/Patient//$everything hl7.org/implement/standards/FHIR-Develop/patient-operations.html#everything Fetches resources for a given patient record, scoped by a start and end time, and returns a Bundle of results
13 14 15 |
# File 'lib/fhir_client/sections/operations.rb', line 13 def fetch_patient_record(id = nil, startTime = nil, endTime = nil, method = 'GET', format = @default_format) fetch_record(id, [startTime, endTime], method, FHIR::Patient, format) end |
#fetch_record(id = nil, time = [nil, nil], method = 'GET', klass = FHIR::Patient, format = @default_format) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fhir_client/sections/operations.rb', line 21 def fetch_record(id = nil, time = [nil, nil], method = 'GET', klass = FHIR::Patient, format = @default_format) = { resource: klass, format: format, operation: { name: :fetch_patient_record, method: method } } .deep_merge!(id: id) unless id.nil? [:operation][:parameters] = {} if [:operation][:parameters].nil? [:operation][:parameters][:start] = { type: 'Date', value: time.first } unless time.first.nil? [:operation][:parameters][:end] = { type: 'Date', value: time.last } unless time.last.nil? if [:operation][:method] == 'GET' reply = get resource_url(), fhir_headers() else # create Parameters body if [:operation] && [:operation][:parameters] p = FHIR::Parameters.new [:operation][:parameters].each do |key, value| parameter = FHIR::Parameters::Parameter.new.from_hash(name: key.to_s) parameter.method("value#{value[:type]}=").call(value[:value]) p.parameter << parameter end end reply = post resource_url(), p, fhir_headers() end reply.resource = parse_reply(FHIR::Bundle, format, reply) reply.resource_class = [:resource] reply end |
#terminology_operation(params = {}, format = @default_format) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/fhir_client/sections/operations.rb', line 91 def terminology_operation(params = {}, format = @default_format) = { format: format } # params = [id, code, system, version, display, coding, codeableConcept, date, abstract] .deep_merge!(params) if [:operation][:method] == 'GET' reply = get resource_url(), fhir_headers() else # create Parameters body if [:operation] && [:operation][:parameters] p = FHIR::Parameters.new [:operation][:parameters].each do |key, value| parameter = FHIR::Parameters::Parameter.new.from_hash(name: key.to_s) parameter.method("value#{value[:type]}=").call(value[:value]) p.parameter << parameter end end reply = post resource_url(), p, fhir_headers() end reply.resource = parse_reply([:resource], format, reply) reply.resource_class = [:resource] reply end |
#value_set_code_validation(params = {}, format = @default_format) ⇒ Object
Value Set based Validation [base]/ValueSet/$validate | [base]/ValueSet//$validate hl7.org/implement/standards/FHIR-Develop/valueset-operations.html#validate Validate that a coded value is in the set of codes allowed by a value set.
64 65 66 67 68 |
# File 'lib/fhir_client/sections/operations.rb', line 64 def value_set_code_validation(params = {}, format = @default_format) = { resource: FHIR::ValueSet, operation: { name: :value_set_based_validation } } .deep_merge!(params) terminology_operation(, format) end |
#value_set_expansion(params = {}, format = @default_format) ⇒ Object
Value Set Expansion [base]/ValueSet/$expand | [base]/ValueSet//$expand hl7.org/implement/standards/FHIR-Develop/valueset-operations.html#expand The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation.
55 56 57 58 59 |
# File 'lib/fhir_client/sections/operations.rb', line 55 def value_set_expansion(params = {}, format = @default_format) = { resource: FHIR::ValueSet, operation: { name: :value_set_expansion } } .deep_merge!(params) terminology_operation(, format) end |