You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2022/03/18 10:05:45 UTC

[camel-quarkus] 10/12: Tidy up DSTU2, DSTU3, R4 & R5 processor classes

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch 2.7.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 3806ada94c0655f8e940daf64a72acbbfb75fbe9
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Mar 17 07:59:13 2022 +0000

    Tidy up DSTU2, DSTU3, R4 & R5 processor classes
---
 .../fhir/deployment/dstu2/FhirDstu2Processor.java  | 201 +++------------------
 .../fhir/deployment/dstu3/FhirDstu3Processor.java  |  31 ++--
 .../fhir/deployment/r4/FhirR4Processor.java        |  40 ++--
 .../fhir/deployment/r5/FhirR5Processor.java        |  41 +++--
 4 files changed, 97 insertions(+), 216 deletions(-)

diff --git a/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/dstu2/FhirDstu2Processor.java b/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/dstu2/FhirDstu2Processor.java
index c0d20f7..f332477 100644
--- a/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/dstu2/FhirDstu2Processor.java
+++ b/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/dstu2/FhirDstu2Processor.java
@@ -23,12 +23,12 @@ import javax.inject.Singleton;
 
 import ca.uhn.fhir.context.FhirContext;
 import ca.uhn.fhir.model.dstu2.resource.BaseResource;
-import ca.uhn.fhir.model.dstu2.valueset.*;
 import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.annotations.ExecutionTime;
 import io.quarkus.deployment.annotations.Record;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
 import org.apache.camel.quarkus.component.fhir.FhirContextRecorder;
