001package org.hl7.fhir.r4.terminologies; 002 003/*- 004 * #%L 005 * org.hl7.fhir.r4 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.r4.context.HTMLClientLogger; 028import org.hl7.fhir.r4.model.CapabilityStatement; 029import org.hl7.fhir.r4.model.CodeSystem; 030import org.hl7.fhir.r4.model.Parameters; 031import org.hl7.fhir.r4.model.TerminologyCapabilities; 032import org.hl7.fhir.r4.model.ValueSet; 033import org.hl7.fhir.r4.utils.client.FHIRToolingClient; 034 035public class TerminologyClientR4 implements TerminologyClient { 036 037 private FHIRToolingClient client; 038 039 public TerminologyClientR4(String address) throws URISyntaxException { 040 client = new FHIRToolingClient(address); 041 } 042 043 @Override 044 public TerminologyCapabilities getTerminologyCapabilities() { 045 return client.getTerminologyCapabilities(); 046 } 047 048 @Override 049 public String getAddress() { 050 return client.getAddress(); 051 } 052 053 @Override 054 public ValueSet expandValueset(ValueSet vs, Parameters p, Map<String, String> params) { 055 return client.expandValueset(vs, p, params); 056 } 057 058 @Override 059 public Parameters validateCS(Parameters pin) { 060 return client.operateType(CodeSystem.class, "validate-code", pin); 061 } 062 063 @Override 064 public Parameters validateVS(Parameters pin) { 065 return client.operateType(ValueSet.class, "validate-code", pin); 066 } 067 068 @Override 069 public void setTimeout(int i) { 070 client.setTimeout(i); 071 } 072 073 @Override 074 public void setLogger(HTMLClientLogger txLog) { 075 client.setLogger(txLog); 076 } 077 078 @Override 079 public CapabilityStatement getCapabilitiesStatementQuick() { 080 return client.getCapabilitiesStatementQuick(); 081 } 082 083 @Override 084 public Parameters lookupCode(Map<String, String> params) { 085 return client.lookupCode(params); 086 } 087 088}