
001package org.hl7.fhir.convertors; 002 003import org.hl7.fhir.r5.utils.ToolingExtensions; 004 005/* 006 Copyright (c) 2011+, HL7, Inc. 007 All rights reserved. 008 009 Redistribution and use in source and binary forms, with or without modification, 010 are permitted provided that the following conditions are met: 011 012 * Redistributions of source code must retain the above copyright notice, this 013 list of conditions and the following disclaimer. 014 * Redistributions in binary form must reproduce the above copyright notice, 015 this list of conditions and the following disclaimer in the documentation 016 and/or other materials provided with the distribution. 017 * Neither the name of HL7 nor the names of its contributors may be used to 018 endorse or promote products derived from this software without specific 019 prior written permission. 020 021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 024 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 025 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 026 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 028 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 030 POSSIBILITY OF SUCH DAMAGE. 031 032 */ 033 034 035public class VersionConvertorConstants { 036 037 public final static String EXT_PAYLOAD_CONTENT = "http://hl7.org/fhir/4.0/StructureDefinition/extension-CommunicationRequest.payload.content"; 038 public final static String EXT_IG_CONFORMANCE_MESSAGE_EVENT = "http://hl7.org/fhir/1.0/StructureDefinition/extension-Conformance.messaging.event"; 039 public final static String EXT_IG_DEPENDSON_VERSION_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ImplementationGuide.dependsOn.version"; 040 public final static String EXT_MODIFIER_REASON_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ElementDefinition.isModifierReason"; 041 public final static String EXT_MODIFIER_REASON_LEGACY = "No Modifier Reason provideed in previous versions of FHIR"; 042 public final static String EXT_MODIFIER_TAKEN = "http://hl7.org/fhir/4.0/StructureDefinition/extension-MedicationStatment.taken"; 043 public final static String EXT_PROFILE_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ElementDefinition.type.profile"; 044 public static final String EXT_ACCEPT_UNKNOWN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"; 045 public static final String EXT_CarePlanActivityDetailComponentExtension = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CarePlan.activity.detail.category"; 046 public static final String EXT_EXP_VS_CONT_PROP = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ValueSet.expansion.contains.property"; 047 public static final String EXT_TESTSCRIPT_SCOPE = "http://hl7.org/fhir/5.0/StructureDefinition/extension-TestScript.scope"; 048 public static final String EXT_ACTUAL_RESOURCE_NAME = "http://hl7.org/fhir/tools/StructureDefinition/original-resource-name"; 049 public static final String EXT_ADDITIONAL_BINDING = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.binding.additional"; 050 public static final String EXT_CS_PROFILE = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile"; 051 public static final String EXT_IG_DEFINITION_PAGE_NAME = "http://hl7.org/fhir/tools/StructureDefinition/ig-page-name"; 052 public static final String EXT_IG_DEFINITION_PARAMETER = "http://hl7.org/fhir/tools/StructureDefinition/ig-parameter"; 053 public static final String EXT_IG_DEFINITION_PARAM_URL_BASE = "http://hl7.org/fhir/guide-parameter-code"; 054 public static final String EXT_IG_DEFINITION_PARAM_URL_EXT = "http://hl7.org/fhir/tools/CodeSystem/ig-parameters"; 055 public static final String EXT_IG_DEFINITION_RESOURCE_PROFILE = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ImplementationGuide.definition.resource.profile"; 056 public static final String EXT_IG_DEPENDSON_REASON = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ImplementationGuide.dependsOn.reason"; 057 public static final String EXT_MED_CONT = "http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.container"; 058 public static final String EXT_MED_ISBRAND = "http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.isBrand"; 059 public static final String EXT_MED_PACK_AMOUNT = "http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content.amount"; 060 public static final String EXT_MED_PACK_CONT = "http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content"; 061 public static final String EXT_MUST_VALUE = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue"; 062 public static final String EXT_NAMINGSYSTEM_TITLE = "http://hl7.org/fhir/5.0/StructureDefinition/extension-NamingSystem.title"; 063 public static final String EXT_NAMINGSYSTEM_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-NamingSystem.url"; 064 public static final String EXT_NAMINGSYSTEM_VERSION = "http://hl7.org/fhir/5.0/StructureDefinition/extension-NamingSystem.version"; 065 public static final String EXT_OLD_CONCEPTMAP_EQUIVALENCE = "http://hl7.org/fhir/1.0/StructureDefinition/extension-ConceptMap.element.target.equivalence"; 066 public static final String EXT_OPDEF_ORIGINAL_TYPE = "http://hl7.org/fhir/4.0/StructureDefinition/extension-OperationDefinition.parameter.type"; 067 public static final String EXT_PAT_ANIMAL = "http://hl7.org/fhir/StructureDefinition/patient-animal"; 068 public static final String EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL = ToolingExtensions.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL; 069 public static final String EXT_VALUE_ALT = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives"; 070 public static final String EXT_VS_EXP_PROP = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ValueSet.expansion.property"; 071 public static final String EXT_VS_EXTENSIBLE = "http://hl7.org/fhir/1.0/StructureDefinition/extension-ValueSet.extensible"; 072 public static final String EXT_NOT_GIVEN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-Immunization.notGiven"; 073 public static final String EXT_IG_DEPENDSON_PACKAGE_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ImplementationGuide.dependsOn.packageId"; 074 public static final String EXT_MED_REQ_ONBEHALF = "http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationRequest.requester.onBehalfOf"; 075 public static final String EXT_COM_REQ_ONBEHALF = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CommunicationRequest.requester.onBehalfOf"; 076 public static final String EXT_DOC_REF_CREATED = "http://hl7.org/fhir/3.0/StructureDefinition/extension-DocumentReference.created"; 077 078 public static String refToVS(String url) { 079 if (url == null) 080 return null; 081 if (url.equals("http://www.genenames.org")) 082 return "http://hl7.org/fhir/ValueSet/genenames"; 083 else if (url.equals("http://varnomen.hgvs.org/")) 084 return "http://hl7.org/fhir/ValueSet/variants"; 085 else if (url.equals("http://www.ncbi.nlm.nih.gov/nuccore?db=nuccore")) 086 return "http://hl7.org/fhir/ValueSet/ref-sequences"; 087 else if (url.equals("http://www.ensembl.org/")) 088 return "http://hl7.org/fhir/ValueSet/ensembl"; 089 else if (url.equals("http://www.ncbi.nlm.nih.gov/clinvar/variation")) 090 return "http://hl7.org/fhir/ValueSet/clinvar"; 091 else if (url.equals("http://cancer.sanger.ac.uk/cancergenome/projects/cosmic/")) 092 return "http://hl7.org/fhir/ValueSet/cosmic"; 093 else if (url.equals("http://www.ncbi.nlm.nih.gov/projects/SNP/")) 094 return "http://hl7.org/fhir/ValueSet/bbsnp"; 095 else if (url.equals("http://www.sequenceontology.org/")) 096 return "http://hl7.org/fhir/ValueSet/sequenceontology"; 097 else if (url.equals("http://www.ebi.ac.uk/")) 098 return "http://hl7.org/fhir/ValueSet/allelename"; 099 else if (url.equals("https://www.iso.org/iso-4217-currency-codes.html")) 100 return "http://hl7.org/fhir/ValueSet/currencies"; 101 else if (url.equals("http://www.rfc-editor.org/bcp/bcp13.txt")) 102 return "http://hl7.org/fhir/ValueSet/mimetypes"; 103 else 104 return url; 105 } 106 107 public static String vsToRef(String url) { 108 if (url == null) 109 return null; 110 if (url.equals("http://hl7.org/fhir/ValueSet/genenames")) 111 return "http://www.genenames.org"; 112 else if (url.equals("http://hl7.org/fhir/ValueSet/variants")) 113 return "http://varnomen.hgvs.org/"; 114 else if (url.equals("http://hl7.org/fhir/ValueSet/ref-sequences")) 115 return "http://www.ncbi.nlm.nih.gov/nuccore?db=nuccore"; 116 else if (url.equals("http://hl7.org/fhir/ValueSet/ensembl")) 117 return "http://www.ensembl.org/"; 118 else if (url.equals("http://hl7.org/fhir/ValueSet/clinvar")) 119 return "http://www.ncbi.nlm.nih.gov/clinvar/variation"; 120 else if (url.equals("http://hl7.org/fhir/ValueSet/cosmic")) 121 return "http://cancer.sanger.ac.uk/cancergenome/projects/cosmic/"; 122 else if (url.equals("http://hl7.org/fhir/ValueSet/bbsnp")) 123 return "http://www.ncbi.nlm.nih.gov/projects/SNP/"; 124 else if (url.equals("http://hl7.org/fhir/ValueSet/sequenceontology")) 125 return "http://www.sequenceontology.org/"; 126 else if (url.equals("http://hl7.org/fhir/ValueSet/allelename")) 127 return "http://www.ebi.ac.uk/"; 128 else if (url.equals("http://hl7.org/fhir/ValueSet/currencies")) 129 return "https://www.iso.org/iso-4217-currency-codes.html"; 130 else if (url.equals("http://hl7.org/fhir/ValueSet/mimetypes")) 131 return "http://www.rfc-editor.org/bcp/bcp13.txt"; 132 else 133 return null; 134 } 135 136 137}