@@ -42,201 +42,46 @@ public class FhirDstu2Processor {
     private static final String FHIR_VERSION_PROPERTIES = "ca/uhn/fhir/model/dstu2/fhirversion.properties";
 
     @BuildStep(onlyIf = FhirFlags.Dstu2Enabled.class)
-    Dstu2PropertiesBuildItem properties(BuildProducer<NativeImageResourceBuildItem> resource) {
-        resource.produce(new NativeImageResourceBuildItem(FHIR_VERSION_PROPERTIES));
+    Dstu2PropertiesBuildItem fhirProperties() {
         return new Dstu2PropertiesBuildItem(FHIR_VERSION_PROPERTIES);
     }
 
     @BuildStep(onlyIf = FhirFlags.Dstu2Enabled.class)
+    NativeImageResourceBuildItem nativeImageResources() {
+        return new NativeImageResourceBuildItem(FHIR_VERSION_PROPERTIES);
+    }
+
+    @BuildStep(onlyIf = FhirFlags.Dstu2Enabled.class)
     @Record(ExecutionTime.STATIC_INIT)
-    SyntheticBeanBuildItem recordContext(FhirContextRecorder fhirContextRecorder,
+    SyntheticBeanBuildItem recordFhirContext(
+            FhirContextRecorder recorder,
             Dstu2PropertiesBuildItem propertiesBuildItem) {
         return SyntheticBeanBuildItem.configure(FhirContext.class)
                 .scope(Singleton.class)
                 .named("DSTU2")
-                .runtimeValue(fhirContextRecorder.createDstu2FhirContext(
+                .runtimeValue(recorder.createDstu2FhirContext(
                         getResourceDefinitions(propertiesBuildItem.getProperties())))
                 .done();
     }
 
     @BuildStep(onlyIf = FhirFlags.Dstu2Enabled.class)
-    void enableReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, Dstu2PropertiesBuildItem buildItem) {
+    void registerForReflection(
+            BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
+            Dstu2PropertiesBuildItem propertiesBuildItem,
+            CombinedIndexBuildItem combinedIndex) {
         Set<String> classes = new HashSet<>();
         classes.add(BaseResource.class.getCanonicalName());
-        classes.addAll(getModelClasses(buildItem.getProperties()));
+        classes.addAll(getModelClasses(propertiesBuildItem.getProperties()));
 
         reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, classes.toArray(new String[0])));
-        reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, getDstu2Enums()));
-    }
 
-    private String[] getDstu2Enums() {
-        return new String[] {
-                AccountStatusEnum.class.getCanonicalName(),
-                ActionListEnum.class.getCanonicalName(),
-                AddressTypeEnum.class.getCanonicalName(),
-                AddressUseEnum.class.getCanonicalName(),
-                AdjudicationCodesEnum.class.getCanonicalName(),
-                AdjudicationErrorCodesEnum.class.getCanonicalName(),
-                AdjustmentReasonCodesEnum.class.getCanonicalName(),
-                AdministrativeGenderEnum.class.getCanonicalName(),
-                AdmitSourceEnum.class.getCanonicalName(),
-                AggregationModeEnum.class.getCanonicalName(),
-                AllergyIntoleranceCategoryEnum.class.getCanonicalName(),
-                AllergyIntoleranceCertaintyEnum.class.getCanonicalName(),
-                AllergyIntoleranceCriticalityEnum.class.getCanonicalName(),
-                AllergyIntoleranceSeverityEnum.class.getCanonicalName(),
-                AllergyIntoleranceStatusEnum.class.getCanonicalName(),
-                AllergyIntoleranceTypeEnum.class.getCanonicalName(),
-                AnswerFormatEnum.class.getCanonicalName(),
-                AppointmentStatusEnum.class.getCanonicalName(),
-                AssertionDirectionTypeEnum.class.getCanonicalName(),
-                AssertionOperatorTypeEnum.class.getCanonicalName(),
-                AssertionResponseTypesEnum.class.getCanonicalName(),
-                AuditEventActionEnum.class.getCanonicalName(),
-                AuditEventObjectLifecycleEnum.class.getCanonicalName(),
-                AuditEventObjectRoleEnum.class.getCanonicalName(),
-                AuditEventObjectTypeEnum.class.getCanonicalName(),
-                AuditEventOutcomeEnum.class.getCanonicalName(),
-                AuditEventParticipantNetworkTypeEnum.class.getCanonicalName(),
-                AuditEventSourceTypeEnum.class.getCanonicalName(),
-                BindingStrengthEnum.class.getCanonicalName(),
-                BundleTypeEnum.class.getCanonicalName(),
-                CarePlanActivityStatusEnum.class.getCanonicalName(),
-                CarePlanRelationshipEnum.class.getCanonicalName(),
-                CarePlanStatusEnum.class.getCanonicalName(),
-                ClaimTypeEnum.class.getCanonicalName(),
-                ClinicalImpressionStatusEnum.class.getCanonicalName(),
-                CommunicationRequestStatusEnum.class.getCanonicalName(),
-                CommunicationStatusEnum.class.getCanonicalName(),
-                CompositionAttestationModeEnum.class.getCanonicalName(),
-                CompositionStatusEnum.class.getCanonicalName(),
-                ConceptMapEquivalenceEnum.class.getCanonicalName(),
-                ConditionalDeleteStatusEnum.class.getCanonicalName(),
-                ConditionCategoryCodesEnum.class.getCanonicalName(),
-                ConditionClinicalStatusCodesEnum.class.getCanonicalName(),
-                ConditionVerificationStatusEnum.class.getCanonicalName(),
-                ConformanceEventModeEnum.class.getCanonicalName(),
-                ConformanceResourceStatusEnum.class.getCanonicalName(),
-                ConformanceStatementKindEnum.class.getCanonicalName(),
-                ConstraintSeverityEnum.class.getCanonicalName(),
-                ContactPointSystemEnum.class.getCanonicalName(),
-                ContactPointUseEnum.class.getCanonicalName(),
-                ContentTypeEnum.class.getCanonicalName(),
-                DataElementStringencyEnum.class.getCanonicalName(),
-                DaysOfWeekEnum.class.getCanonicalName(),
-                DetectedIssueSeverityEnum.class.getCanonicalName(),
-                DeviceMetricCalibrationStateEnum.class.getCanonicalName(),
-                DeviceMetricCalibrationTypeEnum.class.getCanonicalName(),
-                DeviceMetricCategoryEnum.class.getCanonicalName(),
-                DeviceMetricColorEnum.class.getCanonicalName(),
-                DeviceMetricOperationalStatusEnum.class.getCanonicalName(),
-                DeviceStatusEnum.class.getCanonicalName(),
-                DeviceUseRequestPriorityEnum.class.getCanonicalName(),
-                DeviceUseRequestStatusEnum.class.getCanonicalName(),
-                DiagnosticOrderPriorityEnum.class.getCanonicalName(),
-                DiagnosticOrderStatusEnum.class.getCanonicalName(),
-                DiagnosticReportStatusEnum.class.getCanonicalName(),
-                DigitalMediaTypeEnum.class.getCanonicalName(),
-                DocumentModeEnum.class.getCanonicalName(),
-                DocumentReferenceStatusEnum.class.getCanonicalName(),
-                DocumentRelationshipTypeEnum.class.getCanonicalName(),
-                EncounterClassEnum.class.getCanonicalName(),
-                EncounterLocationStatusEnum.class.getCanonicalName(),
-                EncounterStateEnum.class.getCanonicalName(),
-                EpisodeOfCareStatusEnum.class.getCanonicalName(),
-                EventTimingEnum.class.getCanonicalName(),
-                ExtensionContextEnum.class.getCanonicalName(),
-                FamilyHistoryStatusEnum.class.getCanonicalName(),
-                FilterOperatorEnum.class.getCanonicalName(),
-                FlagStatusEnum.class.getCanonicalName(),
-                GoalPriorityEnum.class.getCanonicalName(),
-                GoalStatusEnum.class.getCanonicalName(),
-                GroupTypeEnum.class.getCanonicalName(),
-                GuideDependencyTypeEnum.class.getCanonicalName(),
-                GuidePageKindEnum.class.getCanonicalName(),
-                GuideResourcePurposeEnum.class.getCanonicalName(),
-                HTTPVerbEnum.class.getCanonicalName(),
-                IdentifierTypeCodesEnum.class.getCanonicalName(),
-                IdentifierUseEnum.class.getCanonicalName(),
-                IdentityAssuranceLevelEnum.class.getCanonicalName(),
-                InstanceAvailabilityEnum.class.getCanonicalName(),
-                IssueSeverityEnum.class.getCanonicalName(),
-                IssueTypeEnum.class.getCanonicalName(),
-                KOStitleEnum.class.getCanonicalName(),
-                LinkTypeEnum.class.getCanonicalName(),
-                ListModeEnum.class.getCanonicalName(),
-                ListOrderCodesEnum.class.getCanonicalName(),
-                ListStatusEnum.class.getCanonicalName(),
-                LocationModeEnum.class.getCanonicalName(),
-                LocationStatusEnum.class.getCanonicalName(),
-                LocationTypeEnum.class.getCanonicalName(),
-                MaritalStatusCodesEnum.class.getCanonicalName(),
-                MeasmntPrincipleEnum.class.getCanonicalName(),
-                MedicationAdministrationStatusEnum.class.getCanonicalName(),
-                MedicationDispenseStatusEnum.class.getCanonicalName(),
-                MedicationOrderStatusEnum.class.getCanonicalName(),
-                MedicationStatementStatusEnum.class.getCanonicalName(),
-                MessageEventEnum.class.getCanonicalName(),
-                MessageSignificanceCategoryEnum.class.getCanonicalName(),
-                MessageTransportEnum.class.getCanonicalName(),
-                NameUseEnum.class.getCanonicalName(),
-                NamingSystemIdentifierTypeEnum.class.getCanonicalName(),
-                NamingSystemTypeEnum.class.getCanonicalName(),
-                NarrativeStatusEnum.class.getCanonicalName(),
-                NoteTypeEnum.class.getCanonicalName(),
-                NutritionOrderStatusEnum.class.getCanonicalName(),
-                ObservationRelationshipTypeEnum.class.getCanonicalName(),
-                ObservationStatusEnum.class.getCanonicalName(),
-                OperationKindEnum.class.getCanonicalName(),
-                OperationParameterUseEnum.class.getCanonicalName(),
-                OrderStatusEnum.class.getCanonicalName(),
-                ParticipantRequiredEnum.class.getCanonicalName(),
-                ParticipantStatusEnum.class.getCanonicalName(),
-                ParticipantTypeEnum.class.getCanonicalName(),
-                ParticipationStatusEnum.class.getCanonicalName(),
-                PayeeTypeCodesEnum.class.getCanonicalName(),
-                ProcedureRequestPriorityEnum.class.getCanonicalName(),
-                ProcedureRequestStatusEnum.class.getCanonicalName(),
-                ProcedureStatusEnum.class.getCanonicalName(),
-                PropertyRepresentationEnum.class.getCanonicalName(),
-                ProvenanceEntityRoleEnum.class.getCanonicalName(),
-                QuantityComparatorEnum.class.getCanonicalName(),
-                QuestionnaireResponseStatusEnum.class.getCanonicalName(),
-                QuestionnaireStatusEnum.class.getCanonicalName(),
-                ReferralMethodEnum.class.getCanonicalName(),
-                ReferralStatusEnum.class.getCanonicalName(),
-                RemittanceOutcomeEnum.class.getCanonicalName(),
-                ResourceTypeEnum.class.getCanonicalName(),
-                ResourceVersionPolicyEnum.class.getCanonicalName(),
-                ResponseTypeEnum.class.getCanonicalName(),
-                RestfulConformanceModeEnum.class.getCanonicalName(),
-                RestfulSecurityServiceEnum.class.getCanonicalName(),
-                RulesetCodesEnum.class.getCanonicalName(),
-                SearchEntryModeEnum.class.getCanonicalName(),
-                SearchModifierCodeEnum.class.getCanonicalName(),
-                SearchParamTypeEnum.class.getCanonicalName(),
-                ServiceProvisionConditionsEnum.class.getCanonicalName(),
-                SignatureTypeCodesEnum.class.getCanonicalName(),
-                SlicingRulesEnum.class.getCanonicalName(),
-                SlotStatusEnum.class.getCanonicalName(),
-                SpecimenStatusEnum.class.getCanonicalName(),
-                StructureDefinitionKindEnum.class.getCanonicalName(),
-                SubscriptionChannelTypeEnum.class.getCanonicalName(),
-                SubscriptionStatusEnum.class.getCanonicalName(),
-                SubstanceCategoryCodesEnum.class.getCanonicalName(),
-                SupplyDeliveryStatusEnum.class.getCanonicalName(),
-                SupplyRequestStatusEnum.class.getCanonicalName(),
-                SystemRestfulInteractionEnum.class.getCanonicalName(),
-                TimingAbbreviationEnum.class.getCanonicalName(),
-                TransactionModeEnum.class.getCanonicalName(),
-                TypeRestfulInteractionEnum.class.getCanonicalName(),
-                UnitsOfTimeEnum.class.getCanonicalName(),
-                UnknownContentCodeEnum.class.getCanonicalName(),
-                UseEnum.class.getCanonicalName(),
-                VisionBaseEnum.class.getCanonicalName(),
-                VisionEyesEnum.class.getCanonicalName(),
-                XPathUsageTypeEnum.class.getCanonicalName()
-        };
-    }
+        String[] dstu2Enums = combinedIndex.getIndex()
+                .getKnownClasses()
+                .stream()
+                .map(classInfo -> classInfo.toString())
+                .filter(className -> className.startsWith("ca.uhn.fhir.model.dstu2.valueset"))
+                .toArray(String[]::new);
 
+        reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, dstu2Enums));
+    }
 }
