Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fhir_models/bootstrap/preprocess.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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\-.]*\)/, '')
Expand Down
4 changes: 2 additions & 2 deletions lib/fhir_models/fhir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions lib/fhir_models/generator/class_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/fhir_models/generator/ig_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/fhir_models/bootstrap/model_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading