001package ca.uhn.fhir.model.base.composite;
002
003import org.hl7.fhir.instance.model.api.INarrative;
004
005import ca.uhn.fhir.model.api.BaseIdentifiableElement;
006import ca.uhn.fhir.model.api.ICompositeDatatype;
007import ca.uhn.fhir.model.primitive.BoundCodeDt;
008import ca.uhn.fhir.model.primitive.XhtmlDt;
009
010/*
011 * #%L
012 * HAPI FHIR - Core Library
013 * %%
014 * Copyright (C) 2014 - 2022 Smile CDR, Inc.
015 * %%
016 * Licensed under the Apache License, Version 2.0 (the "License");
017 * you may not use this file except in compliance with the License.
018 * You may obtain a copy of the License at
019 *
020 *      http://www.apache.org/licenses/LICENSE-2.0
021 *
022 * Unless required by applicable law or agreed to in writing, software
023 * distributed under the License is distributed on an "AS IS" BASIS,
024 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
025 * See the License for the specific language governing permissions and
026 * limitations under the License.
027 * #L%
028 */
029
030/**
031 * @param <T> The narrative status enum type  
032 */
033public abstract class BaseNarrativeDt<T extends Enum<?>> extends BaseIdentifiableElement implements ICompositeDatatype, INarrative {
034
035        private static final long serialVersionUID = -525238683230100077L;
036
037        public abstract BoundCodeDt<T> getStatus();
038
039        @Override
040        public void setDivAsString(String theString)  {
041                getDiv().setValueAsString(theString);
042        }
043
044        @Override
045        public String getDivAsString() {
046                return getDiv().getValueAsString();
047        }
048
049        @Override
050        public INarrative setStatusAsString(String theString) {
051                getStatus().setValueAsString(theString);
052                return this;
053        }
054
055        @Override
056        public String getStatusAsString() {
057                return getStatus().getValueAsString();
058        }
059
060        public abstract XhtmlDt getDiv();
061        
062}