001package org.hl7.fhir.dstu2016may.terminologies; 002 003import java.io.FileNotFoundException; 004import java.io.IOException; 005 006import org.hl7.fhir.dstu2016may.model.ValueSet; 007 008public interface ValueSetExpander { 009 public class ETooCostly extends Exception { 010 011 public ETooCostly(String msg) { 012 super(msg); 013 } 014 015 } 016 017 /** 018 * Some value sets are just too big to expand. Instead of an expanded value set, 019 * you get back an interface that can test membership - usually on a server somewhere 020 * 021 * @author Grahame 022 */ 023 public class ValueSetExpansionOutcome { 024 private ValueSet valueset; 025 private ValueSetChecker service; 026 private String error; 027 public ValueSetExpansionOutcome(ValueSet valueset) { 028 super(); 029 this.valueset = valueset; 030 this.service = null; 031 this.error = null; 032 } 033 public ValueSetExpansionOutcome(ValueSet valueset, String error) { 034 super(); 035 this.valueset = valueset; 036 this.service = null; 037 this.error = error; 038 } 039 public ValueSetExpansionOutcome(ValueSetChecker service, String error) { 040 super(); 041 this.valueset = null; 042 this.service = service; 043 this.error = error; 044 } 045 public ValueSetExpansionOutcome(String error) { 046 this.valueset = null; 047 this.service = null; 048 this.error = error; 049 } 050 public ValueSet getValueset() { 051 return valueset; 052 } 053 public ValueSetChecker getService() { 054 return service; 055 } 056 public String getError() { 057 return error; 058 } 059 060 061 } 062 063 public ValueSetExpansionOutcome expand(ValueSet source) throws ETooCostly, FileNotFoundException, IOException; 064}