001package org.hl7.fhir.convertors.conv10_30.resources10_30;
002
003import org.hl7.fhir.convertors.context.ConversionContext10_30;
004import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
005import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
006import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
007import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Timing10_30;
008import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30;
009import org.hl7.fhir.exceptions.FHIRException;
010
011public class DeviceMetric10_30 {
012
013  public static org.hl7.fhir.dstu2.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.dstu3.model.DeviceMetric src) throws FHIRException {
014    if (src == null || src.isEmpty())
015      return null;
016    org.hl7.fhir.dstu2.model.DeviceMetric tgt = new org.hl7.fhir.dstu2.model.DeviceMetric();
017    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
018    if (src.hasType())
019      tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
020    if (src.hasIdentifier())
021      tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
022    if (src.hasUnit())
023      tgt.setUnit(CodeableConcept10_30.convertCodeableConcept(src.getUnit()));
024    if (src.hasSource())
025      tgt.setSource(Reference10_30.convertReference(src.getSource()));
026    if (src.hasParent())
027      tgt.setParent(Reference10_30.convertReference(src.getParent()));
028    if (src.hasOperationalStatus())
029      tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement()));
030    if (src.hasColor())
031      tgt.setColorElement(convertDeviceMetricColor(src.getColorElement()));
032    if (src.hasCategory())
033      tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement()));
034    if (src.hasMeasurementPeriod())
035      tgt.setMeasurementPeriod(Timing10_30.convertTiming(src.getMeasurementPeriod()));
036    for (org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration())
037      tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
038    return tgt;
039  }
040
041  public static org.hl7.fhir.dstu3.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.dstu2.model.DeviceMetric src) throws FHIRException {
042    if (src == null || src.isEmpty())
043      return null;
044    org.hl7.fhir.dstu3.model.DeviceMetric tgt = new org.hl7.fhir.dstu3.model.DeviceMetric();
045    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
046    if (src.hasType())
047      tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
048    if (src.hasIdentifier())
049      tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
050    if (src.hasUnit())
051      tgt.setUnit(CodeableConcept10_30.convertCodeableConcept(src.getUnit()));
052    if (src.hasSource())
053      tgt.setSource(Reference10_30.convertReference(src.getSource()));
054    if (src.hasParent())
055      tgt.setParent(Reference10_30.convertReference(src.getParent()));
056    if (src.hasOperationalStatus())
057      tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement()));
058    if (src.hasColor())
059      tgt.setColorElement(convertDeviceMetricColor(src.getColorElement()));
060    if (src.hasCategory())
061      tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement()));
062    if (src.hasMeasurementPeriod())
063      tgt.setMeasurementPeriod(Timing10_30.convertTiming(src.getMeasurementPeriod()));
064    for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration())
065      tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
066    return tgt;
067  }
068
069  public static org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
070    if (src == null || src.isEmpty())
071      return null;
072    org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent();
073    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
074    if (src.hasType())
075      tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement()));
076    if (src.hasState())
077      tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement()));
078    if (src.hasTimeElement())
079      tgt.setTimeElement(Instant10_30.convertInstant(src.getTimeElement()));
080    return tgt;
081  }
082
083  public static org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
084    if (src == null || src.isEmpty())
085      return null;
086    org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent();
087    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
088    if (src.hasType())
089      tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement()));
090    if (src.hasState())
091      tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement()));
092    if (src.hasTimeElement())
093      tgt.setTimeElement(Instant10_30.convertInstant(src.getTimeElement()));
094    return tgt;
095  }
096
097  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> convertDeviceMetricCalibrationState(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> src) throws FHIRException {
098    if (src == null || src.isEmpty())
099      return null;
100    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
101    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
102    switch (src.getValue()) {
103      case NOTCALIBRATED:
104        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED);
105        break;
106      case CALIBRATIONREQUIRED:
107        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED);
108        break;
109      case CALIBRATED:
110        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED);
111        break;
112      case UNSPECIFIED:
113        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED);
114        break;
115      default:
116        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NULL);
117        break;
118    }
119    return tgt;
120  }
121
122  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> convertDeviceMetricCalibrationState(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> src) throws FHIRException {
123    if (src == null || src.isEmpty())
124      return null;
125    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
126    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
127    switch (src.getValue()) {
128      case NOTCALIBRATED:
129        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED);
130        break;
131      case CALIBRATIONREQUIRED:
132        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED);
133        break;
134      case CALIBRATED:
135        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED);
136        break;
137      case UNSPECIFIED:
138        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED);
139        break;
140      default:
141        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NULL);
142        break;
143    }
144    return tgt;
145  }
146
147  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> convertDeviceMetricCalibrationType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> src) throws FHIRException {
148    if (src == null || src.isEmpty())
149      return null;
150    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
151    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
152    switch (src.getValue()) {
153      case UNSPECIFIED:
154        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED);
155        break;
156      case OFFSET:
157        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET);
158        break;
159      case GAIN:
160        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.GAIN);
161        break;
162      case TWOPOINT:
163        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT);
164        break;
165      default:
166        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.NULL);
167        break;
168    }
169    return tgt;
170  }
171
172  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> convertDeviceMetricCalibrationType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> src) throws FHIRException {
173    if (src == null || src.isEmpty())
174      return null;
175    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
176    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
177    switch (src.getValue()) {
178      case UNSPECIFIED:
179        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED);
180        break;
181      case OFFSET:
182        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET);
183        break;
184      case GAIN:
185        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.GAIN);
186        break;
187      case TWOPOINT:
188        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT);
189        break;
190      default:
191        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.NULL);
192        break;
193    }
194    return tgt;
195  }
196
197  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> convertDeviceMetricCategory(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> src) throws FHIRException {
198    if (src == null || src.isEmpty())
199      return null;
200    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategoryEnumFactory());
201    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
202    switch (src.getValue()) {
203      case MEASUREMENT:
204        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT);
205        break;
206      case SETTING:
207        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.SETTING);
208        break;
209      case CALCULATION:
210        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.CALCULATION);
211        break;
212      case UNSPECIFIED:
213        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED);
214        break;
215      default:
216        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.NULL);
217        break;
218    }
219    return tgt;
220  }
221
222  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> convertDeviceMetricCategory(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> src) throws FHIRException {
223    if (src == null || src.isEmpty())
224      return null;
225    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategoryEnumFactory());
226    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
227    switch (src.getValue()) {
228      case MEASUREMENT:
229        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT);
230        break;
231      case SETTING:
232        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.SETTING);
233        break;
234      case CALCULATION:
235        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.CALCULATION);
236        break;
237      case UNSPECIFIED:
238        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED);
239        break;
240      default:
241        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.NULL);
242        break;
243    }
244    return tgt;
245  }
246
247  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> convertDeviceMetricColor(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> src) throws FHIRException {
248    if (src == null || src.isEmpty())
249      return null;
250    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColorEnumFactory());
251    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
252    switch (src.getValue()) {
253      case BLACK:
254        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLACK);
255        break;
256      case RED:
257        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.RED);
258        break;
259      case GREEN:
260        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.GREEN);
261        break;
262      case YELLOW:
263        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.YELLOW);
264        break;
265      case BLUE:
266        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLUE);
267        break;
268      case MAGENTA:
269        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.MAGENTA);
270        break;
271      case CYAN:
272        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.CYAN);
273        break;
274      case WHITE:
275        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.WHITE);
276        break;
277      default:
278        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.NULL);
279        break;
280    }
281    return tgt;
282  }
283
284  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> convertDeviceMetricColor(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> src) throws FHIRException {
285    if (src == null || src.isEmpty())
286      return null;
287    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColorEnumFactory());
288    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
289    switch (src.getValue()) {
290      case BLACK:
291        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLACK);
292        break;
293      case RED:
294        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.RED);
295        break;
296      case GREEN:
297        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.GREEN);
298        break;
299      case YELLOW:
300        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.YELLOW);
301        break;
302      case BLUE:
303        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLUE);
304        break;
305      case MAGENTA:
306        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.MAGENTA);
307        break;
308      case CYAN:
309        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.CYAN);
310        break;
311      case WHITE:
312        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.WHITE);
313        break;
314      default:
315        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.NULL);
316        break;
317    }
318    return tgt;
319  }
320
321  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> src) throws FHIRException {
322    if (src == null || src.isEmpty())
323      return null;
324    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
325    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
326    switch (src.getValue()) {
327      case ON:
328        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.ON);
329        break;
330      case OFF:
331        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.OFF);
332        break;
333      case STANDBY:
334        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY);
335        break;
336      default:
337        tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.NULL);
338        break;
339    }
340    return tgt;
341  }
342
343  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> src) throws FHIRException {
344    if (src == null || src.isEmpty())
345      return null;
346    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
347    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
348    switch (src.getValue()) {
349      case ON:
350        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.ON);
351        break;
352      case OFF:
353        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.OFF);
354        break;
355      case STANDBY:
356        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY);
357        break;
358      default:
359        tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.NULL);
360        break;
361    }
362    return tgt;
363  }
364}