001package org.hl7.fhir.convertors.conv43_50.resources43_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext43_50;
004import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
005import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
006import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
007import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50;
008import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.RelatedArtifact43_50;
009import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.TriggerDefinition43_50;
010import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50;
011import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
012import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50;
013import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
014import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50;
015import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
016import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
017import org.hl7.fhir.exceptions.FHIRException;
018
019/*
020  Copyright (c) 2011+, HL7, Inc.
021  All rights reserved.
022  
023  Redistribution and use in source and binary forms, with or without modification, 
024  are permitted provided that the following conditions are met:
025  
026   * Redistributions of source code must retain the above copyright notice, this 
027     list of conditions and the following disclaimer.
028   * Redistributions in binary form must reproduce the above copyright notice, 
029     this list of conditions and the following disclaimer in the documentation 
030     and/or other materials provided with the distribution.
031   * Neither the name of HL7 nor the names of its contributors may be used to 
032     endorse or promote products derived from this software without specific 
033     prior written permission.
034  
035  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
036  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
037  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
038  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
039  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
040  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
041  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
042  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
043  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
044  POSSIBILITY OF SUCH DAMAGE.
045  
046*/
047// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
048public class EventDefinition43_50 {
049
050  public static org.hl7.fhir.r5.model.EventDefinition convertEventDefinition(org.hl7.fhir.r4b.model.EventDefinition src) throws FHIRException {
051    if (src == null)
052      return null;
053    org.hl7.fhir.r5.model.EventDefinition tgt = new org.hl7.fhir.r5.model.EventDefinition();
054    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
055    if (src.hasUrl())
056      tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
057    for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
058      tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
059    if (src.hasVersion())
060      tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
061    if (src.hasName())
062      tgt.setNameElement(String43_50.convertString(src.getNameElement()));
063    if (src.hasTitle())
064      tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
065    if (src.hasSubtitle())
066      tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement()));
067    if (src.hasStatus())
068      tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
069    if (src.hasExperimental())
070      tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
071    if (src.hasSubject())
072      tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject()));
073    if (src.hasDate())
074      tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
075    if (src.hasPublisher())
076      tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
077    for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
078      tgt.addContact(ContactDetail43_50.convertContactDetail(t));
079    if (src.hasDescription())
080      tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
081    for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext())
082      tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
083    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction())
084      tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
085    if (src.hasPurpose())
086      tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
087    if (src.hasUsage())
088      tgt.setUsageElement(String43_50.convertStringToMarkdown(src.getUsageElement()));
089    if (src.hasCopyright())
090      tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
091    if (src.hasApprovalDate())
092      tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
093    if (src.hasLastReviewDate())
094      tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement()));
095    if (src.hasEffectivePeriod())
096      tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod()));
097    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getTopic())
098      tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t));
099    for (org.hl7.fhir.r4b.model.ContactDetail t : src.getAuthor())
100      tgt.addAuthor(ContactDetail43_50.convertContactDetail(t));
101    for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEditor())
102      tgt.addEditor(ContactDetail43_50.convertContactDetail(t));
103    for (org.hl7.fhir.r4b.model.ContactDetail t : src.getReviewer())
104      tgt.addReviewer(ContactDetail43_50.convertContactDetail(t));
105    for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEndorser())
106      tgt.addEndorser(ContactDetail43_50.convertContactDetail(t));
107    for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getRelatedArtifact())
108      tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t));
109    for (org.hl7.fhir.r4b.model.TriggerDefinition t : src.getTrigger())
110      tgt.addTrigger(TriggerDefinition43_50.convertTriggerDefinition(t));
111    return tgt;
112  }
113
114  public static org.hl7.fhir.r4b.model.EventDefinition convertEventDefinition(org.hl7.fhir.r5.model.EventDefinition src) throws FHIRException {
115    if (src == null)
116      return null;
117    org.hl7.fhir.r4b.model.EventDefinition tgt = new org.hl7.fhir.r4b.model.EventDefinition();
118    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
119    if (src.hasUrl())
120      tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
121    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
122      tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
123    if (src.hasVersion())
124      tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
125    if (src.hasName())
126      tgt.setNameElement(String43_50.convertString(src.getNameElement()));
127    if (src.hasTitle())
128      tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
129    if (src.hasSubtitle())
130      tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement()));
131    if (src.hasStatus())
132      tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
133    if (src.hasExperimental())
134      tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
135    if (src.hasSubject())
136      tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject()));
137    if (src.hasDate())
138      tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
139    if (src.hasPublisher())
140      tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
141    for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
142      tgt.addContact(ContactDetail43_50.convertContactDetail(t));
143    if (src.hasDescription())
144      tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
145    for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
146      tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
147    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
148      tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
149    if (src.hasPurpose())
150      tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
151    if (src.hasUsage())
152      tgt.setUsageElement(String43_50.convertString(src.getUsageElement()));
153    if (src.hasCopyright())
154      tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
155    if (src.hasApprovalDate())
156      tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
157    if (src.hasLastReviewDate())
158      tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement()));
159    if (src.hasEffectivePeriod())
160      tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod()));
161    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
162      tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t));
163    for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
164      tgt.addAuthor(ContactDetail43_50.convertContactDetail(t));
165    for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
166      tgt.addEditor(ContactDetail43_50.convertContactDetail(t));
167    for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
168      tgt.addReviewer(ContactDetail43_50.convertContactDetail(t));
169    for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
170      tgt.addEndorser(ContactDetail43_50.convertContactDetail(t));
171    for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
172      tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t));
173    for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger())
174      tgt.addTrigger(TriggerDefinition43_50.convertTriggerDefinition(t));
175    return tgt;
176  }
177}