From b87d450cb4c58e29fdd93ec83457c988fb5377f8 Mon Sep 17 00:00:00 2001 From: dotasek Date: Mon, 1 May 2023 12:51:18 -0400 Subject: [PATCH] WIP Mark places for change --- .../conv30_40/resources30_40/Immunization30_40.java | 1 + .../conv30_50/resources30_50/ActorDefinition30_50.java | 1 + .../conv30_50/resources30_50/Requirements30_50.java | 1 + .../conv40_50/resources40_50/ActorDefinition40_50.java | 1 + .../conv40_50/resources40_50/Requirements40_50.java | 1 + .../conv43_50/resources43_50/ActorDefinition43_50.java | 1 + .../conv43_50/resources43_50/Requirements43_50.java | 1 + .../conv43_50/resources43_50/Resource43_50.java | 10 ++++++---- .../resources43_50/SubscriptionTopic43_50.java | 4 ++++ 9 files changed, 17 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Immunization30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Immunization30_40.java index 51aa26e0d..4e25a58aa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Immunization30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/resources30_40/Immunization30_40.java @@ -82,6 +82,7 @@ public class Immunization30_40 { if (src == null) return null; org.hl7.fhir.dstu3.model.Immunization tgt = new org.hl7.fhir.dstu3.model.Immunization(); + //FIXME add ignore ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier30_40.convertIdentifier(t)); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ActorDefinition30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ActorDefinition30_50.java index f24b39c95..afe52f17f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ActorDefinition30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/ActorDefinition30_50.java @@ -57,6 +57,7 @@ public class ActorDefinition30_50 { throw new FHIRException("Error in logic: this basic resource is not an ActorDefinition"); } org.hl7.fhir.r5.model.ActorDefinition tgt = new org.hl7.fhir.r5.model.ActorDefinition(); + //FIXME add ignore ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt); for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Requirements30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Requirements30_50.java index 4ca6663fe..78e3cdd87 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Requirements30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/Requirements30_50.java @@ -63,6 +63,7 @@ public class Requirements30_50 { throw new FHIRException("Error in logic: this basic resource is not an Requirements"); } org.hl7.fhir.r5.model.Requirements tgt = new org.hl7.fhir.r5.model.Requirements(); + //FIXME add ignore ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt); for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ActorDefinition40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ActorDefinition40_50.java index e869aab2b..5be16755f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ActorDefinition40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ActorDefinition40_50.java @@ -59,6 +59,7 @@ public class ActorDefinition40_50 { throw new FHIRException("Error in logic: this basic resource is not an ActorDefinition"); } org.hl7.fhir.r5.model.ActorDefinition tgt = new org.hl7.fhir.r5.model.ActorDefinition(); + //FIXME add ignore ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Requirements40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Requirements40_50.java index 38e8acb3c..50ac41f5c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Requirements40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Requirements40_50.java @@ -65,6 +65,7 @@ public class Requirements40_50 { throw new FHIRException("Error in logic: this basic resource is not an Requirements"); } org.hl7.fhir.r5.model.Requirements tgt = new org.hl7.fhir.r5.model.Requirements(); + //FIXME add ignore ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActorDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActorDefinition43_50.java index 7c59c17d5..671d9fe9c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActorDefinition43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActorDefinition43_50.java @@ -59,6 +59,7 @@ public class ActorDefinition43_50 { throw new FHIRException("Error in logic: this basic resource is not an ActorDefinition"); } org.hl7.fhir.r5.model.ActorDefinition tgt = new org.hl7.fhir.r5.model.ActorDefinition(); + //FIXME add ignore ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Requirements43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Requirements43_50.java index c0e786565..2e3e88c55 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Requirements43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Requirements43_50.java @@ -65,6 +65,7 @@ public class Requirements43_50 { throw new FHIRException("Error in logic: this basic resource is not an Requirements"); } org.hl7.fhir.r5.model.Requirements tgt = new org.hl7.fhir.r5.model.Requirements(); + //FIXME add ignore ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Resource43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Resource43_50.java index bfceab044..b34059aa3 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Resource43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Resource43_50.java @@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Meta43_50; import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Narrative43_50; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Arrays; + public class Resource43_50 { public final BaseAdvisor_43_50 advisor; @@ -512,7 +514,7 @@ public class Resource43_50 { } } - public void copyDomainResource(org.hl7.fhir.r4b.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException { + public void copyDomainResource(org.hl7.fhir.r4b.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt, String ... ignoredExtensions) throws FHIRException { copyResource(src, tgt); if (src.hasText()) tgt.setText(Narrative43_50.convertNarrative(src.getText())); src.getContained().stream() @@ -523,7 +525,7 @@ public class Resource43_50 { org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension(); advisor.handleExtension(ConversionContext43_50.INSTANCE.path(), extension, convertExtension); tgt.addExtension(convertExtension); - } else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension)) { + } else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension) && !Arrays.asList(ignoredExtensions).contains(extension.getUrl())) { tgt.addExtension(Extension43_50.convertExtension(extension)); } }); @@ -533,7 +535,7 @@ public class Resource43_50 { .forEach(tgt::addModifierExtension); } - public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.r4b.model.DomainResource tgt) throws FHIRException { + public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.r4b.model.DomainResource tgt, String ... ignoredExtensions) throws FHIRException { copyResource(src, tgt); if (src.hasText()) tgt.setText(Narrative43_50.convertNarrative(src.getText())); src.getContained().stream() @@ -544,7 +546,7 @@ public class Resource43_50 { org.hl7.fhir.r4b.model.Extension convertExtension = new org.hl7.fhir.r4b.model.Extension(); advisor.handleExtension(ConversionContext43_50.INSTANCE.path(), extension, convertExtension); tgt.addExtension(convertExtension); - } else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension)) { + } else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension) && !Arrays.asList(ignoredExtensions).contains(extension.getUrl())) { tgt.addExtension(Extension43_50.convertExtension(extension)); } }); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionTopic43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionTopic43_50.java index 9f332f18a..dee8da541 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionTopic43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubscriptionTopic43_50.java @@ -9,11 +9,14 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageConte import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; import org.hl7.fhir.r4b.model.SubscriptionTopic; +import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class SubscriptionTopic43_50 { + + private static final List ignoredExtensionUrls = Arrays.asList("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestScript.scope"); public static org.hl7.fhir.r4b.model.SubscriptionTopic convertSubscriptionTopic(org.hl7.fhir.r5.model.SubscriptionTopic src) { if (src == null) return null; @@ -243,6 +246,7 @@ public class SubscriptionTopic43_50 { return null; org.hl7.fhir.r5.model.SubscriptionTopic tgt = new org.hl7.fhir.r5.model.SubscriptionTopic(); ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt); + //FIXME add ignore ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.name")) {