Add new param to BaseAdvisor_40_50

This commit is contained in:
dotasek 2022-09-08 17:50:39 -04:00
parent fadb727e87
commit cf77cd1717
3 changed files with 18 additions and 7 deletions

View File

@ -11,14 +11,21 @@ import org.hl7.fhir.exceptions.FHIRException;
public class BaseAdvisor_40_50 extends BaseAdvisor50<org.hl7.fhir.r4.model.Extension> {
private static final List<String> TestScriptIgnoredUrls = Arrays.asList("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestScript.scope");
private boolean convertImplementationGuideDefinitionParameterComponent = true;
public BaseAdvisor_40_50() {
}
public BaseAdvisor_40_50(Boolean failFast) {
this.failFast = failFast;
}
public BaseAdvisor_40_50(Boolean failFast, Boolean convertImplementationGuideDefinitionParameterComponent) {
this.failFast = failFast;
this.convertImplementationGuideDefinitionParameterComponent = convertImplementationGuideDefinitionParameterComponent;
}
@Override
public boolean ignoreExtension(@Nonnull String path,
@ -30,4 +37,7 @@ public class BaseAdvisor_40_50 extends BaseAdvisor50<org.hl7.fhir.r4.model.Exten
return false;
}
public boolean convertImplementationGuideDefinitionParameterComponent() {
return convertImplementationGuideDefinitionParameterComponent;
}
}

View File

@ -17,7 +17,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50;
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Url40_50;
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.r5.model.ImplementationGuide;
/*
Copyright (c) 2011+, HL7, Inc.
@ -101,7 +101,7 @@ public class ImplementationGuide40_50 {
return tgt;
}
public static org.hl7.fhir.r4.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.r5.model.ImplementationGuide src) throws FHIRException {
public static org.hl7.fhir.r4.model.ImplementationGuide convertImplementationGuide(ImplementationGuide src, boolean convertImplementationGuideDefinitionParameterComponent) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImplementationGuide tgt = new org.hl7.fhir.r4.model.ImplementationGuide();
@ -144,7 +144,7 @@ public class ImplementationGuide40_50 {
for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal())
tgt.addGlobal(convertImplementationGuideGlobalComponent(t));
if (src.hasDefinition())
tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition()));
tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition(), convertImplementationGuideDefinitionParameterComponent));
if (src.hasManifest())
tgt.setManifest(convertImplementationGuideManifestComponent(src.getManifest()));
return tgt;
@ -2328,7 +2328,7 @@ public class ImplementationGuide40_50 {
return tgt;
}
public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent src) throws FHIRException {
public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(ImplementationGuide.ImplementationGuideDefinitionComponent src, boolean convertImplementationGuideDefinitionParameterComponent) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent();
@ -2341,7 +2341,8 @@ public class ImplementationGuide40_50 {
tgt.setPage(convertImplementationGuideDefinitionPageComponent(src.getPage()));
for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent t : src.getParameter()) {
// if (Utilities.existsInList(t.getCode().getCode(), "apply", "path-resource", "path-pages", "path-tx-cache", "expansion-parameter", "rule-broken-links", "generate-xml", "generate-json", "generate-turtle", "html-template"))
tgt.addParameter(convertImplementationGuideDefinitionParameterComponent(t));
if (convertImplementationGuideDefinitionParameterComponent)
tgt.addParameter(convertImplementationGuideDefinitionParameterComponent(t));
// else {
// org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(EXT_IG_DEFINITION_PARAMETER);
// org.hl7.fhir.r4.model.Extension eCode = new org.hl7.fhir.r4.model.Extension("code", new org.hl7.fhir.r4.model.StringType(t.getCode().getCode()));

View File

@ -385,7 +385,7 @@ public class Resource40_50 {
if (src instanceof org.hl7.fhir.r5.model.ImmunizationRecommendation)
return ImmunizationRecommendation40_50.convertImmunizationRecommendation((org.hl7.fhir.r5.model.ImmunizationRecommendation) src);
if (src instanceof org.hl7.fhir.r5.model.ImplementationGuide)
return ImplementationGuide40_50.convertImplementationGuide((org.hl7.fhir.r5.model.ImplementationGuide) src);
return ImplementationGuide40_50.convertImplementationGuide((org.hl7.fhir.r5.model.ImplementationGuide) src, advisor.convertImplementationGuideDefinitionParameterComponent());
if (src instanceof org.hl7.fhir.r5.model.InsurancePlan)
return InsurancePlan40_50.convertInsurancePlan((org.hl7.fhir.r5.model.InsurancePlan) src);
if (src instanceof org.hl7.fhir.r5.model.Invoice)