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 GenerateMdmMetricsParameters { 029 030 /** 031 * We only allow finding metrics by resource type 032 */ 033 private final String myResourceType; 034 035 /** 036 * The MDM MatchResult types of interest. 037 * Specified MatchResults will be included. 038 * If none are specified, all will be included. 039 */ 040 private List<MdmMatchResultEnum> myMatchResultFilters; 041 042 /** 043 * The MDM Link values of interest. 044 * Specified LinkSources will be included. 045 * If none are specified, all are included. 046 */ 047 private List<MdmLinkSourceEnum> myLinkSourceFilters; 048 049 public GenerateMdmMetricsParameters(String theResourceType) { 050 myResourceType = theResourceType; 051 } 052 053 public String getResourceType() { 054 return myResourceType; 055 } 056 057 public List<MdmMatchResultEnum> getMatchResultFilters() { 058 if (myMatchResultFilters == null) { 059 myMatchResultFilters = new ArrayList<>(); 060 } 061 return myMatchResultFilters; 062 } 063 064 public void addMatchResult(MdmMatchResultEnum theMdmMatchResultEnum) { 065 getMatchResultFilters().add(theMdmMatchResultEnum); 066 } 067 068 public List<MdmLinkSourceEnum> getLinkSourceFilters() { 069 if (myLinkSourceFilters == null) { 070 myLinkSourceFilters = new ArrayList<>(); 071 } 072 return myLinkSourceFilters; 073 } 074 075 public void addLinkSource(MdmLinkSourceEnum theLinkSource) { 076 getLinkSourceFilters().add(theLinkSource); 077 } 078 079 // public GenerateMdmLinkMetricParameters toLinkMetricParams() { 080 // 081 // } 082 // 083 // public GenerateMdmResourceMetricsParameters toResourceMetricParams() { 084 // 085 // } 086 // 087 088}