View Javadoc
1   package ca.uhn.fhir.narrative;
2   
3   /*
4    * #%L
5    * HAPI FHIR - Core Library
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import java.util.ArrayList;
24  import java.util.List;
25  
26  public class DefaultThymeleafNarrativeGenerator extends BaseThymeleafNarrativeGenerator implements INarrativeGenerator {
27  
28  	public static final String NARRATIVES_PROPERTIES = "classpath:ca/uhn/fhir/narrative/narratives.properties";
29  	static final String HAPISERVER_NARRATIVES_PROPERTIES = "classpath:ca/uhn/fhir/narrative/narratives-hapiserver.properties";
30  
31  	private boolean myUseHapiServerConformanceNarrative;
32  
33  	@Override
34  	protected List<String> getPropertyFile() {
35  		List<String> retVal = new ArrayList<String>();
36  		retVal.add(NARRATIVES_PROPERTIES);
37  		if (myUseHapiServerConformanceNarrative) {
38  			retVal.add(HAPISERVER_NARRATIVES_PROPERTIES);
39  		}
40  		return retVal;
41  	}
42  
43  	/**
44  	 * 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}
45  	 * instances. This narrative provides a friendly search page which can assist users of the service.
46  	 */
47  	public void setUseHapiServerConformanceNarrative(boolean theValue) {
48  		myUseHapiServerConformanceNarrative = theValue;
49  	}
50  
51  	/**
52  	 * 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}
53  	 * instances. This narrative provides a friendly search page which can assist users of the service.
54  	 */
55  	public boolean isUseHapiServerConformanceNarrative() {
56  		return myUseHapiServerConformanceNarrative;
57  	}
58  
59  }