001package ca.uhn.fhir.narrative;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2017 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
026public class DefaultThymeleafNarrativeGenerator extends BaseThymeleafNarrativeGenerator implements INarrativeGenerator {
027
028        public static final String NARRATIVES_PROPERTIES = "classpath:ca/uhn/fhir/narrative/narratives.properties";
029        static final String HAPISERVER_NARRATIVES_PROPERTIES = "classpath:ca/uhn/fhir/narrative/narratives-hapiserver.properties";
030
031        private boolean myUseHapiServerConformanceNarrative;
032
033        @Override
034        protected List<String> getPropertyFile() {
035                List<String> retVal = new ArrayList<String>();
036                retVal.add(NARRATIVES_PROPERTIES);
037                if (myUseHapiServerConformanceNarrative) {
038                        retVal.add(HAPISERVER_NARRATIVES_PROPERTIES);
039                }
040                return retVal;
041        }
042
043        /**
044         * 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}
045         * instances. This narrative provides a friendly search page which can assist users of the service.
046         */
047        public void setUseHapiServerConformanceNarrative(boolean theValue) {
048                myUseHapiServerConformanceNarrative = theValue;
049        }
050
051        /**
052         * 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}
053         * instances. This narrative provides a friendly search page which can assist users of the service.
054         */
055        public boolean isUseHapiServerConformanceNarrative() {
056                return myUseHapiServerConformanceNarrative;
057        }
058
059}