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 ca.uhn.fhir.rest.api.server.RequestDetails;
024import org.hl7.fhir.instance.model.api.IIdType;
025
026import javax.annotation.Nullable;
027
028public interface IMdmSubmitSvc {
029
030        /**
031         * Submit all eligible resources for MDM processing.
032         *
033         * @param theCriteria The FHIR search critieria for filtering the resources to be submitted for MDM processing.
034         *                    NOTE:
035         *                    When using this function, the criteria supplied must be valid for all MDM types. e.g. , if you
036         *                    run this with the criteria birthDate=1990-06-28, it will fail, as Practitioners do not have a birthday.
037         *                    Use with caution.
038         *
039         * @return
040         */
041        long submitAllSourceTypesToMdm(@Nullable String theCriteria, RequestDetails theRequestDetails);
042
043        /**
044         * Given a type and a search criteria, submit all found resources for MDM processing.
045         *
046         * @param theSourceResourceType the resource type that you wish to execute a search over for submission to MDM.
047         * @param theCriteria The FHIR search critieria for filtering the resources to be submitted for MDM processing..
048         * @return the number of resources submitted for MDM processing.
049         */
050        long submitSourceResourceTypeToMdm(String theSourceResourceType, String theCriteria, RequestDetails theRequestDetails);
051
052        /**
053         * Convenience method that calls {@link #submitSourceResourceTypeToMdm(String, String)} with the type pre-populated.
054         *
055         * @param theCriteria The FHIR search critieria for filtering the resources to be submitted for MDM processing.
056         * @return the number of resources submitted for MDM processing.
057         */
058        long submitPractitionerTypeToMdm(String theCriteria, RequestDetails theRequestDetails);
059
060        /**
061         * Convenience method that calls {@link #submitSourceResourceTypeToMdm(String, String)} with the type pre-populated.
062         *
063         * @param theCriteria The FHIR search critieria for filtering the resources to be submitted for MDM processing.
064         * @return the number of resources submitted for MDM processing.
065         */
066        long submitPatientTypeToMdm(String theCriteria, RequestDetails theRequestDetails);
067
068        /**
069         * Given an ID and a source resource type valid for MDM, manually submit the given ID for MDM processing.
070         *
071         * @param theId the ID of the resource to process for MDM.
072         * @return the constant `1`, as if this function returns successfully, it will have processed one resource for MDM.
073         */
074        long submitSourceResourceToMdm(IIdType theId, RequestDetails theRequestDetails);
075
076        /**
077         * This setter exists to allow imported modules to override settings.
078         *
079         * @param theMdmSettings Settings to set
080         */
081        void setMdmSettings(IMdmSettings theMdmSettings);
082
083        /**
084         * Buffer size for fetching results to add to MDM queue.
085         *
086         * @param theBufferSize
087         */
088        public void setBufferSize(int theBufferSize);
089
090}