001package org.hl7.fhir.utilities;
002
003/*-
004 * #%L
005 * org.hl7.fhir.utilities
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
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
023
024public class OIDUtils {
025
026        /*
027  2.16.840.1.113883.3.72.5.2 - NIST owns this
028  2.16.840.1.113883.4.6 - National Provider Identifier
029  2.16.840.1.113883.6.21 - UB92
030  2.16.840.1.113883.6.69 - NDC
031         */
032
033        public static String getUriForOid(String r) {
034          if (r == null) {
035            return null;
036          }
037                if (r.equals("2.16.840.1.113883.6.96"))
038                        return "http://snomed.info/sct";
039                if (r.equals("2.16.840.1.113883.6.1"))
040                        return "http://loinc.org";
041                if (r.equals("2.16.840.1.113883.6.8"))
042                        return "http://unitsofmeasure.org";
043                if (r.equals("2.16.840.1.113883.6.3"))
044                        return "http://hl7.org/fhir/sid/icd-10";
045                if (r.equals("2.16.840.1.113883.6.42"))
046                        return "http://hl7.org/fhir/sid/icd-9";
047                if (r.equals("2.16.840.1.113883.6.104"))
048                        return "http://hl7.org/fhir/sid/icd-9";
049                if (r.equals("2.16.840.1.113883.6.103"))
050                        return "http://hl7.org/fhir/sid/icd-9"; //todo: confirm this            
051                if (r.equals("2.16.840.1.113883.6.73"))
052                        return "http://hl7.org/fhir/sid/atc";
053                if (r.equals("2.16.840.1.113883.3.26.1.1"))
054                        return "http://ncimeta.nci.nih.gov";
055                if (r.equals("2.16.840.1.113883.3.26.1.1.1"))
056                        return "http://ncimeta.nci.nih.gov";
057                if (r.equals("2.16.840.1.113883.6.88"))
058                        return "http://www.nlm.nih.gov/research/umls/rxnorm"; // todo: confirm this
059
060                if (r.equals("2.16.840.1.113883.5.1008"))
061                        return "http://terminology.hl7.org/v3/NullFlavor";
062                if (r.equals("2.16.840.1.113883.5.111"))
063                        return "http://terminology.hl7.org/v3/RoleCode";
064                if (r.equals("2.16.840.1.113883.5.4"))
065                        return "http://terminology.hl7.org/v3/ActCode";
066                if (r.equals("2.16.840.1.113883.5.8"))
067                        return "http://terminology.hl7.org/v3/ActReason";
068                if (r.equals("2.16.840.1.113883.5.83"))
069                        return "http://terminology.hl7.org/v3/ObservationInterpretation";
070                if (r.equals("2.16.840.1.113883.6.238"))
071                        return "http://terminology.hl7.org/v3/Race";
072
073                if (r.equals("2.16.840.1.113883.6.59"))
074                        return "http://hl7.org/fhir/sid/cvx";
075                if (r.equals("2.16.840.1.113883.12.292"))
076                        return "http://hl7.org/fhir/sid/cvx";
077
078                if (r.equals("2.16.840.1.113883.6.12"))
079                        return "http://www.ama-assn.org/go/cpt";
080
081                if (r.startsWith("2.16.840.1.113883.12."))
082                        return "http://hl7.org/fhir/sid/v2-"+r.substring(21);
083                return null;
084        }
085
086}