Class: Openehr::Generators::FhirProfileGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/openehr/fhir_profile/fhir_profile_generator.rb

Overview

Writes HL7 FHIR R5 StructureDefinition profiles (one per OPT entry) into app/fhir/profiles/.json. Also invoked from openehr:scaffold with --fhir.

Instance Method Summary collapse

Instance Method Details

#generate_profilesObject



16
17
18
19
20
21
22
# File 'lib/generators/openehr/fhir_profile/fhir_profile_generator.rb', line 16

def generate_profiles
  source = remote_url? ? fetch_remote_opt : opt_file
  template = OpenehrRails::Opt.parse(source)
  OpenehrRails::Fhir::ProfileGenerator.new(template).to_json_files.each do |id, json|
    create_file "app/fhir/profiles/#{id}.json", json
  end
end