Class: Crucible::Generator::Resources
- Inherits:
-
Object
- Object
- Crucible::Generator::Resources
- Defined in:
- lib/data/resources.rb
Constant Summary collapse
- FIXTURE_DIR =
File.join(File.(File.join('..','..','..'),File.absolute_path(__FILE__)), 'fixtures')
Instance Method Summary collapse
- #average_claim ⇒ Object
-
#codesystem_simple ⇒ Object
—————————— TERMINOLOGY TRACK TESTS ——————————.
- #complex_claim ⇒ Object
- #conceptmap_simple ⇒ Object
-
#daf_conformance ⇒ Object
—————————— DAF TESTS ——————————.
- #example_patient ⇒ Object
- #example_patient_record_201 ⇒ Object
- #example_patient_record_condition_201 ⇒ Object
- #example_patient_record_condition_205 ⇒ Object
- #example_patient_record_diagnosticreport_201 ⇒ Object
- #example_patient_record_encounter_201 ⇒ Object
- #example_patient_record_encounter_202 ⇒ Object
- #example_patient_record_observation_202 ⇒ Object
- #example_patient_record_organization_201 ⇒ Object
- #example_patient_record_organization_203 ⇒ Object
- #example_patient_record_practitioner_201 ⇒ Object
- #example_patient_record_procedure_201 ⇒ Object
- #example_patient_us ⇒ Object
-
#fixture_path ⇒ Object
FIXME: Determine a better way to share fixture data with Crucible.
- #load_fixture(path) ⇒ Object
-
#medicationorder_simple ⇒ Object
—————————— PATCH TRACK TESTS ——————————.
- #minimal_patient ⇒ Object
-
#scheduling_appointment ⇒ Object
—————————— SCHEDULING TEST TRACK ——————————.
- #scheduling_practitioner ⇒ Object
- #scheduling_response_patient ⇒ Object
- #scheduling_response_practitioner ⇒ Object
- #scheduling_schedule ⇒ Object
- #scheduling_slot ⇒ Object
-
#simple_claim ⇒ Object
—————————— CLAIM TEST TRACK ——————————.
- #track3_observations ⇒ Object
- #track3_profile ⇒ Object
- #valueset_simple ⇒ Object
Instance Method Details
#average_claim ⇒ Object
92 93 94 |
# 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 ⇒ Object
—————————— TERMINOLOGY TRACK TESTS ——————————
134 135 136 |
# 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 ⇒ Object
96 97 98 |
# 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 ⇒ Object
142 143 144 |
# 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 ⇒ Object
—————————— DAF TESTS ——————————
128 129 130 |
# 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 ⇒ Object
16 17 18 |
# 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 ⇒ Object
28 29 30 |
# 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 ⇒ Object
32 33 34 |
# 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 ⇒ Object
36 37 38 |
# 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 ⇒ Object
40 41 42 |
# 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 ⇒ Object
44 45 46 |
# 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 ⇒ Object
48 49 50 |
# 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 ⇒ Object
52 53 54 |
# 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 ⇒ Object
56 57 58 |
# 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 ⇒ Object
60 61 62 |
# 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 ⇒ Object
64 65 66 |
# 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 ⇒ Object
68 69 70 |
# 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 ⇒ Object
20 21 22 |
# 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 ⇒ Object
FIXME: Determine a better way to share fixture data with Crucible
8 9 10 11 12 13 14 |
# 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) ⇒ Object
152 153 154 |
# File 'lib/data/resources.rb', line 152 def load_fixture(path) FHIR.from_contents(File.read(File.join(fixture_path, path))) end |
#medicationorder_simple ⇒ Object
—————————— PATCH TRACK TESTS ——————————
148 149 150 |
# 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 ⇒ Object
24 25 26 |
# 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 ⇒ Object
—————————— SCHEDULING TEST TRACK ——————————
102 103 104 |
# 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 ⇒ Object
114 115 116 |
# 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 ⇒ Object
106 107 108 |
# 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 ⇒ Object
110 111 112 |
# 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 ⇒ Object
118 119 120 |
# 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 ⇒ Object
122 123 124 |
# 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 ⇒ Object
—————————— CLAIM TEST TRACK ——————————
88 89 90 |
# 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 ⇒ Object
76 77 78 79 80 81 82 83 84 |
# 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 ⇒ Object
72 73 74 |
# 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 ⇒ Object
138 139 140 |
# 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 |