From 1425a9aa095fb272d8ed878faef96a7593fc3087 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Wed, 6 May 2026 21:26:52 +0000 Subject: [PATCH] Fix typos --- lib/fhir_models/bootstrap/preprocess.rb | 2 +- lib/fhir_models/fhir.rb | 4 ++-- lib/fhir_models/generator/class_generator.rb | 4 ++-- lib/fhir_models/generator/ig_loader.rb | 2 +- spec/lib/fhir_models/bootstrap/model_spec.rb | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/fhir_models/bootstrap/preprocess.rb b/lib/fhir_models/bootstrap/preprocess.rb index af960288a..5c5278c88 100644 --- a/lib/fhir_models/bootstrap/preprocess.rb +++ b/lib/fhir_models/bootstrap/preprocess.rb @@ -161,7 +161,7 @@ def self.pre_process_xml_example(filename) f.write(doc.to_xml) f.close - # Remove the weird parantheses on xml example filenames + # Remove the weird parentheses on xml example filenames # we do this so they match the names of the json examples if filename.include?('(') && filename.include?(')') rename = filename.gsub(/\([A-Za-z0-9\-.]*\)/, '') diff --git a/lib/fhir_models/fhir.rb b/lib/fhir_models/fhir.rb index 0f8dcb75b..4a4e4567f 100644 --- a/lib/fhir_models/fhir.rb +++ b/lib/fhir_models/fhir.rb @@ -58,11 +58,11 @@ def self.primitive?(datatype:, value:) !(formatted_value =~ /\A([0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))))))\Z/).nil? when 'date' !(value.to_s =~ /\A(-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?)\Z/).nil? - # NOTE: we don't try to instantiate and verify a Date because ruby does not natively suppport + # NOTE: we don't try to instantiate and verify a Date because ruby does not natively support # partial dates, which the FHIR standard allows. when 'datetime' !(value.to_s =~ /\A(-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?)\Z/).nil? - # NOTE: we don't try to instantiate and verify a DateTime because ruby does not natively suppport + # NOTE: we don't try to instantiate and verify a DateTime because ruby does not natively support # partial dates, which the FHIR standard allows. when 'time' !(value.to_s =~ /\A(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?)\Z/).nil? diff --git a/lib/fhir_models/generator/class_generator.rb b/lib/fhir_models/generator/class_generator.rb index 2a8b7fe75..6eb8f1f6c 100644 --- a/lib/fhir_models/generator/class_generator.rb +++ b/lib/fhir_models/generator/class_generator.rb @@ -47,7 +47,7 @@ def generate_class(hierarchy, structure_def, top_level: false) multiple_data_types = {} # examine the snapshot.elements... move the Element and BackboneElements, - # and their children, into separate StructureDefiniton hashes and process as + # and their children, into separate StructureDefinition hashes and process as # child templates. child_templates = [] structure_def['snapshot']['element'].each do |element| @@ -168,7 +168,7 @@ def generate_class(hierarchy, structure_def, top_level: false) # the template/child class was declared somewhere else in this class hierarchy klass.hierarchy.join('::') else - # the template/child is a direct ancester (it isn't in @templates yet because it is being defined now) + # the template/child is a direct ancestor (it isn't in @templates yet because it is being defined now) field.type.split('.').map { |x| cap_first(x) }.join('::') end end diff --git a/lib/fhir_models/generator/ig_loader.rb b/lib/fhir_models/generator/ig_loader.rb index 46c5886d7..c8dffab62 100644 --- a/lib/fhir_models/generator/ig_loader.rb +++ b/lib/fhir_models/generator/ig_loader.rb @@ -69,7 +69,7 @@ def load_ig(show_summary) end if show_summary - puts "Extracted Primitve Types: #{ig_resources.primitive_types&.count}" + puts "Extracted Primitive Types: #{ig_resources.primitive_types&.count}" puts "Extracted Complex Types: #{ig_resources.complex_types&.count}" puts "Extracted Resource Definitions: #{ig_resources.resource_definitions&.count}" puts "Extracted Extension Definitions: #{ig_resources.extension_definitions&.count}" diff --git a/spec/lib/fhir_models/bootstrap/model_spec.rb b/spec/lib/fhir_models/bootstrap/model_spec.rb index c8d4b86b8..f7e271058 100644 --- a/spec/lib/fhir_models/bootstrap/model_spec.rb +++ b/spec/lib/fhir_models/bootstrap/model_spec.rb @@ -84,7 +84,7 @@ end describe '.new' do - it 'can be instatiated with a simple hash' do + it 'can be instantiated with a simple hash' do range = FHIR::Range.new(low: {value: 18}) expect(range.valid?).to be_truthy expect(range.low.value).to equal(18)