001package org.hl7.fhir.convertors.conv30_50.resources30_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_50;
004import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50;
005import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50;
006import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Coding30_50;
007import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50;
008import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Base64Binary30_50;
009import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50;
010import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50;
011import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50;
012import org.hl7.fhir.exceptions.FHIRException;
013import org.hl7.fhir.r5.model.AuditEvent;
014import org.hl7.fhir.r5.model.CodeableConcept;
015import org.hl7.fhir.r5.model.Enumeration;
016
017public class AuditEvent30_50 {
018
019  public static org.hl7.fhir.r5.model.AuditEvent convertAuditEvent(org.hl7.fhir.dstu3.model.AuditEvent src) throws FHIRException {
020    if (src == null)
021      return null;
022    org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent();
023    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
024    if (src.hasType())
025      tgt.getCategoryFirstRep().addCoding(Coding30_50.convertCoding(src.getType()));
026    for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.getCode().addCoding(Coding30_50.convertCoding(t));
027    if (src.hasAction())
028      tgt.setActionElement(convertAuditEventAction(src.getActionElement()));
029    if (src.hasRecorded())
030      tgt.setRecordedElement(Instant30_50.convertInstant(src.getRecordedElement()));
031    if (src.hasOutcome())
032      tgt.getOutcome().getCode().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getOutcome().toCode());
033    if (src.hasOutcomeDesc())
034      tgt.getOutcome().getDetailFirstRep().setTextElement(String30_50.convertString(src.getOutcomeDescElement()));
035    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent())
036      tgt.addAuthorization(CodeableConcept30_50.convertCodeableConcept(t));
037    for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
038      tgt.addAgent(convertAuditEventAgentComponent(t));
039    if (src.hasSource())
040      tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
041    for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity())
042      tgt.addEntity(convertAuditEventEntityComponent(t));
043    return tgt;
044  }
045
046  public static org.hl7.fhir.dstu3.model.AuditEvent convertAuditEvent(org.hl7.fhir.r5.model.AuditEvent src) throws FHIRException {
047    if (src == null)
048      return null;
049    org.hl7.fhir.dstu3.model.AuditEvent tgt = new org.hl7.fhir.dstu3.model.AuditEvent();
050    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
051    if (src.getCategoryFirstRep().hasCoding()) {
052      tgt.setType(Coding30_50.convertCoding(src.getCategoryFirstRep().getCodingFirstRep()));
053    }
054    for (org.hl7.fhir.r5.model.Coding t : src.getCode().getCoding()) tgt.addSubtype(Coding30_50.convertCoding(t));
055    if (src.hasAction())
056      tgt.setActionElement(convertAuditEventAction(src.getActionElement()));
057    if (src.hasRecorded())
058      tgt.setRecordedElement(Instant30_50.convertInstant(src.getRecordedElement()));
059    if (src.hasOutcome() && "http://terminology.hl7.org/CodeSystem/audit-event-outcome".equals(src.getOutcome().getCode().getSystem()))
060      tgt.getOutcomeElement().setValueAsString(src.getOutcome().getCode().getCode());
061    if (src.getOutcome().getDetailFirstRep().hasText())
062      tgt.setOutcomeDescElement(String30_50.convertString(src.getOutcome().getDetailFirstRep().getTextElement()));
063    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
064      tgt.addPurposeOfEvent(CodeableConcept30_50.convertCodeableConcept(t));
065    for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
066      tgt.addAgent(convertAuditEventAgentComponent(t));
067    if (src.hasSource())
068      tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
069    for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity())
070      tgt.addEntity(convertAuditEventEntityComponent(t));
071    return tgt;
072  }
073
074  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAction> convertAuditEventAction(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> src) throws FHIRException {
075      if (src == null || src.isEmpty())
076          return null;
077      Enumeration<AuditEvent.AuditEventAction> tgt = new Enumeration<>(new AuditEvent.AuditEventActionEnumFactory());
078      ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
079      if (src.getValue() == null) {
080          tgt.setValue(null);
081      } else {
082          switch (src.getValue()) {
083              case C:
084                  tgt.setValue(AuditEvent.AuditEventAction.C);
085                  break;
086              case R:
087                  tgt.setValue(AuditEvent.AuditEventAction.R);
088                  break;
089              case U:
090                  tgt.setValue(AuditEvent.AuditEventAction.U);
091                  break;
092              case D:
093                  tgt.setValue(AuditEvent.AuditEventAction.D);
094                  break;
095              case E:
096                  tgt.setValue(AuditEvent.AuditEventAction.E);
097                  break;
098              default:
099                  tgt.setValue(AuditEvent.AuditEventAction.NULL);
100                  break;
101          }
102      }
103      return tgt;
104  }
105
106  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> convertAuditEventAction(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAction> src) throws FHIRException {
107      if (src == null || src.isEmpty())
108          return null;
109      org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventActionEnumFactory());
110      ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
111      if (src.getValue() == null) {
112          tgt.setValue(null);
113      } else {
114          switch (src.getValue()) {
115              case C:
116                  tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.C);
117                  break;
118              case R:
119                  tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.R);
120                  break;
121              case U:
122                  tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.U);
123                  break;
124              case D:
125                  tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.D);
126                  break;
127              case E:
128                  tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.E);
129                  break;
130              default:
131                  tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.NULL);
132                  break;
133          }
134      }
135      return tgt;
136  }
137
138  public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException {
139    if (src == null)
140      return null;
141    org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent();
142    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
143    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole())
144      tgt.addRole(CodeableConcept30_50.convertCodeableConcept(t));
145    if (src.hasReference())
146      tgt.setWho(Reference30_50.convertReference(src.getReference()));
147    if (src.hasUserId())
148      tgt.getWho().setIdentifier(Identifier30_50.convertIdentifier(src.getUserId()));
149//    if (src.hasAltId())
150//      tgt.setAltIdElement(String30_50.convertString(src.getAltIdElement()));
151//    if (src.hasName())
152//      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
153    if (src.hasRequestor())
154      tgt.setRequestorElement(Boolean30_50.convertBoolean(src.getRequestorElement()));
155    if (src.hasLocation())
156      tgt.setLocation(Reference30_50.convertReference(src.getLocation()));
157    for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
158//    if (src.hasMedia())
159//      tgt.setMedia(Coding30_50.convertCoding(src.getMedia()));
160//    if (src.hasNetwork())
161//      tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
162    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse())
163      tgt.addAuthorization(CodeableConcept30_50.convertCodeableConcept(t));
164    return tgt;
165  }
166
167  public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException {
168    if (src == null)
169      return null;
170    org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent();
171    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
172    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole())
173      tgt.addRole(CodeableConcept30_50.convertCodeableConcept(t));
174    if (src.hasWho()) {
175      if (src.getWho().hasIdentifier())
176        tgt.setUserId(Identifier30_50.convertIdentifier(src.getWho().getIdentifier()));
177      if (src.getWho().hasReference() || src.getWho().hasDisplay() || src.getWho().hasExtension() || src.getWho().hasId())
178        tgt.setReference(Reference30_50.convertReference(src.getWho()));
179    }
180//    if (src.hasAltId())
181//      tgt.setAltIdElement(String30_50.convertString(src.getAltIdElement()));
182//    if (src.hasName())
183//      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
184    if (src.hasRequestor())
185      tgt.setRequestorElement(Boolean30_50.convertBoolean(src.getRequestorElement()));
186    if (src.hasLocation())
187      tgt.setLocation(Reference30_50.convertReference(src.getLocation()));
188    for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
189//    if (src.hasMedia())
190//      tgt.setMedia(Coding30_50.convertCoding(src.getMedia()));
191//    if (src.hasNetwork())
192//      tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
193    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
194      tgt.addPurposeOfUse(CodeableConcept30_50.convertCodeableConcept(t));
195    return tgt;
196  }
197//
198//  public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
199//    if (src == null)
200//      return null;
201//    org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent();
202//    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
203//    if (src.hasAddress())
204//      tgt.setAddressElement(String30_50.convertString(src.getAddressElement()));
205//    if (src.hasType())
206//      tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
207//    return tgt;
208//  }
209
210//  public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
211//    if (src == null)
212//      return null;
213//    org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent();
214//    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
215//    if (src.hasAddress())
216//      tgt.setAddressElement(String30_50.convertString(src.getAddressElement()));
217//    if (src.hasType())
218//      tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
219//    return tgt;
220//  }
221//
222//  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
223//    if (src == null || src.isEmpty())
224//      return null;
225//    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
226//    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
227//    switch (src.getValue()) {
228//      case _1:
229//        tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1);
230//        break;
231//      case _2:
232//        tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2);
233//        break;
234//      case _3:
235//        tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3);
236//        break;
237//      case _4:
238//        tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4);
239//        break;
240//      case _5:
241//        tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5);
242//        break;
243//      default:
244//        tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL);
245//        break;
246//    }
247//    return tgt;
248//  }
249//
250//  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
251//    if (src == null || src.isEmpty())
252//      return null;
253//    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
254//    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
255//    switch (src.getValue()) {
256//      case _1:
257//        tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._1);
258//        break;
259//      case _2:
260//        tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._2);
261//        break;
262//      case _3:
263//        tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._3);
264//        break;
265//      case _4:
266//        tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._4);
267//        break;
268//      case _5:
269//        tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._5);
270//        break;
271//      default:
272//        tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType.NULL);
273//        break;
274//    }
275//    return tgt;
276//  }
277//
278  public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException {
279    if (src == null)
280      return null;
281    org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent();
282    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
283    if (src.hasIdentifier())
284      tgt.getWhat().setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
285    if (src.hasReference())
286      tgt.setWhat(Reference30_50.convertReference(src.getReference()));
287//    if (src.hasType())
288//      tgt.setType(Coding30_50.convertCoding(src.getType()));
289    if (src.hasRole())
290      tgt.getRole().addCoding(Coding30_50.convertCoding(src.getRole()));
291//    if (src.hasLifecycle())
292//      tgt.setLifecycle(Coding30_50.convertCoding(src.getLifecycle()));
293    for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel().addCoding(Coding30_50.convertCoding(t));
294//    if (src.hasName())
295//      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
296    if (src.hasQuery())
297      tgt.setQueryElement(Base64Binary30_50.convertBase64Binary(src.getQueryElement()));
298    for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
299      tgt.addDetail(convertAuditEventEntityDetailComponent(t));
300    return tgt;
301  }
302
303  public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException {
304    if (src == null)
305      return null;
306    org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent();
307    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
308    if (src.hasWhat()) {
309      if (src.getWhat().hasIdentifier())
310        tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getWhat().getIdentifier()));
311      if (src.getWhat().hasReference() || src.getWhat().hasDisplay() || src.getWhat().hasExtension() || src.getWhat().hasId())
312        tgt.setReference(Reference30_50.convertReference(src.getWhat()));
313    }
314//    if (src.hasType())
315//      tgt.setType(Coding30_50.convertCoding(src.getType()));
316    if (src.hasRole())
317      tgt.setRole(Coding30_50.convertCoding(src.getRole()));
318//    if (src.hasLifecycle())
319//      tgt.setLifecycle(Coding30_50.convertCoding(src.getLifecycle()));
320    for (CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding30_50.convertCoding(t.getCodingFirstRep()));
321//    if (src.hasName())
322//      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
323    if (src.hasQuery())
324      tgt.setQueryElement(Base64Binary30_50.convertBase64Binary(src.getQueryElement()));
325    for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
326      tgt.addDetail(convertAuditEventEntityDetailComponent(t));
327    return tgt;
328  }
329
330  public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
331    if (src == null)
332      return null;
333    org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent();
334    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
335    if (src.getType().hasTextElement())
336      tgt.setTypeElement(String30_50.convertString(src.getType().getTextElement()));
337    if (src.hasValueStringType())
338      tgt.setValue(src.getValueStringType().getValue().getBytes());
339    else if (src.hasValueBase64BinaryType())
340      tgt.setValue(src.getValueBase64BinaryType().getValue());
341    return tgt;
342  }
343
344  public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
345    if (src == null)
346      return null;
347    org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent();
348    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
349    if (src.hasType())
350      tgt.getType().setTextElement(String30_50.convertString(src.getTypeElement()));
351    if (src.hasValue())
352      tgt.setValue(new org.hl7.fhir.r5.model.Base64BinaryType(src.getValue()));
353    return tgt;
354  }
355
356
357  public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
358    if (src == null)
359      return null;
360    org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent();
361    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
362//    if (src.hasSite())
363//      tgt.setSiteElement(String30_50.convertString(src.getSiteElement()));
364    if (src.hasObserver())
365      tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getObserver().getIdentifier()));
366    for (CodeableConcept t : src.getType()) tgt.addType(Coding30_50.convertCoding(t.getCodingFirstRep()));
367    return tgt;
368  }
369
370  public static org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
371    if (src == null)
372      return null;
373    org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent();
374    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
375//    if (src.hasSite())
376//      tgt.setSiteElement(String30_50.convertString(src.getSiteElement()));
377    if (src.hasIdentifier())
378      tgt.getObserver().setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
379    for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType().addCoding(Coding30_50.convertCoding(t));
380    return tgt;
381  }
382}