class Crucible::Generator::Resources

Constants

FIXTURE_DIR

Public Instance Methods

average_claim() click to toggle source
# File lib/data/resources.rb, line 92
def average_claim
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'financial', 'claim-example-oral-average.xml'))
end
codesystem_simple() click to toggle source

—————————— TERMINOLOGY TRACK TESTS ——————————

# File lib/data/resources.rb, line 134
def codesystem_simple
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'terminology', 'codesystem-simple.xml'))
end
complex_claim() click to toggle source
# File lib/data/resources.rb, line 96
def complex_claim
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'financial', 'claim-example-oral-orthoplan.xml'))
end
conceptmap_simple() click to toggle source
# File lib/data/resources.rb, line 142
def conceptmap_simple
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'terminology', 'conceptmap-example.xml'))
end
daf_conformance() click to toggle source

—————————— DAF TESTS ——————————

# File lib/data/resources.rb, line 128
def daf_conformance
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'daf', 'conformance-daf-query-responder.xml'))
end
example_patient() click to toggle source
# File lib/data/resources.rb, line 16
def example_patient
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'patient', 'patient-example.xml'))
end
example_patient_record_201() click to toggle source
# File lib/data/resources.rb, line 28
def example_patient_record_201
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'patient-example-f201-roel.xml'))
end
example_patient_record_condition_201() click to toggle source
# File lib/data/resources.rb, line 32
def example_patient_record_condition_201
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'condition-example-f201-fever.xml'))
end
example_patient_record_condition_205() click to toggle source
# File lib/data/resources.rb, line 36
def example_patient_record_condition_205
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'condition-example-f205-infection.xml'))
end
example_patient_record_diagnosticreport_201() click to toggle source
# File lib/data/resources.rb, line 40
def example_patient_record_diagnosticreport_201
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'diagnosticreport-example-f201-brainct.xml'))
end
example_patient_record_encounter_201() click to toggle source
# File lib/data/resources.rb, line 44
def example_patient_record_encounter_201
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'encounter-example-f201-20130404.xml'))
end
example_patient_record_encounter_202() click to toggle source
# File lib/data/resources.rb, line 48
def example_patient_record_encounter_202
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'encounter-example-f202-20130128.xml'))
end
example_patient_record_observation_202() click to toggle source
# File lib/data/resources.rb, line 52
def example_patient_record_observation_202
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'observation-example-f202-temperature.xml'))
end
example_patient_record_organization_201() click to toggle source
# File lib/data/resources.rb, line 56
def example_patient_record_organization_201
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'organization-example-f201-aumc.xml'))
end
example_patient_record_organization_203() click to toggle source
# File lib/data/resources.rb, line 60
def example_patient_record_organization_203
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'organization-example-f203-bumc.xml'))
end
example_patient_record_practitioner_201() click to toggle source
# File lib/data/resources.rb, line 64
def example_patient_record_practitioner_201
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'practitioner-example-f201-ab.xml'))
end
example_patient_record_procedure_201() click to toggle source
# File lib/data/resources.rb, line 68
def example_patient_record_procedure_201
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'record', 'procedure-example-f201-tpf.xml'))
end
example_patient_us() click to toggle source
# File lib/data/resources.rb, line 20
def example_patient_us
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'patient', 'patient-example-us-extensions.xml'))
end
fixture_path() click to toggle source

FIXME: Determine a better way to share fixture data with Crucible

# File lib/data/resources.rb, line 8
def fixture_path
  if File.exists?(FIXTURE_DIR)
    FIXTURE_DIR
  else
    File.join(Rails.root, 'test', 'fixtures')
  end
end
load_fixture(path) click to toggle source
# File lib/data/resources.rb, line 152
def load_fixture(path)
  FHIR.from_contents(File.read(File.join(fixture_path, path)))
end
medicationorder_simple() click to toggle source

—————————— PATCH TRACK TESTS ——————————

# File lib/data/resources.rb, line 148
def medicationorder_simple
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'patch', 'medicationrequest-simple.xml'))
end
minimal_patient() click to toggle source
# File lib/data/resources.rb, line 24
def minimal_patient
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'patient', 'patient-minimal.xml'))
end
scheduling_appointment() click to toggle source

—————————— SCHEDULING TEST TRACK ——————————

# File lib/data/resources.rb, line 102
def scheduling_appointment
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'scheduling', 'appointment-simple.xml'))
end
scheduling_practitioner() click to toggle source
# File lib/data/resources.rb, line 114
def scheduling_practitioner
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'scheduling', 'practitioner-simple.xml'))
end
scheduling_response_patient() click to toggle source
# File lib/data/resources.rb, line 106
def scheduling_response_patient
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'scheduling', 'appointmentresponse-patient-simple.xml'))
end
scheduling_response_practitioner() click to toggle source
# File lib/data/resources.rb, line 110
def scheduling_response_practitioner
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'scheduling', 'appointmentresponse-practitioner-simple.xml'))
end
scheduling_schedule() click to toggle source
# File lib/data/resources.rb, line 118
def scheduling_schedule
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'scheduling', 'schedule-simple.xml'))
end
scheduling_slot() click to toggle source
# File lib/data/resources.rb, line 122
def scheduling_slot
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'scheduling', 'slot-simple.xml'))
end
simple_claim() click to toggle source

—————————— CLAIM TEST TRACK ——————————

# File lib/data/resources.rb, line 88
def simple_claim
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'financial', 'claim-example.xml'))
end
track3_observations() click to toggle source
# File lib/data/resources.rb, line 76
def track3_observations
  # get all observations in fixture_path/validation/observations
  observations = []
  files = File.join(fixture_path, 'validation', 'observations', '*.xml')
  Dir.glob(files).each do |f|
      observations << FHIR::Xml.from_xml( File.read(f) )
  end
  observations
end
track3_profile() click to toggle source
# File lib/data/resources.rb, line 72
def track3_profile
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'validation', 'observation.profile.xml'))
end
valueset_simple() click to toggle source
# File lib/data/resources.rb, line 138
def valueset_simple
  FHIR::Xml.from_xml File.read(File.join(fixture_path, 'terminology', 'valueset-example.xml'))
end