diff --git a/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/dstu3/FhirDstu3Processor.java b/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/dstu3/FhirDstu3Processor.java
index 7e3148e..939a31c 100644
--- a/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/dstu3/FhirDstu3Processor.java
+++ b/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/dstu3/FhirDstu3Processor.java
@@ -32,6 +32,7 @@ import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
 import org.apache.camel.quarkus.component.fhir.FhirContextRecorder;
 import org.apache.camel.quarkus.component.fhir.FhirFlags;
 import org.hl7.fhir.dstu3.model.Base;
+import org.hl7.fhir.dstu3.model.BaseResource;
 import org.hl7.fhir.dstu3.model.DomainResource;
 import org.hl7.fhir.dstu3.model.Enumerations;
 import org.hl7.fhir.dstu3.model.Meta;
@@ -46,35 +47,41 @@ public class FhirDstu3Processor {
     private static final String FHIR_VERSION_PROPERTIES = "org/hl7/fhir/dstu3/model/fhirversion.properties";
 
     @BuildStep(onlyIf = FhirFlags.Dstu3Enabled.class)
-    Dstu3PropertiesBuildItem properties(BuildProducer<NativeImageResourceBuildItem> resource) {
-        resource.produce(new NativeImageResourceBuildItem(FHIR_VERSION_PROPERTIES));
+    Dstu3PropertiesBuildItem fhirProperties() {
         return new Dstu3PropertiesBuildItem(FHIR_VERSION_PROPERTIES);
     }
 
     @BuildStep(onlyIf = FhirFlags.Dstu3Enabled.class)
+    NativeImageResourceBuildItem nativeImageResources() {
+        return new NativeImageResourceBuildItem(FHIR_VERSION_PROPERTIES);
+    }
+
+    @BuildStep(onlyIf = FhirFlags.Dstu3Enabled.class)
     @Record(ExecutionTime.STATIC_INIT)
-    SyntheticBeanBuildItem recordContext(FhirContextRecorder fhirContextRecorder,
+    SyntheticBeanBuildItem recordFhirContext(
+            FhirContextRecorder recorder,
             Dstu3PropertiesBuildItem propertiesBuildItem) {
         return SyntheticBeanBuildItem.configure(FhirContext.class)
                 .scope(Singleton.class)
                 .named("DSTU3")
-                .runtimeValue(fhirContextRecorder.createDstu3FhirContext(
+                .runtimeValue(recorder.createDstu3FhirContext(
                         getResourceDefinitions(propertiesBuildItem.getProperties())))
                 .done();
     }
 
     @BuildStep(onlyIf = FhirFlags.Dstu3Enabled.class)
-    void enableReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
+    void registerForReflection(
+            BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
             Dstu3PropertiesBuildItem propertiesBuildItem) {
         Set<String> classes = new HashSet<>();
-        classes.add(DomainResource.class.getCanonicalName());
-        classes.add(Resource.class.getCanonicalName());
-        classes.add(org.hl7.fhir.dstu3.model.BaseResource.class.getCanonicalName());
-        classes.add(Base.class.getCanonicalName());
+        classes.add(DomainResource.class.getName());
+        classes.add(Resource.class.getName());
+        classes.add(BaseResource.class.getName());
+        classes.add(Base.class.getName());
         classes.addAll(getModelClasses(propertiesBuildItem.getProperties()));
-        classes.addAll(getInnerClasses(Enumerations.class.getCanonicalName()));
-        reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, true, Meta.class.getCanonicalName()));
-        reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, true, MetadataResource.class.getCanonicalName()));
+        classes.addAll(getInnerClasses(Enumerations.class.getName()));
+        reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, true, Meta.class.getName()));
+        reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, true, MetadataResource.class.getName()));
         reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, classes.toArray(new String[0])));
     }
 }
