001package ca.uhn.fhir.mdm.api;
002
003/*-
004 * #%L
005 * HAPI FHIR - Master Data Management
006 * %%
007 * Copyright (C) 2014 - 2022 Smile CDR, Inc.
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 *
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import org.hl7.fhir.instance.model.api.IIdType;
024
025import javax.annotation.Nullable;
026
027public interface IMdmSubmitSvc {
028
029        /**
030         * Submit all eligible resources for MDM processing.
031         *
032         * @param theCriteria The FHIR search critieria for filtering the resources to be submitted for MDM processing.
033         *                    NOTE:
034         *                    When using this function, the criteria supplied must be valid for all MDM types. e.g. , if you
035         *                    run this with the criteria birthDate=1990-06-28, it will fail, as Practitioners do not have a birthday.
036         *                    Use with caution.
037         *
038         * @return
039         */
040        long submitAllSourceTypesToMdm(@Nullable String theCriteria);
041
042        /**
043         * Given a type and a search criteria, submit all found resources for MDM processing.
044         *
045         * @param theSourceResourceType the resource type that you wish to execute a search over for submission to MDM.
046         * @param theCriteria The FHIR search critieria for filtering the resources to be submitted for MDM processing..
047         * @return the number of resources submitted for MDM processing.
048         */
049        long submitSourceResourceTypeToMdm(String theSourceResourceType, String theCriteria);
050
051        /**
052         * Convenience method that calls {@link #submitSourceResourceTypeToMdm(String, String)} with the type pre-populated.
053         *
054         * @param theCriteria The FHIR search critieria for filtering the resources to be submitted for MDM processing.
055         * @return the number of resources submitted for MDM processing.
056         */
057        long submitPractitionerTypeToMdm(String theCriteria);
058
059        /**
060         * Convenience method that calls {@link #submitSourceResourceTypeToMdm(String, String)} with the type pre-populated.
061         *
062         * @param theCriteria The FHIR search critieria for filtering the resources to be submitted for MDM processing.
063         * @return the number of resources submitted for MDM processing.
064         */
065        long submitPatientTypeToMdm(String theCriteria);
066
067        /**
068         * Given an ID and a source resource type valid for MDM, manually submit the given ID for MDM processing.
069         *
070         * @param theId the ID of the resource to process for MDM.
071         * @return the constant `1`, as if this function returns successfully, it will have processed one resource for MDM.
072         */
073        long submitSourceResourceToMdm(IIdType theId);
074
075        /**
076         * This setter exists to allow imported modules to override settings.
077         *
078         * @param theMdmSettings Settings to set
079         */
080        void setMdmSettings(IMdmSettings theMdmSettings);
081
082        /**
083         * Buffer size for fetching results to add to MDM queue.
084         *
085         * @param theBufferSize
086         */
087        public void setBufferSize(int theBufferSize);
088
089}