lib/fhir_client/ext/reference.rb in fhir_client-5.0.3 vs lib/fhir_client/ext/reference.rb in fhir_client-6.0.0
- old
+ new
@@ -80,33 +80,57 @@
module FHIR
class Reference
include FHIR::ReferenceExtras
def resource_class
- "FHIR::#{resource_type}".constantize unless contained?
+ FHIR.const_get(resource_type) unless contained?
end
end
end
module FHIR
module DSTU2
class Reference
include FHIR::ReferenceExtras
def resource_class
- "FHIR::DSTU2::#{resource_type}".constantize unless contained?
+ FHIR::DSTU2.const_get(resource_type) unless contained?
end
end
end
end
module FHIR
module STU3
- class Reference
+ class Reference
include FHIR::ReferenceExtras
def resource_class
- "FHIR::STU3::#{resource_type}".constantize unless contained?
+ FHIR::STU3.const_get(resource_type) unless contained?
end
end
end
end
+
+module FHIR
+ module R4B
+ class Reference < FHIR::R4B::Model
+ include FHIR::ReferenceExtras
+
+ def resource_class
+ FHIR::R4B.const_get(resource_type) unless contained?
+ end
+ end
+ end
+end
+
+module FHIR
+ module R5
+ class Reference < FHIR::R5::Model
+ include FHIR::ReferenceExtras
+
+ def resource_class
+ FHIR::R5.const_get(resource_type) unless contained?
+ end
+ end
+ end
+end
\ No newline at end of file