diff --git a/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/r4/FhirR4Processor.java b/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/r4/FhirR4Processor.java
index 1a63550..89f4227 100644
--- a/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/r4/FhirR4Processor.java
+++ b/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/r4/FhirR4Processor.java
@@ -31,6 +31,13 @@ import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
 import org.apache.camel.quarkus.component.fhir.FhirContextRecorder;
 import org.apache.camel.quarkus.component.fhir.FhirFlags;
+import org.hl7.fhir.r4.model.Base;
+import org.hl7.fhir.r4.model.BaseResource;
+import org.hl7.fhir.r4.model.DomainResource;
+import org.hl7.fhir.r4.model.Enumerations;
+import org.hl7.fhir.r4.model.Meta;
+import org.hl7.fhir.r4.model.MetadataResource;
+import org.hl7.fhir.r4.model.Resource;
 
 import static org.apache.camel.quarkus.component.fhir.deployment.FhirUtil.getInnerClasses;
 import static org.apache.camel.quarkus.component.fhir.deployment.FhirUtil.getModelClasses;
@@ -40,36 +47,43 @@ public class FhirR4Processor {
     private static final String FHIR_VERSION_PROPERTIES = "org/hl7/fhir/r4/model/fhirversion.properties";
 
     @BuildStep(onlyIf = FhirFlags.R4Enabled.class)
-    R4PropertiesBuildItem properties(BuildProducer<NativeImageResourceBuildItem> resource) {
-        resource.produce(new NativeImageResourceBuildItem(FHIR_VERSION_PROPERTIES));
+    R4PropertiesBuildItem fhirProperties() {
         return new R4PropertiesBuildItem(FHIR_VERSION_PROPERTIES);
     }
 
     @BuildStep(onlyIf = FhirFlags.R4Enabled.class)
+    NativeImageResourceBuildItem nativeImageResources() {
+        return new NativeImageResourceBuildItem(FHIR_VERSION_PROPERTIES);
+    }
+
+    @BuildStep(onlyIf = FhirFlags.R4Enabled.class)
     @Record(ExecutionTime.STATIC_INIT)
-    SyntheticBeanBuildItem recordContext(FhirContextRecorder fhirContextRecorder,
+    SyntheticBeanBuildItem recordFhirContext(
+            FhirContextRecorder recorder,
             R4PropertiesBuildItem propertiesBuildItem) {
         return SyntheticBeanBuildItem.configure(FhirContext.class)
                 .scope(Singleton.class)
                 .named("R4")
-                .runtimeValue(fhirContextRecorder.createR4FhirContext(
+                .runtimeValue(recorder.createR4FhirContext(
                         getResourceDefinitions(propertiesBuildItem.getProperties())))
                 .done();
     }
 
     @BuildStep(onlyIf = FhirFlags.R4Enabled.class)
-    void enableReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, R4PropertiesBuildItem buildItem) {
+    void registerForReflection(
+            BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
+            R4PropertiesBuildItem propertiesBuildItem) {
         Set<String> classes = new HashSet<>();
-        classes.add(org.hl7.fhir.r4.model.DomainResource.class.getCanonicalName());
-        classes.add(org.hl7.fhir.r4.model.Resource.class.getCanonicalName());
-        classes.add(org.hl7.fhir.r4.model.BaseResource.class.getCanonicalName());
-        classes.add(org.hl7.fhir.r4.model.Base.class.getCanonicalName());
-        classes.addAll(getModelClasses(buildItem.getProperties()));
-        classes.addAll(getInnerClasses(org.hl7.fhir.r4.model.Enumerations.class.getCanonicalName()));
+        classes.add(DomainResource.class.getName());
+        classes.add(Resource.class.getName());
+        classes.add(BaseResource.class.getName());
+        classes.add(Base.class.getName());
+        classes.addAll(getModelClasses(propertiesBuildItem.getProperties()));
+        classes.addAll(getInnerClasses(Enumerations.class.getName()));
         reflectiveClass
-                .produce(new ReflectiveClassBuildItem(true, true, true, org.hl7.fhir.r4.model.Meta.class.getCanonicalName()));
+                .produce(new ReflectiveClassBuildItem(true, true, true, Meta.class.getName()));
         reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, true,
-                org.hl7.fhir.r4.model.MetadataResource.class.getCanonicalName()));
+                MetadataResource.class.getName()));
         reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, classes.toArray(new String[0])));
     }
 }
