001package org.hl7.fhir.dstu3.model.codesystems; 002 003/*- 004 * #%L 005 * org.hl7.fhir.dstu3 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 024/* 025 Copyright (c) 2011+, HL7, Inc. 026 All rights reserved. 027 028 Redistribution and use in source and binary forms, with or without modification, 029 are permitted provided that the following conditions are met: 030 031 * Redistributions of source code must retain the above copyright notice, this 032 list of conditions and the following disclaimer. 033 * Redistributions in binary form must reproduce the above copyright notice, 034 this list of conditions and the following disclaimer in the documentation 035 and/or other materials provided with the distribution. 036 * Neither the name of HL7 nor the names of its contributors may be used to 037 endorse or promote products derived from this software without specific 038 prior written permission. 039 040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 041 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 042 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 043 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 044 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 045 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 046 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 047 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 048 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 049 POSSIBILITY OF SUCH DAMAGE. 050 051*/ 052 053// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0 054 055 056import org.hl7.fhir.exceptions.FHIRException; 057 058public enum MessageEvents { 059 060 /** 061 * The definition of a code system is used to create a simple collection of codes suitable for use for data entry or validation. An expanded code system will be returned, or an error message. 062 */ 063 CODESYSTEMEXPAND, 064 /** 065 * Change the status of a Medication Administration to show that it is complete. 066 */ 067 MEDICATIONADMINISTRATIONCOMPLETE, 068 /** 069 * Someone wishes to record that the record of administration of a medication is in error and should be ignored. 070 */ 071 MEDICATIONADMINISTRATIONNULLIFICATION, 072 /** 073 * Indicates that a medication has been recorded against the patient's record. 074 */ 075 MEDICATIONADMINISTRATIONRECORDING, 076 /** 077 * Update a Medication Administration record. 078 */ 079 MEDICATIONADMINISTRATIONUPDATE, 080 /** 081 * Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use. 082 */ 083 ADMINNOTIFY, 084 /** 085 * Notification to convey information. 086 */ 087 COMMUNICATIONREQUEST, 088 /** 089 * Provide a diagnostic report, or update a previously provided diagnostic report. 090 */ 091 DIAGNOSTICREPORTPROVIDE, 092 /** 093 * Provide a simple observation or update a previously provided simple observation. 094 */ 095 OBSERVATIONPROVIDE, 096 /** 097 * Notification that two patient records actually identify the same patient. 098 */ 099 PATIENTLINK, 100 /** 101 * Notification that previous advice that two patient records concern the same patient is now considered incorrect. 102 */ 103 PATIENTUNLINK, 104 /** 105 * The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message. 106 */ 107 VALUESETEXPAND, 108 /** 109 * added to help the parsers 110 */ 111 NULL; 112 public static MessageEvents fromCode(String codeString) throws FHIRException { 113 if (codeString == null || "".equals(codeString)) 114 return null; 115 if ("CodeSystem-expand".equals(codeString)) 116 return CODESYSTEMEXPAND; 117 if ("MedicationAdministration-Complete".equals(codeString)) 118 return MEDICATIONADMINISTRATIONCOMPLETE; 119 if ("MedicationAdministration-Nullification".equals(codeString)) 120 return MEDICATIONADMINISTRATIONNULLIFICATION; 121 if ("MedicationAdministration-Recording".equals(codeString)) 122 return MEDICATIONADMINISTRATIONRECORDING; 123 if ("MedicationAdministration-Update".equals(codeString)) 124 return MEDICATIONADMINISTRATIONUPDATE; 125 if ("admin-notify".equals(codeString)) 126 return ADMINNOTIFY; 127 if ("communication-request".equals(codeString)) 128 return COMMUNICATIONREQUEST; 129 if ("diagnosticreport-provide".equals(codeString)) 130 return DIAGNOSTICREPORTPROVIDE; 131 if ("observation-provide".equals(codeString)) 132 return OBSERVATIONPROVIDE; 133 if ("patient-link".equals(codeString)) 134 return PATIENTLINK; 135 if ("patient-unlink".equals(codeString)) 136 return PATIENTUNLINK; 137 if ("valueset-expand".equals(codeString)) 138 return VALUESETEXPAND; 139 throw new FHIRException("Unknown MessageEvents code '"+codeString+"'"); 140 } 141 public String toCode() { 142 switch (this) { 143 case CODESYSTEMEXPAND: return "CodeSystem-expand"; 144 case MEDICATIONADMINISTRATIONCOMPLETE: return "MedicationAdministration-Complete"; 145 case MEDICATIONADMINISTRATIONNULLIFICATION: return "MedicationAdministration-Nullification"; 146 case MEDICATIONADMINISTRATIONRECORDING: return "MedicationAdministration-Recording"; 147 case MEDICATIONADMINISTRATIONUPDATE: return "MedicationAdministration-Update"; 148 case ADMINNOTIFY: return "admin-notify"; 149 case COMMUNICATIONREQUEST: return "communication-request"; 150 case DIAGNOSTICREPORTPROVIDE: return "diagnosticreport-provide"; 151 case OBSERVATIONPROVIDE: return "observation-provide"; 152 case PATIENTLINK: return "patient-link"; 153 case PATIENTUNLINK: return "patient-unlink"; 154 case VALUESETEXPAND: return "valueset-expand"; 155 default: return "?"; 156 } 157 } 158 public String getSystem() { 159 return "http://hl7.org/fhir/message-events"; 160 } 161 public String getDefinition() { 162 switch (this) { 163 case CODESYSTEMEXPAND: return "The definition of a code system is used to create a simple collection of codes suitable for use for data entry or validation. An expanded code system will be returned, or an error message."; 164 case MEDICATIONADMINISTRATIONCOMPLETE: return "Change the status of a Medication Administration to show that it is complete."; 165 case MEDICATIONADMINISTRATIONNULLIFICATION: return "Someone wishes to record that the record of administration of a medication is in error and should be ignored."; 166 case MEDICATIONADMINISTRATIONRECORDING: return "Indicates that a medication has been recorded against the patient's record."; 167 case MEDICATIONADMINISTRATIONUPDATE: return "Update a Medication Administration record."; 168 case ADMINNOTIFY: return "Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use."; 169 case COMMUNICATIONREQUEST: return "Notification to convey information."; 170 case DIAGNOSTICREPORTPROVIDE: return "Provide a diagnostic report, or update a previously provided diagnostic report."; 171 case OBSERVATIONPROVIDE: return "Provide a simple observation or update a previously provided simple observation."; 172 case PATIENTLINK: return "Notification that two patient records actually identify the same patient."; 173 case PATIENTUNLINK: return "Notification that previous advice that two patient records concern the same patient is now considered incorrect."; 174 case VALUESETEXPAND: return "The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message."; 175 default: return "?"; 176 } 177 } 178 public String getDisplay() { 179 switch (this) { 180 case CODESYSTEMEXPAND: return "CodeSystem-expand"; 181 case MEDICATIONADMINISTRATIONCOMPLETE: return "MedicationAdministration-Complete"; 182 case MEDICATIONADMINISTRATIONNULLIFICATION: return "MedicationAdministration-Nullification"; 183 case MEDICATIONADMINISTRATIONRECORDING: return "MedicationAdministration-Recording"; 184 case MEDICATIONADMINISTRATIONUPDATE: return "MedicationAdministration-Update"; 185 case ADMINNOTIFY: return "admin-notify"; 186 case COMMUNICATIONREQUEST: return "communication-request"; 187 case DIAGNOSTICREPORTPROVIDE: return "diagnosticreport-provide"; 188 case OBSERVATIONPROVIDE: return "observation-provide"; 189 case PATIENTLINK: return "patient-link"; 190 case PATIENTUNLINK: return "patient-unlink"; 191 case VALUESETEXPAND: return "valueset-expand"; 192 default: return "?"; 193 } 194 } 195 196 197} 198