001package org.hl7.fhir.convertors.conv10_30;
002
003import org.apache.commons.codec.binary.Base64;
004import org.hl7.fhir.convertors.VersionConvertor_10_30;
005import org.hl7.fhir.exceptions.FHIRException;
006
007public class Contract10_30 {
008
009    public static org.hl7.fhir.dstu3.model.Contract.AgentComponent convertAgentComponent(org.hl7.fhir.dstu2.model.Contract.ActorComponent src) throws FHIRException {
010        if (src == null || src.isEmpty())
011            return null;
012        org.hl7.fhir.dstu3.model.Contract.AgentComponent tgt = new org.hl7.fhir.dstu3.model.Contract.AgentComponent();
013        VersionConvertor_10_30.copyElement(src, tgt);
014        if (src.hasEntity())
015            tgt.setActor(VersionConvertor_10_30.convertReference(src.getEntity()));
016        for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t));
017        return tgt;
018    }
019
020    public static org.hl7.fhir.dstu2.model.Contract.ActorComponent convertAgentComponent(org.hl7.fhir.dstu3.model.Contract.AgentComponent src) throws FHIRException {
021        if (src == null || src.isEmpty())
022            return null;
023        org.hl7.fhir.dstu2.model.Contract.ActorComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ActorComponent();
024        VersionConvertor_10_30.copyElement(src, tgt);
025        if (src.hasActor())
026            tgt.setEntity(VersionConvertor_10_30.convertReference(src.getActor()));
027        for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t));
028        return tgt;
029    }
030
031    public static org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent src) throws FHIRException {
032        if (src == null || src.isEmpty())
033            return null;
034        org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent();
035        VersionConvertor_10_30.copyElement(src, tgt);
036        if (src.hasContent())
037            tgt.setContent(VersionConvertor_10_30.convertType(src.getContent()));
038        return tgt;
039    }
040
041    public static org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent src) throws FHIRException {
042        if (src == null || src.isEmpty())
043            return null;
044        org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent();
045        VersionConvertor_10_30.copyElement(src, tgt);
046        if (src.hasContent())
047            tgt.setContent(VersionConvertor_10_30.convertType(src.getContent()));
048        return tgt;
049    }
050
051    public static org.hl7.fhir.dstu2.model.Contract convertContract(org.hl7.fhir.dstu3.model.Contract src) throws FHIRException {
052        if (src == null || src.isEmpty())
053            return null;
054        org.hl7.fhir.dstu2.model.Contract tgt = new org.hl7.fhir.dstu2.model.Contract();
055        VersionConvertor_10_30.copyDomainResource(src, tgt);
056        if (src.hasIdentifier())
057            tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier()));
058        if (src.hasIssuedElement())
059            tgt.setIssuedElement(VersionConvertor_10_30.convertDateTime(src.getIssuedElement()));
060        if (src.hasApplies())
061            tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies()));
062        for (org.hl7.fhir.dstu3.model.Reference t : src.getSubject()) tgt.addSubject(VersionConvertor_10_30.convertReference(t));
063        for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthority()) tgt.addAuthority(VersionConvertor_10_30.convertReference(t));
064        for (org.hl7.fhir.dstu3.model.Reference t : src.getDomain()) tgt.addDomain(VersionConvertor_10_30.convertReference(t));
065        if (src.hasType())
066            tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType()));
067        for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSubType()) tgt.addSubType(VersionConvertor_10_30.convertCodeableConcept(t));
068        for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t));
069        for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t));
070        for (org.hl7.fhir.dstu3.model.Contract.AgentComponent t : src.getAgent()) tgt.addActor(convertAgentComponent(t));
071        for (org.hl7.fhir.dstu3.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t));
072        for (org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t));
073        for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));
074        if (src.hasBinding())
075            tgt.setBinding(VersionConvertor_10_30.convertType(src.getBinding()));
076        for (org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t));
077        for (org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t));
078        for (org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t));
079        return tgt;
080    }
081
082    public static org.hl7.fhir.dstu3.model.Contract convertContract(org.hl7.fhir.dstu2.model.Contract src) throws FHIRException {
083        if (src == null || src.isEmpty())
084            return null;
085        org.hl7.fhir.dstu3.model.Contract tgt = new org.hl7.fhir.dstu3.model.Contract();
086        VersionConvertor_10_30.copyDomainResource(src, tgt);
087        if (src.hasIdentifier())
088            tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier()));
089        if (src.hasIssuedElement())
090            tgt.setIssuedElement(VersionConvertor_10_30.convertDateTime(src.getIssuedElement()));
091        if (src.hasApplies())
092            tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies()));
093        for (org.hl7.fhir.dstu2.model.Reference t : src.getSubject()) tgt.addSubject(VersionConvertor_10_30.convertReference(t));
094        for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthority()) tgt.addAuthority(VersionConvertor_10_30.convertReference(t));
095        for (org.hl7.fhir.dstu2.model.Reference t : src.getDomain()) tgt.addDomain(VersionConvertor_10_30.convertReference(t));
096        if (src.hasType())
097            tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType()));
098        for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSubType()) tgt.addSubType(VersionConvertor_10_30.convertCodeableConcept(t));
099        for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t));
100        for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t));
101        for (org.hl7.fhir.dstu2.model.Contract.ActorComponent t : src.getActor()) tgt.addAgent(convertAgentComponent(t));
102        for (org.hl7.fhir.dstu2.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t));
103        for (org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t));
104        for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));
105        if (src.hasBinding())
106            tgt.setBinding(VersionConvertor_10_30.convertType(src.getBinding()));
107        for (org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t));
108        for (org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t));
109        for (org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t));
110        return tgt;
111    }
112
113    public static org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
114        if (src == null || src.isEmpty())
115            return null;
116        org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent();
117        VersionConvertor_10_30.copyElement(src, tgt);
118        if (src.hasContent())
119            tgt.setContent(VersionConvertor_10_30.convertType(src.getContent()));
120        return tgt;
121    }
122
123    public static org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
124        if (src == null || src.isEmpty())
125            return null;
126        org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent();
127        VersionConvertor_10_30.copyElement(src, tgt);
128        if (src.hasContent())
129            tgt.setContent(VersionConvertor_10_30.convertType(src.getContent()));
130        return tgt;
131    }
132
133    public static org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent src) throws FHIRException {
134        if (src == null || src.isEmpty())
135            return null;
136        org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent();
137        VersionConvertor_10_30.copyElement(src, tgt);
138        if (src.hasContent())
139            tgt.setContent(VersionConvertor_10_30.convertType(src.getContent()));
140        return tgt;
141    }
142
143    public static org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent src) throws FHIRException {
144        if (src == null || src.isEmpty())
145            return null;
146        org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent();
147        VersionConvertor_10_30.copyElement(src, tgt);
148        if (src.hasContent())
149            tgt.setContent(VersionConvertor_10_30.convertType(src.getContent()));
150        return tgt;
151    }
152
153    public static org.hl7.fhir.dstu3.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.dstu2.model.Contract.SignatoryComponent src) throws FHIRException {
154        if (src == null || src.isEmpty())
155            return null;
156        org.hl7.fhir.dstu3.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.dstu3.model.Contract.SignatoryComponent();
157        VersionConvertor_10_30.copyElement(src, tgt);
158        if (src.hasType())
159            tgt.setType(VersionConvertor_10_30.convertCoding(src.getType()));
160        if (src.hasParty())
161            tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty()));
162        if (src.hasSignature())
163            tgt.addSignature(new org.hl7.fhir.dstu3.model.Signature().setBlob(src.getSignature().getBytes()));
164        return tgt;
165    }
166
167    public static org.hl7.fhir.dstu2.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.dstu3.model.Contract.SignatoryComponent src) throws FHIRException {
168        if (src == null || src.isEmpty())
169            return null;
170        org.hl7.fhir.dstu2.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.dstu2.model.Contract.SignatoryComponent();
171        VersionConvertor_10_30.copyElement(src, tgt);
172        if (src.hasType())
173            tgt.setType(VersionConvertor_10_30.convertCoding(src.getType()));
174        if (src.hasParty())
175            tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty()));
176        for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature()) tgt.setSignature(Base64.encodeBase64String(t.getBlob()));
177        return tgt;
178    }
179
180    public static org.hl7.fhir.dstu2.model.Contract.TermActorComponent convertTermAgentComponent(org.hl7.fhir.dstu3.model.Contract.TermAgentComponent src) throws FHIRException {
181        if (src == null || src.isEmpty())
182            return null;
183        org.hl7.fhir.dstu2.model.Contract.TermActorComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermActorComponent();
184        VersionConvertor_10_30.copyElement(src, tgt);
185        if (src.hasActor())
186            tgt.setEntity(VersionConvertor_10_30.convertReference(src.getActor()));
187        for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t));
188        return tgt;
189    }
190
191    public static org.hl7.fhir.dstu3.model.Contract.TermAgentComponent convertTermAgentComponent(org.hl7.fhir.dstu2.model.Contract.TermActorComponent src) throws FHIRException {
192        if (src == null || src.isEmpty())
193            return null;
194        org.hl7.fhir.dstu3.model.Contract.TermAgentComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermAgentComponent();
195        VersionConvertor_10_30.copyElement(src, tgt);
196        if (src.hasEntity())
197            tgt.setActor(VersionConvertor_10_30.convertReference(src.getEntity()));
198        for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(VersionConvertor_10_30.convertCodeableConcept(t));
199        return tgt;
200    }
201
202    public static org.hl7.fhir.dstu3.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.dstu2.model.Contract.TermComponent src) throws FHIRException {
203        if (src == null || src.isEmpty())
204            return null;
205        org.hl7.fhir.dstu3.model.Contract.TermComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermComponent();
206        VersionConvertor_10_30.copyElement(src, tgt);
207        if (src.hasIdentifier())
208            tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier()));
209        if (src.hasIssuedElement())
210            tgt.setIssuedElement(VersionConvertor_10_30.convertDateTime(src.getIssuedElement()));
211        if (src.hasApplies())
212            tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies()));
213        if (src.hasType())
214            tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType()));
215        if (src.hasSubType())
216            tgt.setSubType(VersionConvertor_10_30.convertCodeableConcept(src.getSubType()));
217        for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t));
218        for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t));
219        for (org.hl7.fhir.dstu2.model.Contract.TermActorComponent t : src.getActor()) tgt.addAgent(convertTermAgentComponent(t));
220        if (src.hasTextElement())
221            tgt.setTextElement(VersionConvertor_10_30.convertString(src.getTextElement()));
222        for (org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t));
223        for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t));
224        return tgt;
225    }
226
227    public static org.hl7.fhir.dstu2.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.dstu3.model.Contract.TermComponent src) throws FHIRException {
228        if (src == null || src.isEmpty())
229            return null;
230        org.hl7.fhir.dstu2.model.Contract.TermComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermComponent();
231        VersionConvertor_10_30.copyElement(src, tgt);
232        if (src.hasIdentifier())
233            tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier()));
234        if (src.hasIssuedElement())
235            tgt.setIssuedElement(VersionConvertor_10_30.convertDateTime(src.getIssuedElement()));
236        if (src.hasApplies())
237            tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies()));
238        if (src.hasType())
239            tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType()));
240        if (src.hasSubType())
241            tgt.setSubType(VersionConvertor_10_30.convertCodeableConcept(src.getSubType()));
242        for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertCodeableConcept(t));
243        for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(VersionConvertor_10_30.convertCodeableConcept(t));
244        for (org.hl7.fhir.dstu3.model.Contract.TermAgentComponent t : src.getAgent()) tgt.addActor(convertTermAgentComponent(t));
245        if (src.hasTextElement())
246            tgt.setTextElement(VersionConvertor_10_30.convertString(src.getTextElement()));
247        for (org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t));
248        for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t));
249        return tgt;
250    }
251
252    public static org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent convertTermValuedItemComponent(org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent src) throws FHIRException {
253        if (src == null || src.isEmpty())
254            return null;
255        org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent();
256        VersionConvertor_10_30.copyElement(src, tgt);
257        if (src.hasEntity())
258            tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity()));
259        if (src.hasIdentifier())
260            tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier()));
261        if (src.hasEffectiveTimeElement())
262            tgt.setEffectiveTimeElement(VersionConvertor_10_30.convertDateTime(src.getEffectiveTimeElement()));
263        if (src.hasQuantity())
264            tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity()));
265        if (src.hasUnitPrice())
266            tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice()));
267        if (src.hasFactorElement())
268            tgt.setFactorElement(VersionConvertor_10_30.convertDecimal(src.getFactorElement()));
269        if (src.hasPointsElement())
270            tgt.setPointsElement(VersionConvertor_10_30.convertDecimal(src.getPointsElement()));
271        if (src.hasNet())
272            tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet()));
273        return tgt;
274    }
275
276    public static org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent convertTermValuedItemComponent(org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent src) throws FHIRException {
277        if (src == null || src.isEmpty())
278            return null;
279        org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent();
280        VersionConvertor_10_30.copyElement(src, tgt);
281        if (src.hasEntity())
282            tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity()));
283        if (src.hasIdentifier())
284            tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier()));
285        if (src.hasEffectiveTimeElement())
286            tgt.setEffectiveTimeElement(VersionConvertor_10_30.convertDateTime(src.getEffectiveTimeElement()));
287        if (src.hasQuantity())
288            tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity()));
289        if (src.hasUnitPrice())
290            tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice()));
291        if (src.hasFactorElement())
292            tgt.setFactorElement(VersionConvertor_10_30.convertDecimal(src.getFactorElement()));
293        if (src.hasPointsElement())
294            tgt.setPointsElement(VersionConvertor_10_30.convertDecimal(src.getPointsElement()));
295        if (src.hasNet())
296            tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet()));
297        return tgt;
298    }
299
300    public static org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent src) throws FHIRException {
301        if (src == null || src.isEmpty())
302            return null;
303        org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent();
304        VersionConvertor_10_30.copyElement(src, tgt);
305        if (src.hasEntity())
306            tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity()));
307        if (src.hasIdentifier())
308            tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier()));
309        if (src.hasEffectiveTimeElement())
310            tgt.setEffectiveTimeElement(VersionConvertor_10_30.convertDateTime(src.getEffectiveTimeElement()));
311        if (src.hasQuantity())
312            tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity()));
313        if (src.hasUnitPrice())
314            tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice()));
315        if (src.hasFactorElement())
316            tgt.setFactorElement(VersionConvertor_10_30.convertDecimal(src.getFactorElement()));
317        if (src.hasPointsElement())
318            tgt.setPointsElement(VersionConvertor_10_30.convertDecimal(src.getPointsElement()));
319        if (src.hasNet())
320            tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet()));
321        return tgt;
322    }
323
324    public static org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent src) throws FHIRException {
325        if (src == null || src.isEmpty())
326            return null;
327        org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent();
328        VersionConvertor_10_30.copyElement(src, tgt);
329        if (src.hasEntity())
330            tgt.setEntity(VersionConvertor_10_30.convertType(src.getEntity()));
331        if (src.hasIdentifier())
332            tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier()));
333        if (src.hasEffectiveTimeElement())
334            tgt.setEffectiveTimeElement(VersionConvertor_10_30.convertDateTime(src.getEffectiveTimeElement()));
335        if (src.hasQuantity())
336            tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity()));
337        if (src.hasUnitPrice())
338            tgt.setUnitPrice(VersionConvertor_10_30.convertMoney(src.getUnitPrice()));
339        if (src.hasFactorElement())
340            tgt.setFactorElement(VersionConvertor_10_30.convertDecimal(src.getFactorElement()));
341        if (src.hasPointsElement())
342            tgt.setPointsElement(VersionConvertor_10_30.convertDecimal(src.getPointsElement()));
343        if (src.hasNet())
344            tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet()));
345        return tgt;
346    }
347}