001/*-
002 * #%L
003 * HAPI FHIR - Master Data Management
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.mdm.api.params;
021
022import ca.uhn.fhir.mdm.api.MdmLinkSourceEnum;
023import ca.uhn.fhir.mdm.api.MdmMatchResultEnum;
024
025import java.util.ArrayList;
026import java.util.List;
027
028public class GenerateMdmLinkMetricParameters {
029
030        /**
031         * The resource type of interest.
032         * Must be provided!
033         */
034        private final String myResourceType;
035
036        /**
037         * The MDM MatchResult types of interest.
038         * Specified MatchResults will be included.
039         * If none are specified, all will be included.
040         */
041        private List<MdmMatchResultEnum> myMatchResultFilters;
042
043        /**
044         * The MDM Link values of interest.
045         * Specified LinkSources will be included.
046         * If none are specified, all are included.
047         */
048        private List<MdmLinkSourceEnum> myLinkSourceFilters;
049
050        public GenerateMdmLinkMetricParameters(String theResourceType) {
051                myResourceType = theResourceType;
052        }
053
054        public String getResourceType() {
055                return myResourceType;
056        }
057
058        public List<MdmMatchResultEnum> getMatchResultFilters() {
059                if (myMatchResultFilters == null) {
060                        myMatchResultFilters = new ArrayList<>();
061                }
062                return myMatchResultFilters;
063        }
064
065        public void addMatchResultFilter(MdmMatchResultEnum theMdmMatchResultEnum) {
066                getMatchResultFilters().add(theMdmMatchResultEnum);
067        }
068
069        public List<MdmLinkSourceEnum> getLinkSourceFilters() {
070                if (myLinkSourceFilters == null) {
071                        myLinkSourceFilters = new ArrayList<>();
072                }
073                return myLinkSourceFilters;
074        }
075
076        public void addLinkSourceFilter(MdmLinkSourceEnum theLinkSource) {
077                getLinkSourceFilters().add(theLinkSource);
078        }
079}