001package org.hl7.fhir.r5.terminologies; 002 003/*- 004 * #%L 005 * org.hl7.fhir.r5 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023 024import java.net.URISyntaxException; 025import java.util.Map; 026 027import org.hl7.fhir.r5.context.HTMLClientLogger; 028import org.hl7.fhir.r5.model.CapabilityStatement; 029import org.hl7.fhir.r5.model.CodeSystem; 030import org.hl7.fhir.r5.model.Parameters; 031import org.hl7.fhir.r5.model.TerminologyCapabilities; 032import org.hl7.fhir.r5.model.ValueSet; 033import org.hl7.fhir.r5.utils.client.FHIRToolingClient; 034import org.hl7.fhir.r5.utils.client.ToolingClientLogger; 035 036public class TerminologyClientR5 implements TerminologyClient { 037 038 private FHIRToolingClient client; 039 040 public TerminologyClientR5(String address) throws URISyntaxException { 041 client = new FHIRToolingClient(address); 042 } 043 044 @Override 045 public TerminologyCapabilities getTerminologyCapabilities() { 046 return client.getTerminologyCapabilities(); 047 } 048 049 @Override 050 public String getAddress() { 051 return client.getAddress(); 052 } 053 054 @Override 055 public ValueSet expandValueset(ValueSet vs, Parameters p, Map<String, String> params) { 056 return client.expandValueset(vs, p, params); 057 } 058 059 @Override 060 public Parameters validateCS(Parameters pin) { 061 return client.operateType(CodeSystem.class, "validate-code", pin); 062 } 063 064 @Override 065 public Parameters validateVS(Parameters pin) { 066 return client.operateType(ValueSet.class, "validate-code", pin); 067 } 068 069 @Override 070 public void setTimeout(int i) { 071 client.setTimeout(i); 072 } 073 074 @Override 075 public void setLogger(ToolingClientLogger txLog) { 076 client.setLogger(txLog); 077 } 078 079 @Override 080 public CapabilityStatement getCapabilitiesStatementQuick() { 081 return client.getCapabilitiesStatementQuick(); 082 } 083 084 @Override 085 public Parameters lookupCode(Map<String, String> params) { 086 return client.lookupCode(params); 087 } 088 089}