001package ca.uhn.fhir.jpa.provider;
002
003import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoComposition;
004import ca.uhn.fhir.jpa.model.util.JpaConstants;
005import ca.uhn.fhir.model.dstu2.resource.Composition;
006import ca.uhn.fhir.model.valueset.BundleTypeEnum;
007import ca.uhn.fhir.rest.annotation.Operation;
008import ca.uhn.fhir.rest.api.server.IBundleProvider;
009import org.hl7.fhir.instance.model.api.IBaseBundle;
010
011/*
012 * #%L
013 * HAPI FHIR JPA Server
014 * %%
015 * Copyright (C) 2014 - 2022 Smile CDR, Inc.
016 * %%
017 * Licensed under the Apache License, Version 2.0 (the "License");
018 * you may not use this file except in compliance with the License.
019 * You may obtain a copy of the License at
020 *
021 *      http://www.apache.org/licenses/LICENSE-2.0
022 *
023 * Unless required by applicable law or agreed to in writing, software
024 * distributed under the License is distributed on an "AS IS" BASIS,
025 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
026 * See the License for the specific language governing permissions and
027 * limitations under the License.
028 * #L%
029 */
030
031public class BaseJpaResourceProviderCompositionDstu2 extends JpaResourceProviderDstu2<Composition> {
032
033        /**
034         * Composition/123/$document
035         */
036        //@formatter:off
037        @Operation(name = JpaConstants.OPERATION_DOCUMENT, idempotent = true, bundleType=BundleTypeEnum.DOCUMENT)
038        public IBundleProvider getDocumentForComposition(
039
040                        javax.servlet.http.HttpServletRequest theServletRequest) {
041                //@formatter:on
042
043                startRequest(theServletRequest);
044                try {
045                        return ((IFhirResourceDaoComposition<Composition>)getDao()).getDocumentForComposition(theServletRequest, null, null, null, null, null, null);
046                } finally {
047                        endRequest(theServletRequest);
048                }
049        }
050}