Improved param name + re-introduce logic.

This commit is contained in:
dotasek 2022-09-08 20:44:30 -04:00
parent cf77cd1717
commit 1679376f38
3 changed files with 18 additions and 18 deletions

View File

@ -11,7 +11,7 @@ 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;
private boolean produceIllegalParameters = false;
public BaseAdvisor_40_50() {
@ -21,9 +21,9 @@ public class BaseAdvisor_40_50 extends BaseAdvisor50<org.hl7.fhir.r4.model.Exten
this.failFast = failFast;
}
public BaseAdvisor_40_50(Boolean failFast, Boolean convertImplementationGuideDefinitionParameterComponent) {
public BaseAdvisor_40_50(Boolean failFast, Boolean produceIllegalParameters) {
this.failFast = failFast;
this.convertImplementationGuideDefinitionParameterComponent = convertImplementationGuideDefinitionParameterComponent;
this.produceIllegalParameters = produceIllegalParameters;
}
@ -37,7 +37,7 @@ public class BaseAdvisor_40_50 extends BaseAdvisor50<org.hl7.fhir.r4.model.Exten
return false;
}
public boolean convertImplementationGuideDefinitionParameterComponent() {
return convertImplementationGuideDefinitionParameterComponent;
public boolean produceIllegalParameters() {
return produceIllegalParameters;
}
}

View File

@ -101,7 +101,7 @@ public class ImplementationGuide40_50 {
return tgt;
}
public static org.hl7.fhir.r4.model.ImplementationGuide convertImplementationGuide(ImplementationGuide src, boolean convertImplementationGuideDefinitionParameterComponent) throws FHIRException {
public static org.hl7.fhir.r4.model.ImplementationGuide convertImplementationGuide(ImplementationGuide src, boolean produceIllegalParameters) 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(), convertImplementationGuideDefinitionParameterComponent));
tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition(), produceIllegalParameters));
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(ImplementationGuide.ImplementationGuideDefinitionComponent src, boolean convertImplementationGuideDefinitionParameterComponent) throws FHIRException {
public static org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(ImplementationGuide.ImplementationGuideDefinitionComponent src, boolean produceIllegalParameters) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent tgt = new org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionComponent();
@ -2341,16 +2341,16 @@ 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"))
if (convertImplementationGuideDefinitionParameterComponent)
if (produceIllegalParameters) {
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()));
// org.hl7.fhir.r4.model.Extension eValue = new org.hl7.fhir.r4.model.Extension("value", new org.hl7.fhir.r4.model.StringType(t.getValue()));
// e.addExtension(eCode);
// e.addExtension(eValue);
// tgt.addExtension(e);
// }
} 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()));
org.hl7.fhir.r4.model.Extension eValue = new org.hl7.fhir.r4.model.Extension("value", new org.hl7.fhir.r4.model.StringType(t.getValue()));
e.addExtension(eCode);
e.addExtension(eValue);
tgt.addExtension(e);
}
}
for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent t : src.getTemplate())
tgt.addTemplate(convertImplementationGuideDefinitionTemplateComponent(t));

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, advisor.convertImplementationGuideDefinitionParameterComponent());
return ImplementationGuide40_50.convertImplementationGuide((org.hl7.fhir.r5.model.ImplementationGuide) src, advisor.produceIllegalParameters());
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)