001/*-
002 * #%L
003 * HAPI FHIR Storage api
004 * %%
005 * Copyright (C) 2014 - 2024 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.jpa.term.api;
021
022import ca.uhn.fhir.jpa.term.models.CodeSystemConceptsDeleteResult;
023
024import java.util.Iterator;
025
026public interface ITermCodeSystemDeleteJobSvc {
027
028        /**
029         * Gets an iterator for all code system version PIDs
030         * @param thePid
031         * @return
032         */
033        Iterator<Long> getAllCodeSystemVersionForCodeSystemPid(long thePid);
034
035        /**
036         * Deletes all metadata associated with a code system version
037         * Specific metadata deleted:
038         * * concept links
039         * * concept properties
040         * * concept designations
041         * * concepts
042         * @param theVersionPid - the version id of the code system to delete
043         * @return - a wrapper for the delete results of each of the deletes (if desired)
044         */
045        CodeSystemConceptsDeleteResult deleteCodeSystemConceptsByCodeSystemVersionPid(long theVersionPid);
046
047        /**
048         * Deletes a Code System Version
049         * NB: it is expected that any concepts related to the Code System Version are
050         * deleted first.
051         * @param theVersionPid - the code system version pid for the version to delete
052         */
053        void deleteCodeSystemVersion(long theVersionPid);
054
055        /**
056         * Deletes a code system.
057         * NB: it is expected that all code system versions are deleted first.
058         * @param thePid - the code system pid
059         */
060        void deleteCodeSystem(long thePid);
061
062        /**
063         * Notifies that the job has completed (or errored out).
064         * @param theJobId - the job id
065         */
066        void notifyJobComplete(String theJobId);
067}