001package ca.uhn.fhir.mdm.rules.json;
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.model.api.IModelJson;
024import ca.uhn.fhir.rest.param.TokenParamModifier;
025import com.fasterxml.jackson.annotation.JsonProperty;
026
027/**
028 * This class, unlike {@link MdmResourceSearchParamJson}, is responsible for doing inclusions during MDM
029 * candidate searching. e.g. When doing candidate matching, only consider candidates that match all
030 * MdmFilterSearchParams.
031 */
032public class MdmFilterSearchParamJson implements IModelJson {
033        @JsonProperty(value = "resourceType", required = true)
034        String myResourceType;
035        @JsonProperty(value = "searchParam", required = true)
036        String mySearchParam;
037        @JsonProperty(value = "qualifier", required = true)
038        TokenParamModifier myTokenParamModifier;
039        @JsonProperty(value = "fixedValue", required = true)
040        String myFixedValue;
041
042        public String getResourceType() {
043                return myResourceType;
044        }
045
046        public MdmFilterSearchParamJson setResourceType(String theResourceType) {
047                myResourceType = theResourceType;
048                return this;
049        }
050
051        public String getSearchParam() {
052                return mySearchParam;
053        }
054
055        public MdmFilterSearchParamJson setSearchParam(String theSearchParam) {
056                mySearchParam = theSearchParam;
057                return this;
058        }
059
060
061        public TokenParamModifier getTokenParamModifier() {
062                return myTokenParamModifier;
063        }
064
065        public MdmFilterSearchParamJson setTokenParamModifier(TokenParamModifier theTokenParamModifier) {
066                myTokenParamModifier = theTokenParamModifier;
067                return this;
068        }
069
070        public String getFixedValue() {
071                return myFixedValue;
072        }
073
074        public MdmFilterSearchParamJson setFixedValue(String theFixedValue) {
075                myFixedValue = theFixedValue;
076                return this;
077        }
078
079    public String getTokenParamModifierAsString() {
080                return myTokenParamModifier == null ? "" : myTokenParamModifier.getValue();
081    }
082}