001package org.hl7.fhir.convertors.advisors.interfaces; 002 003import org.hl7.fhir.exceptions.FHIRException; 004import org.hl7.fhir.instance.model.api.IBaseExtension; 005import org.hl7.fhir.r4.model.*; 006 007import javax.annotation.Nonnull; 008import java.util.ArrayList; 009import java.util.List; 010 011public abstract class BaseAdvisor40<T extends IBaseExtension> extends BaseAdvisor { 012 013 private final List<CodeSystem> cslist = new ArrayList<>(); 014 015 public final List<CodeSystem> getCslist() { 016 return this.cslist; 017 } 018 019 public void handleCodeSystem(@Nonnull CodeSystem tgtcs, 020 @Nonnull ValueSet source) { 021 tgtcs.setId(source.getId()); 022 tgtcs.setValueSet(source.getUrl()); 023 this.cslist.add(tgtcs); 024 } 025 026 public boolean ignoreEntry(@Nonnull Bundle.BundleEntryComponent src, 027 @Nonnull org.hl7.fhir.r5.model.FhirPublication targetVersion) { 028 return false; 029 } 030 031 public CodeSystem getCodeSystem(@Nonnull ValueSet src) throws FHIRException { 032 return null; 033 } 034 035 public boolean ignoreExtension(@Nonnull String path, 036 @Nonnull Extension ext) throws FHIRException { 037 return ((ext.getUrl() != null) && (this.ignoreExtension(path, ext.getUrl())) 038 || (this.ignoreType(path, ext.getValue()))); 039 } 040 041 public boolean ignoreExtension(@Nonnull String path, 042 @Nonnull T ext) throws FHIRException { 043 return ((ext.getUrl() != null) && this.ignoreExtension(path, ext.getUrl())) 044 || (this.ignoreType(path, ext.getValue())); 045 } 046 047 public boolean ignoreExtension(@Nonnull String path, 048 @Nonnull String url) throws FHIRException { 049 return false; 050 } 051 052 public boolean ignoreType(@Nonnull String path, 053 @Nonnull Type type) throws FHIRException { 054 return false; 055 } 056 057 public boolean ignoreType(@Nonnull String path, 058 @Nonnull Object type) throws FHIRException { 059 return false; 060 } 061 062 public boolean useAdvisorForExtension(@Nonnull String path, 063 @Nonnull Extension ext) throws FHIRException { 064 return false; 065 } 066 067 public boolean useAdvisorForExtension(@Nonnull String path, 068 @Nonnull T ext) throws FHIRException { 069 return false; 070 } 071 072 public void handleExtension(@Nonnull String path, 073 @Nonnull Extension src, 074 @Nonnull T tgt) throws FHIRException { 075 } 076 077 public void handleExtension(@Nonnull String path, 078 @Nonnull T src, 079 @Nonnull Extension tgt) throws FHIRException { 080 } 081}