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