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.Attachment10_30;
006import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
007import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Coding10_30;
008import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
009import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30;
010import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
011import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30;
012import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
013import org.hl7.fhir.dstu2.model.CodeableConcept;
014import org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus;
015import org.hl7.fhir.exceptions.FHIRException;
016
017public class DocumentReference10_30 {
018
019  static public ReferredDocumentStatus convertDocStatus(CodeableConcept cc) {
020    if (CodeableConcept10_30.hasConcept(cc, "http://hl7.org/fhir/composition-status", "preliminary"))
021      return ReferredDocumentStatus.PRELIMINARY;
022    if (CodeableConcept10_30.hasConcept(cc, "http://hl7.org/fhir/composition-status", "final"))
023      return ReferredDocumentStatus.FINAL;
024    if (CodeableConcept10_30.hasConcept(cc, "http://hl7.org/fhir/composition-status", "amended"))
025      return ReferredDocumentStatus.AMENDED;
026    if (CodeableConcept10_30.hasConcept(cc, "http://hl7.org/fhir/composition-status", "entered-in-error"))
027      return ReferredDocumentStatus.ENTEREDINERROR;
028    return null;
029  }
030
031  static public CodeableConcept convertDocStatus(ReferredDocumentStatus docStatus) {
032    CodeableConcept cc = new CodeableConcept();
033    switch (docStatus) {
034      case AMENDED:
035        cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("amended");
036        break;
037      case ENTEREDINERROR:
038        cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("entered-in-error");
039        break;
040      case FINAL:
041        cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("final");
042        break;
043      case PRELIMINARY:
044        cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("preliminary");
045        break;
046      default:
047        return null;
048    }
049    return cc;
050  }
051
052  public static org.hl7.fhir.dstu3.model.DocumentReference convertDocumentReference(org.hl7.fhir.dstu2.model.DocumentReference src) throws FHIRException {
053    if (src == null || src.isEmpty())
054      return null;
055    org.hl7.fhir.dstu3.model.DocumentReference tgt = new org.hl7.fhir.dstu3.model.DocumentReference();
056    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
057    if (src.hasMasterIdentifier())
058      tgt.setMasterIdentifier(Identifier10_30.convertIdentifier(src.getMasterIdentifier()));
059    for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
060      tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
061    if (src.hasSubject())
062      tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
063    if (src.hasType())
064      tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
065    if (src.hasClass_())
066      tgt.setClass_(CodeableConcept10_30.convertCodeableConcept(src.getClass_()));
067    for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
068    if (src.hasCustodian())
069      tgt.setCustodian(Reference10_30.convertReference(src.getCustodian()));
070    if (src.hasAuthenticator())
071      tgt.setAuthenticator(Reference10_30.convertReference(src.getAuthenticator()));
072    if (src.hasCreatedElement())
073      tgt.setCreatedElement(DateTime10_30.convertDateTime(src.getCreatedElement()));
074    if (src.hasIndexedElement())
075      tgt.setIndexedElement(Instant10_30.convertInstant(src.getIndexedElement()));
076    if (src.hasStatus())
077      tgt.setStatusElement(convertDocumentReferenceStatus(src.getStatusElement()));
078    if (src.hasDocStatus())
079      tgt.setDocStatus(convertDocStatus(src.getDocStatus()));
080    for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo())
081      tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t));
082    if (src.hasDescriptionElement())
083      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
084    for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSecurityLabel())
085      tgt.addSecurityLabel(CodeableConcept10_30.convertCodeableConcept(t));
086    for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent())
087      tgt.addContent(convertDocumentReferenceContentComponent(t));
088    if (src.hasContext())
089      tgt.setContext(convertDocumentReferenceContextComponent(src.getContext()));
090    return tgt;
091  }
092
093  public static org.hl7.fhir.dstu2.model.DocumentReference convertDocumentReference(org.hl7.fhir.dstu3.model.DocumentReference src) throws FHIRException {
094    if (src == null || src.isEmpty())
095      return null;
096    org.hl7.fhir.dstu2.model.DocumentReference tgt = new org.hl7.fhir.dstu2.model.DocumentReference();
097    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
098    if (src.hasMasterIdentifier())
099      tgt.setMasterIdentifier(Identifier10_30.convertIdentifier(src.getMasterIdentifier()));
100    for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
101      tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
102    if (src.hasSubject())
103      tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
104    if (src.hasType())
105      tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
106    if (src.hasClass_())
107      tgt.setClass_(CodeableConcept10_30.convertCodeableConcept(src.getClass_()));
108    for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
109    if (src.hasCustodian())
110      tgt.setCustodian(Reference10_30.convertReference(src.getCustodian()));
111    if (src.hasAuthenticator())
112      tgt.setAuthenticator(Reference10_30.convertReference(src.getAuthenticator()));
113    if (src.hasCreatedElement())
114      tgt.setCreatedElement(DateTime10_30.convertDateTime(src.getCreatedElement()));
115    if (src.hasIndexedElement())
116      tgt.setIndexedElement(Instant10_30.convertInstant(src.getIndexedElement()));
117    if (src.hasStatus())
118      tgt.setStatusElement(convertDocumentReferenceStatus(src.getStatusElement()));
119    if (src.hasDocStatus())
120      tgt.setDocStatus(convertDocStatus(src.getDocStatus()));
121    for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo())
122      tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t));
123    if (src.hasDescriptionElement())
124      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
125    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel())
126      tgt.addSecurityLabel(CodeableConcept10_30.convertCodeableConcept(t));
127    for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent())
128      tgt.addContent(convertDocumentReferenceContentComponent(t));
129    if (src.hasContext())
130      tgt.setContext(convertDocumentReferenceContextComponent(src.getContext()));
131    return tgt;
132  }
133
134  public static org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException {
135    if (src == null || src.isEmpty())
136      return null;
137    org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent();
138    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
139    if (src.hasAttachment())
140      tgt.setAttachment(Attachment10_30.convertAttachment(src.getAttachment()));
141    if (src.hasFormat())
142      tgt.addFormat(Coding10_30.convertCoding(src.getFormat()));
143    return tgt;
144  }
145
146  public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException {
147    if (src == null || src.isEmpty())
148      return null;
149    org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent();
150    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
151    if (src.hasAttachment())
152      tgt.setAttachment(Attachment10_30.convertAttachment(src.getAttachment()));
153    for (org.hl7.fhir.dstu2.model.Coding t : src.getFormat()) tgt.setFormat(Coding10_30.convertCoding(t));
154    return tgt;
155  }
156
157  public static org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException {
158    if (src == null || src.isEmpty())
159      return null;
160    org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent();
161    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
162    if (src.hasEncounter())
163      tgt.setEncounter(Reference10_30.convertReference(src.getEncounter()));
164    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent())
165      tgt.addEvent(CodeableConcept10_30.convertCodeableConcept(t));
166    if (src.hasPeriod())
167      tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
168    if (src.hasFacilityType())
169      tgt.setFacilityType(CodeableConcept10_30.convertCodeableConcept(src.getFacilityType()));
170    if (src.hasPracticeSetting())
171      tgt.setPracticeSetting(CodeableConcept10_30.convertCodeableConcept(src.getPracticeSetting()));
172    if (src.hasSourcePatientInfo())
173      tgt.setSourcePatientInfo(Reference10_30.convertReference(src.getSourcePatientInfo()));
174    for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated())
175      tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t));
176    return tgt;
177  }
178
179  public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException {
180    if (src == null || src.isEmpty())
181      return null;
182    org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent();
183    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
184    if (src.hasEncounter())
185      tgt.setEncounter(Reference10_30.convertReference(src.getEncounter()));
186    for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getEvent())
187      tgt.addEvent(CodeableConcept10_30.convertCodeableConcept(t));
188    if (src.hasPeriod())
189      tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
190    if (src.hasFacilityType())
191      tgt.setFacilityType(CodeableConcept10_30.convertCodeableConcept(src.getFacilityType()));
192    if (src.hasPracticeSetting())
193      tgt.setPracticeSetting(CodeableConcept10_30.convertCodeableConcept(src.getPracticeSetting()));
194    if (src.hasSourcePatientInfo())
195      tgt.setSourcePatientInfo(Reference10_30.convertReference(src.getSourcePatientInfo()));
196    for (org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated())
197      tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t));
198    return tgt;
199  }
200
201  public static org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent convertDocumentReferenceContextRelatedComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent src) throws FHIRException {
202    if (src == null || src.isEmpty())
203      return null;
204    org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent();
205    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
206    if (src.hasIdentifier())
207      tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
208    if (src.hasRef())
209      tgt.setRef(Reference10_30.convertReference(src.getRef()));
210    return tgt;
211  }
212
213  public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent convertDocumentReferenceContextRelatedComponent(org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextRelatedComponent src) throws FHIRException {
214    if (src == null || src.isEmpty())
215      return null;
216    org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent();
217    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
218    if (src.hasIdentifier())
219      tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
220    if (src.hasRef())
221      tgt.setRef(Reference10_30.convertReference(src.getRef()));
222    return tgt;
223  }
224
225  public static org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException {
226    if (src == null || src.isEmpty())
227      return null;
228    org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent();
229    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
230    if (src.hasCode())
231      tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
232    if (src.hasTarget())
233      tgt.setTarget(Reference10_30.convertReference(src.getTarget()));
234    return tgt;
235  }
236
237  public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException {
238    if (src == null || src.isEmpty())
239      return null;
240    org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent();
241    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt);
242    if (src.hasCode())
243      tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
244    if (src.hasTarget())
245      tgt.setTarget(Reference10_30.convertReference(src.getTarget()));
246    return tgt;
247  }
248
249  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException {
250    if (src == null || src.isEmpty())
251      return null;
252    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipTypeEnumFactory());
253    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
254    switch (src.getValue()) {
255      case REPLACES:
256        tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.REPLACES);
257        break;
258      case TRANSFORMS:
259        tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.TRANSFORMS);
260        break;
261      case SIGNS:
262        tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.SIGNS);
263        break;
264      case APPENDS:
265        tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.APPENDS);
266        break;
267      default:
268        tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.NULL);
269        break;
270    }
271    return tgt;
272  }
273
274  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException {
275    if (src == null || src.isEmpty())
276      return null;
277    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipTypeEnumFactory());
278    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
279    switch (src.getValue()) {
280      case REPLACES:
281        tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.REPLACES);
282        break;
283      case TRANSFORMS:
284        tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.TRANSFORMS);
285        break;
286      case SIGNS:
287        tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.SIGNS);
288        break;
289      case APPENDS:
290        tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.APPENDS);
291        break;
292      default:
293        tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL);
294        break;
295    }
296    return tgt;
297  }
298
299  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus> convertDocumentReferenceStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus> src) throws FHIRException {
300    if (src == null || src.isEmpty()) return null;
301    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatusEnumFactory());
302    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
303    if (src.getValue() == null) {
304      tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL);
305    } else {
306      switch (src.getValue()) {
307        case CURRENT:
308          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.CURRENT);
309          break;
310        case SUPERSEDED:
311          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
312          break;
313        case ENTEREDINERROR:
314          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
315          break;
316        default:
317          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL);
318          break;
319      }
320    }
321    return tgt;
322  }
323
324  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus> convertDocumentReferenceStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus> src) throws FHIRException {
325    if (src == null || src.isEmpty()) return null;
326    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatusEnumFactory());
327    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
328    if (src.getValue() == null) {
329      tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL);
330    } else {
331      switch (src.getValue()) {
332        case CURRENT:
333          tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.CURRENT);
334          break;
335        case SUPERSEDED:
336          tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
337          break;
338        case ENTEREDINERROR:
339          tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
340          break;
341        default:
342          tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL);
343          break;
344      }
345    }
346    return tgt;
347  }
348}