|
1 |
| -package org.hl7.fhir.convertors; |
2 |
| - |
3 |
| -/*- |
4 |
| - * #%L |
5 |
| - * HAPI FHIR - Converter |
6 |
| - * %% |
7 |
| - * Copyright (C) 2014 - 2018 University Health Network |
8 |
| - * %% |
9 |
| - * Licensed under the Apache License, Version 2.0 (the "License"); |
10 |
| - * you may not use this file except in compliance with the License. |
11 |
| - * You may obtain a copy of the License at |
12 |
| - * |
13 |
| - * http://www.apache.org/licenses/LICENSE-2.0 |
14 |
| - * |
15 |
| - * Unless required by applicable law or agreed to in writing, software |
16 |
| - * distributed under the License is distributed on an "AS IS" BASIS, |
17 |
| - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
18 |
| - * See the License for the specific language governing permissions and |
19 |
| - * limitations under the License. |
20 |
| - * #L% |
21 |
| - */ |
22 |
| - |
23 |
| - |
24 |
| -import org.hl7.fhir.utilities.Utilities; |
25 |
| - |
26 |
| -public class VersionConvertorConstants { |
27 |
| - |
28 |
| - public final static String IG_DEPENDSON_PACKAGE_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ImplentationGuide.dependency.packageId"; |
29 |
| - public final static String IG_DEPENDSON_VERSION_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ImplentationGuide.dependency.version"; |
30 |
| - public final static String MODIFIER_REASON_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ElementDefinition.isModifierReason"; |
31 |
| - public final static String MODIFIER_REASON_LEGACY = "No Modifier Reason provideed in previous versions of FHIR"; |
32 |
| - |
33 |
| - public static String refToVS(String url) { |
34 |
| - if (url == null) |
35 |
| - return null; |
36 |
| - if (url.equals("http://www.genenames.org")) |
37 |
| - return "http://hl7.org/fhir/ValueSet/genenames"; |
38 |
| - else if (url.equals("http://varnomen.hgvs.org/")) |
39 |
| - return "http://hl7.org/fhir/ValueSet/variants"; |
40 |
| - else if (url.equals("http://www.ncbi.nlm.nih.gov/nuccore?db=nuccore")) |
41 |
| - return "http://hl7.org/fhir/ValueSet/ref-sequences"; |
42 |
| - else if (url.equals("http://www.ensembl.org/")) |
43 |
| - return "http://hl7.org/fhir/ValueSet/ensembl"; |
44 |
| - else if (url.equals("http://www.ncbi.nlm.nih.gov/clinvar/variation")) |
45 |
| - return "http://hl7.org/fhir/ValueSet/clinvar"; |
46 |
| - else if (url.equals("http://cancer.sanger.ac.uk/cancergenome/projects/cosmic/")) |
47 |
| - return "http://hl7.org/fhir/ValueSet/cosmic"; |
48 |
| - else if (url.equals("http://www.ncbi.nlm.nih.gov/projects/SNP/")) |
49 |
| - return "http://hl7.org/fhir/ValueSet/bbsnp"; |
50 |
| - else if (url.equals("http://www.sequenceontology.org/")) |
51 |
| - return "http://hl7.org/fhir/ValueSet/sequenceontology"; |
52 |
| - else if (url.equals("http://www.ebi.ac.uk/")) |
53 |
| - return "http://hl7.org/fhir/ValueSet/allelename"; |
54 |
| - else if (url.equals("https://www.iso.org/iso-4217-currency-codes.html")) |
55 |
| - return "http://hl7.org/fhir/ValueSet/currencies"; |
56 |
| - else if (url.equals("http://www.rfc-editor.org/bcp/bcp13.txt")) |
57 |
| - return "http://hl7.org/fhir/ValueSet/mimetypes"; |
58 |
| - else |
59 |
| - return url; |
60 |
| - } |
61 |
| - |
62 |
| - public static String vsToRef(String url) { |
63 |
| - if (url == null) |
64 |
| - return null; |
65 |
| - if (url.equals("http://hl7.org/fhir/ValueSet/genenames")) |
66 |
| - return "http://www.genenames.org"; |
67 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/variants")) |
68 |
| - return "http://varnomen.hgvs.org/"; |
69 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/ref-sequences")) |
70 |
| - return "http://www.ncbi.nlm.nih.gov/nuccore?db=nuccore"; |
71 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/ensembl")) |
72 |
| - return "http://www.ensembl.org/"; |
73 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/clinvar")) |
74 |
| - return "http://www.ncbi.nlm.nih.gov/clinvar/variation"; |
75 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/cosmic")) |
76 |
| - return "http://cancer.sanger.ac.uk/cancergenome/projects/cosmic/"; |
77 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/bbsnp")) |
78 |
| - return "http://www.ncbi.nlm.nih.gov/projects/SNP/"; |
79 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/sequenceontology")) |
80 |
| - return "http://www.sequenceontology.org/"; |
81 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/allelename")) |
82 |
| - return "http://www.ebi.ac.uk/"; |
83 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/currencies")) |
84 |
| - return "https://www.iso.org/iso-4217-currency-codes.html"; |
85 |
| - else if (url.equals("http://hl7.org/fhir/ValueSet/mimetypes")) |
86 |
| - return "http://www.rfc-editor.org/bcp/bcp13.txt"; |
87 |
| - else |
88 |
| - return null; |
89 |
| - } |
90 |
| -} |
| 1 | +package org.hl7.fhir.convertors; |
| 2 | + |
| 3 | +public class VersionConvertorConstants { |
| 4 | + |
| 5 | + public final static String IG_DEPENDSON_PACKAGE_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ImplentationGuide.dependency.packageId"; |
| 6 | + public final static String IG_DEPENDSON_VERSION_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ImplentationGuide.dependency.version"; |
| 7 | + public final static String MODIFIER_REASON_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ElementDefinition.isModifierReason"; |
| 8 | + public final static String MODIFIER_TAKEN = "http://hl7.org/fhir/4.0/StructureDefinition/extension-MedicationStatment.taken"; |
| 9 | + public final static String MODIFIER_REASON_LEGACY = "No Modifier Reason provideed in previous versions of FHIR"; |
| 10 | + |
| 11 | + public static String refToVS(String url) { |
| 12 | + if (url == null) |
| 13 | + return null; |
| 14 | + if (url.equals("http://www.genenames.org")) |
| 15 | + return "http://hl7.org/fhir/ValueSet/genenames"; |
| 16 | + else if (url.equals("http://varnomen.hgvs.org/")) |
| 17 | + return "http://hl7.org/fhir/ValueSet/variants"; |
| 18 | + else if (url.equals("http://www.ncbi.nlm.nih.gov/nuccore?db=nuccore")) |
| 19 | + return "http://hl7.org/fhir/ValueSet/ref-sequences"; |
| 20 | + else if (url.equals("http://www.ensembl.org/")) |
| 21 | + return "http://hl7.org/fhir/ValueSet/ensembl"; |
| 22 | + else if (url.equals("http://www.ncbi.nlm.nih.gov/clinvar/variation")) |
| 23 | + return "http://hl7.org/fhir/ValueSet/clinvar"; |
| 24 | + else if (url.equals("http://cancer.sanger.ac.uk/cancergenome/projects/cosmic/")) |
| 25 | + return "http://hl7.org/fhir/ValueSet/cosmic"; |
| 26 | + else if (url.equals("http://www.ncbi.nlm.nih.gov/projects/SNP/")) |
| 27 | + return "http://hl7.org/fhir/ValueSet/bbsnp"; |
| 28 | + else if (url.equals("http://www.sequenceontology.org/")) |
| 29 | + return "http://hl7.org/fhir/ValueSet/sequenceontology"; |
| 30 | + else if (url.equals("http://www.ebi.ac.uk/")) |
| 31 | + return "http://hl7.org/fhir/ValueSet/allelename"; |
| 32 | + else if (url.equals("https://www.iso.org/iso-4217-currency-codes.html")) |
| 33 | + return "http://hl7.org/fhir/ValueSet/currencies"; |
| 34 | + else if (url.equals("http://www.rfc-editor.org/bcp/bcp13.txt")) |
| 35 | + return "http://hl7.org/fhir/ValueSet/mimetypes"; |
| 36 | + else |
| 37 | + return url; |
| 38 | + } |
| 39 | + |
| 40 | + public static String vsToRef(String url) { |
| 41 | + if (url == null) |
| 42 | + return null; |
| 43 | + if (url.equals("http://hl7.org/fhir/ValueSet/genenames")) |
| 44 | + return "http://www.genenames.org"; |
| 45 | + else if (url.equals("http://hl7.org/fhir/ValueSet/variants")) |
| 46 | + return "http://varnomen.hgvs.org/"; |
| 47 | + else if (url.equals("http://hl7.org/fhir/ValueSet/ref-sequences")) |
| 48 | + return "http://www.ncbi.nlm.nih.gov/nuccore?db=nuccore"; |
| 49 | + else if (url.equals("http://hl7.org/fhir/ValueSet/ensembl")) |
| 50 | + return "http://www.ensembl.org/"; |
| 51 | + else if (url.equals("http://hl7.org/fhir/ValueSet/clinvar")) |
| 52 | + return "http://www.ncbi.nlm.nih.gov/clinvar/variation"; |
| 53 | + else if (url.equals("http://hl7.org/fhir/ValueSet/cosmic")) |
| 54 | + return "http://cancer.sanger.ac.uk/cancergenome/projects/cosmic/"; |
| 55 | + else if (url.equals("http://hl7.org/fhir/ValueSet/bbsnp")) |
| 56 | + return "http://www.ncbi.nlm.nih.gov/projects/SNP/"; |
| 57 | + else if (url.equals("http://hl7.org/fhir/ValueSet/sequenceontology")) |
| 58 | + return "http://www.sequenceontology.org/"; |
| 59 | + else if (url.equals("http://hl7.org/fhir/ValueSet/allelename")) |
| 60 | + return "http://www.ebi.ac.uk/"; |
| 61 | + else if (url.equals("http://hl7.org/fhir/ValueSet/currencies")) |
| 62 | + return "https://www.iso.org/iso-4217-currency-codes.html"; |
| 63 | + else if (url.equals("http://hl7.org/fhir/ValueSet/mimetypes")) |
| 64 | + return "http://www.rfc-editor.org/bcp/bcp13.txt"; |
| 65 | + else |
| 66 | + return null; |
| 67 | + } |
| 68 | +} |
0 commit comments