001package ca.uhn.fhir.jpa.dao.r4;
002
003import ca.uhn.fhir.context.support.IValidationSupport;
004import ca.uhn.fhir.context.support.ValidationSupportContext;
005import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoStructureDefinition;
006import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao;
007import org.apache.commons.lang3.Validate;
008import org.hl7.fhir.r4.model.StructureDefinition;
009import org.springframework.beans.factory.annotation.Autowired;
010
011/*
012 * #%L
013 * HAPI FHIR JPA Server
014 * %%
015 * Copyright (C) 2014 - 2021 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 FhirResourceDaoStructureDefinitionR4 extends BaseHapiFhirResourceDao<StructureDefinition> implements IFhirResourceDaoStructureDefinition<StructureDefinition> {
032
033        @Autowired
034        private IValidationSupport myValidationSupport;
035
036        @Override
037        public StructureDefinition generateSnapshot(StructureDefinition theInput, String theUrl, String theWebUrl, String theName) {
038                StructureDefinition output = (StructureDefinition) myValidationSupport.generateSnapshot(new ValidationSupportContext(myValidationSupport), theInput, theUrl, theWebUrl, theName);
039                Validate.notNull(output);
040                return output;
041        }
042
043}