Module: FHIR::Sections::Operations
- Included in:
- Client
- Defined in:
- lib/sections/operations.rb
Instance Method Summary collapse
-
#code_system_lookup(params = {}, format = @default_format) ⇒ Object
Concept Look Up [base]/CodeSystem/$lookup.
- #concept_map_translate(params = {}, format = @default_format) ⇒ Object
- #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, startTime = nil, endTime = 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
#code_system_lookup(params = {}, format = @default_format) ⇒ Object
Concept Look Up [base]/CodeSystem/$lookup
74 75 76 77 78 |
# File 'lib/sections/operations.rb', line 74 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
81 82 83 84 85 |
# File 'lib/sections/operations.rb', line 81 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
18 19 20 |
# File 'lib/sections/operations.rb', line 18 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
14 15 16 |
# File 'lib/sections/operations.rb', line 14 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, startTime = nil, endTime = nil, method = 'GET', klass = FHIR::Patient, format = @default_format) ⇒ Object
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 47 48 49 |
# File 'lib/sections/operations.rb', line 22 def fetch_record(id=nil, startTime=nil, endTime=nil, method='GET', klass=FHIR::Patient, format=@default_format) = { resource: klass, format: format, operation: { name: :fetch_patient_record, method: method } } .deep_merge!({id: id}) if !id.nil? [:operation][:parameters] = {} if [:operation][:parameters].nil? [:operation][:parameters].merge!({start: { type: 'Date', value: startTime}}) if !startTime.nil? [:operation][:parameters].merge!({end: { type: 'Date', value:endTime}}) if !endTime.nil? if [:operation][:method]=='GET' reply = get resource_url(), fhir_headers() else # create Parameters body body = nil 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 body = p.to_xml 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
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/sections/operations.rb', line 87 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 body = nil 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 body = p.to_xml 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.
67 68 69 70 71 |
# File 'lib/sections/operations.rb', line 67 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.
58 59 60 61 62 |
# File 'lib/sections/operations.rb', line 58 def value_set_expansion(params={}, format=@default_format) = { resource: FHIR::ValueSet, operation: { name: :value_set_expansion } } .deep_merge!(params) terminology_operation(, format) end |