001package ca.uhn.fhir.narrative; 002 003/* 004 * #%L 005 * HAPI FHIR - Core Library 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 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 public DefaultThymeleafNarrativeGenerator() { 034 super(); 035 } 036 037 @Override 038 protected List<String> getPropertyFile() { 039 List<String> retVal = new ArrayList<String>(); 040 retVal.add(NARRATIVES_PROPERTIES); 041 if (myUseHapiServerConformanceNarrative) { 042 retVal.add(HAPISERVER_NARRATIVES_PROPERTIES); 043 } 044 return retVal; 045 } 046 047 /** 048 * 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} 049 * instances. This narrative provides a friendly search page which can assist users of the service. 050 */ 051 public void setUseHapiServerConformanceNarrative(boolean theValue) { 052 myUseHapiServerConformanceNarrative = theValue; 053 } 054 055 /** 056 * 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} 057 * instances. This narrative provides a friendly search page which can assist users of the service. 058 */ 059 public boolean isUseHapiServerConformanceNarrative() { 060 return myUseHapiServerConformanceNarrative; 061 } 062 063}