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/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Json
#

def to_json
JSON.pretty_unparse(to_hash)
JSON.pretty_generate(to_hash)
end

def self.from_json(json, namespace = FHIR)
Expand Down
4 changes: 2 additions & 2 deletions lib/fhir_models/bootstrap/preprocess.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.pre_process_bundle(filename)

# Output the post processed file
f = File.open(filename, 'w:UTF-8')
f.write(JSON.pretty_unparse(hash))
f.write(JSON.pretty_generate(hash))
f.close
finish = File.size(filename)
puts " Removed #{(start - finish) / 1024} KB" if start != finish
Expand Down Expand Up @@ -131,7 +131,7 @@ def self.pre_process_json_example(filename)

# Output the post processed file
f = File.open(filename, 'w:UTF-8')
f.write(JSON.pretty_unparse(hash))
f.write(JSON.pretty_generate(hash))
f.close
finish = File.size(filename)
puts " Removed #{(start - finish) / 1024} KB" if start != finish
Expand Down
2 changes: 1 addition & 1 deletion lib/fhir_models/fhir_ext/structure_definition_finding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def to_s
end

def to_json
JSON.pretty_unparse(as_json)
JSON.pretty_generate(as_json)
end

def from_json(json)
Expand Down
2 changes: 1 addition & 1 deletion lib/fhir_models/tasks/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ namespace :fhir do

# Output the post processed file
f = File.open(filename, 'w:UTF-8')
f.write(JSON.pretty_unparse(hash))
f.write(JSON.pretty_generate(hash))
f.close
finish = File.size(filename)
puts " Removed #{(start - finish) / 1024} KB" if start != finish
Expand Down
2 changes: 1 addition & 1 deletion test/unit/json_validation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run_json_validation_test(example_file, example_name)
resource = FHIR::Json.from_json(input_json)
errors = resource.validate
unless errors.empty?
File.open("#{ERROR_DIR}/#{example_name}.err", 'w:UTF-8') { |file| file.write(JSON.pretty_unparse(errors)) }
File.open("#{ERROR_DIR}/#{example_name}.err", 'w:UTF-8') { |file| file.write(JSON.pretty_generate(errors)) }
File.open("#{ERROR_DIR}/#{example_name}.json", 'w:UTF-8') { |file| file.write(input_json) }
end
assert errors.empty?, "Resource failed to validate: #{errors}"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/xml_validation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run_xml_validation_test(example_file, example_name)
resource = FHIR::Xml.from_xml(input_xml)
errors = resource.validate
unless errors.empty?
File.open("#{ERROR_DIR}/#{example_name}.err", 'w:UTF-8') { |file| file.write(JSON.pretty_unparse(errors)) }
File.open("#{ERROR_DIR}/#{example_name}.err", 'w:UTF-8') { |file| file.write(JSON.pretty_generate(errors)) }
File.open("#{ERROR_DIR}/#{example_name}.xml", 'w:UTF-8') { |file| file.write(input_xml) }
end
assert errors.empty?, 'Resource failed to validate.'
Expand Down