001package ca.uhn.fhir.narrative;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2016 University Health Network
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
023import java.util.ArrayList;
024import java.util.List;
025
026import ca.uhn.fhir.rest.server.RestfulServer;
027
028public class DefaultThymeleafNarrativeGenerator extends BaseThymeleafNarrativeGenerator implements INarrativeGenerator {
029
030        public static final String NARRATIVES_PROPERTIES = "classpath:ca/uhn/fhir/narrative/narratives.properties";
031        static final String HAPISERVER_NARRATIVES_PROPERTIES = "classpath:ca/uhn/fhir/narrative/narratives-hapiserver.properties";
032
033        private boolean myUseHapiServerConformanceNarrative;
034
035        @Override
036        protected List<String> getPropertyFile() {
037                List<String> retVal = new ArrayList<String>();
038                retVal.add(NARRATIVES_PROPERTIES);
039                if (myUseHapiServerConformanceNarrative) {
040                        retVal.add(HAPISERVER_NARRATIVES_PROPERTIES);
041                }
042                return retVal;
043        }
044
045        /**
046         * If set to <code>true</code> (default is <code>false</code>) a special custom narrative for the Conformance resource will be provided, which is designed to be used with HAPI {@link RestfulServer}
047         * instances. This narrative provides a friendly search page which can assist users of the service.
048         */
049        public void setUseHapiServerConformanceNarrative(boolean theValue) {
050                myUseHapiServerConformanceNarrative = theValue;
051        }
052
053        /**
054         * If set to <code>true</code> (default is <code>false</code>) a special custom narrative for the Conformance resource will be provided, which is designed to be used with HAPI {@link RestfulServer}
055         * instances. This narrative provides a friendly search page which can assist users of the service.
056         */
057        public boolean isUseHapiServerConformanceNarrative() {
058                return myUseHapiServerConformanceNarrative;
059        }
060
061}