diff --git a/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/r5/FhirR5Processor.java b/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/r5/FhirR5Processor.java
index e39e09c..c4dacc6 100644
--- a/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/r5/FhirR5Processor.java
+++ b/extensions/fhir/deployment/src/main/java/org/apache/camel/quarkus/component/fhir/deployment/r5/FhirR5Processor.java
@@ -31,6 +31,13 @@ import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
 import org.apache.camel.quarkus.component.fhir.FhirContextRecorder;
 import org.apache.camel.quarkus.component.fhir.FhirFlags;
+import org.hl7.fhir.r5.model.Base;
+import org.hl7.fhir.r5.model.BaseResource;
+import org.hl7.fhir.r5.model.DomainResource;
+import org.hl7.fhir.r5.model.Enumerations;
+import org.hl7.fhir.r5.model.Meta;
+import org.hl7.fhir.r5.model.MetadataResource;
+import org.hl7.fhir.r5.model.Resource;
 
 import static org.apache.camel.quarkus.component.fhir.deployment.FhirUtil.getInnerClasses;
 import static org.apache.camel.quarkus.component.fhir.deployment.FhirUtil.getModelClasses;
@@ -40,35 +47,43 @@ public class FhirR5Processor {
     private static final String FHIR_VERSION_PROPERTIES = "org/hl7/fhir/r5/model/fhirversion.properties";
 
     @BuildStep(onlyIf = FhirFlags.R5Enabled.class)
-    R5PropertiesBuildItem properties(BuildProducer<NativeImageResourceBuildItem> resource) {
-        resource.produce(new NativeImageResourceBuildItem(FHIR_VERSION_PROPERTIES));
+    R5PropertiesBuildItem fhirProperties() {
         return new R5PropertiesBuildItem(FHIR_VERSION_PROPERTIES);
     }
 
     @BuildStep(onlyIf = FhirFlags.R5Enabled.class)
+    NativeImageResourceBuildItem nativeImageResources() {
+        return new NativeImageResourceBuildItem(FHIR_VERSION_PROPERTIES);
+    }
+
+    @BuildStep(onlyIf = FhirFlags.R5Enabled.class)
     @Record(ExecutionTime.STATIC_INIT)
-    SyntheticBeanBuildItem recordContext(FhirContextRecorder fhirContextRecorder, R5PropertiesBuildItem propertiesBuildItem) {
+    SyntheticBeanBuildItem recordFhirContext(
+            FhirContextRecorder recorder,
+            R5PropertiesBuildItem propertiesBuildItem) {
         return SyntheticBeanBuildItem.configure(FhirContext.class)
                 .scope(Singleton.class)
                 .named("R5")
-                .runtimeValue(fhirContextRecorder.createR5FhirContext(
+                .runtimeValue(recorder.createR5FhirContext(
                         getResourceDefinitions(propertiesBuildItem.getProperties())))
                 .done();
     }
 
     @BuildStep(onlyIf = FhirFlags.R5Enabled.class)
-    void enableReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, R5PropertiesBuildItem buildItem) {
+    void registerForReflection(
+            BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
+            R5PropertiesBuildItem propertiesBuildItem) {
         Set<String> classes = new HashSet<>();
-        classes.add(org.hl7.fhir.r5.model.DomainResource.class.getCanonicalName());
-        classes.add(org.hl7.fhir.r5.model.Resource.class.getCanonicalName());
-        classes.add(org.hl7.fhir.r5.model.BaseResource.class.getCanonicalName());
-        classes.add(org.hl7.fhir.r5.model.Base.class.getCanonicalName());
-        classes.addAll(getModelClasses(buildItem.getProperties()));
-        classes.addAll(getInnerClasses(org.hl7.fhir.r5.model.Enumerations.class.getCanonicalName()));
+        classes.add(DomainResource.class.getName());
+        classes.add(Resource.class.getName());
+        classes.add(BaseResource.class.getName());
+        classes.add(Base.class.getName());
+        classes.addAll(getModelClasses(propertiesBuildItem.getProperties()));
+        classes.addAll(getInnerClasses(Enumerations.class.getName()));
         reflectiveClass
-                .produce(new ReflectiveClassBuildItem(true, true, true, org.hl7.fhir.r5.model.Meta.class.getCanonicalName()));
+                .produce(new ReflectiveClassBuildItem(true, true, true, Meta.class.getName()));
         reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, true,
-                org.hl7.fhir.r5.model.MetadataResource.class.getCanonicalName()));
+                MetadataResource.class.getName()));
         reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, classes.toArray(new String[0])));
     }
 }