001package ca.uhn.fhir.spring.boot.autoconfigure;
002
003/*-
004 * #%L
005 * hapi-fhir-spring-boot-autoconfigure
006 * %%
007 * Copyright (C) 2014 - 2022 Smile CDR, Inc.
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 ca.uhn.fhir.context.FhirVersionEnum;
025
026import org.springframework.boot.context.properties.ConfigurationProperties;
027
028@ConfigurationProperties(prefix = "hapi.fhir")
029public class FhirProperties {
030
031    private FhirVersionEnum version = FhirVersionEnum.DSTU2;
032
033    private Server server = new Server();
034
035    private Validation validation = new Validation();
036
037    public FhirVersionEnum getVersion() {
038        return version;
039    }
040
041    public void setVersion(FhirVersionEnum version) {
042        this.version = version;
043    }
044
045    public Server getServer() {
046        return server;
047    }
048
049    public void setServer(Server server) {
050        this.server = server;
051    }
052
053    public Validation getValidation() {
054        return validation;
055    }
056
057    public void setValidation(Validation validation) {
058        this.validation = validation;
059    }
060
061    public static class Server {
062
063        private String url;
064
065        private String path = "/fhir/*";
066
067        public String getUrl() {
068            return url;
069        }
070
071        public void setUrl(String url) {
072            this.url = url;
073        }
074
075        public String getPath() {
076            return path;
077        }
078
079        public void setPath(String path) {
080            this.path = path;
081        }
082    }
083
084    public static class Validation {
085
086        private boolean enabled = true;
087
088        private boolean requestOnly = true;
089
090        public boolean isEnabled() {
091            return enabled;
092        }
093
094        public void setEnabled(boolean enabled) {
095            this.enabled = enabled;
096        }
097
098        public boolean isRequestOnly() {
099            return requestOnly;
100        }
101
102        public void setRequestOnly(boolean requestOnly) {
103            this.requestOnly = requestOnly;
104        }
105    }
106}