001package ca.uhn.fhir.model.api;
002
003import java.io.Serializable;
004
005import ca.uhn.fhir.context.FhirContext;
006
007/*
008 * #%L
009 * HAPI FHIR - Core Library
010 * %%
011 * Copyright (C) 2014 - 2023 Smile CDR, Inc.
012 * %%
013 * Licensed under the Apache License, Version 2.0 (the "License");
014 * you may not use this file except in compliance with the License.
015 * You may obtain a copy of the License at
016 *
017 *      http://www.apache.org/licenses/LICENSE-2.0
018 *
019 * Unless required by applicable law or agreed to in writing, software
020 * distributed under the License is distributed on an "AS IS" BASIS,
021 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
022 * See the License for the specific language governing permissions and
023 * limitations under the License.
024 * #L%
025 */
026
027public interface IQueryParameterType extends Serializable {
028
029        /**
030         * This method is generally only called by HAPI itself, and should not need to be called from user code. 
031         * 
032         * <p>
033         * See FHIR specification <a href="http://www.hl7.org/implement/standards/fhir/search.html#ptypes">2.2.2 Search
034         * SearchParameter Types</a> for information on the <b>token</b> format
035         * </p>
036         * @param theContext TODO
037         * @param theParamName TODO
038         * @param theQualifier
039         *            The parameter name qualifier that accompanied this value. For example, if the complete query was
040         *            <code>http://foo?name:exact=John</code>, qualifier would be ":exact"
041         * @param theValue
042         *            The actual parameter value. For example, if the complete query was
043         *            <code>http://foo?name:exact=John</code>, the value would be "John"
044         */
045        public void setValueAsQueryToken(FhirContext theContext, String theParamName, String theQualifier, String theValue);
046
047        /**
048         * Returns a representation of this parameter's value as it will be represented "over the wire". In other
049         * words, how it will be presented in a URL (although not URL escaped) 
050         * 
051         * <p>
052         * See FHIR specification <a href="http://www.hl7.org/implement/standards/fhir/search.html#ptypes">2.2.2 Search
053         * SearchParameter Types</a> for information on the <b>token</b> format
054         * </p>
055         * @param theContext TODO
056         * 
057         * @return Returns a representation of this parameter's value as it will be represented "over the wire". In other
058         * words, how it will be presented in a URL (although not URL escaped) 
059         */
060        public String getValueAsQueryToken(FhirContext theContext);
061        
062        /**
063         * This method will return any qualifier that should be appended to the parameter name (e.g ":exact").  Returns null if none are present.
064         */
065        public String getQueryParameterQualifier();
066
067        /**
068         * If set to non-null value, indicates that this parameter has been populated with a "[name]:missing=true" or "[name]:missing=false" vale 
069         * instead of a normal value 
070         */
071        Boolean getMissing();
072
073        /**
074         * If set to non-null value, indicates that this parameter has been populated with a "[name]:missing=true" or "[name]:missing=false" vale 
075         * instead of a normal value
076         *  
077         * @return Returns a reference to <code>this</code> for easier method chaining
078         */
079        IQueryParameterType setMissing(Boolean theMissing);
080
081}