001/*-
002 * #%L
003 * HAPI FHIR - Core Library
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.context.support;
021
022import java.util.Collection;
023import java.util.Collections;
024
025/**
026 * Represents parameters which can be passed to the $lookup operation for codes.
027 * @since 7.0.0
028 */
029public class LookupCodeRequest {
030        private final String mySystem;
031        private final String myCode;
032        private String myDisplayLanguage;
033        private Collection<String> myPropertyNames;
034
035        /**
036         * @param theSystem                    The CodeSystem URL
037         * @param theCode                      The code
038         */
039        public LookupCodeRequest(String theSystem, String theCode) {
040                mySystem = theSystem;
041                myCode = theCode;
042        }
043
044        /**
045         * @param theSystem                    The CodeSystem URL
046         * @param theCode                      The code
047         * @param theDisplayLanguage           Used to filter out the designation by the display language. To return all designation, set this value to <code>null</code>.
048         * @param thePropertyNames             The collection of properties to be returned in the output. If no properties are specified, the implementor chooses what to return.
049         */
050        public LookupCodeRequest(
051                        String theSystem, String theCode, String theDisplayLanguage, Collection<String> thePropertyNames) {
052                this(theSystem, theCode);
053                myDisplayLanguage = theDisplayLanguage;
054                myPropertyNames = thePropertyNames;
055        }
056
057        public String getSystem() {
058                return mySystem;
059        }
060
061        public String getCode() {
062                return myCode;
063        }
064
065        public String getDisplayLanguage() {
066                return myDisplayLanguage;
067        }
068
069        public Collection<String> getPropertyNames() {
070                if (myPropertyNames == null) {
071                        return Collections.emptyList();
072                }
073                return myPropertyNames;
074        }
075}