
001package org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext14_30; 004import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.Code14_30; 005import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.String14_30; 006import org.hl7.fhir.exceptions.FHIRException; 007 008public class CodeableConcept14_30 { 009 public static org.hl7.fhir.dstu3.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu2016may.model.CodeableConcept src) throws FHIRException { 010 if (src == null || src.isEmpty()) return null; 011 org.hl7.fhir.dstu3.model.CodeableConcept tgt = new org.hl7.fhir.dstu3.model.CodeableConcept(); 012 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 013 for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCoding()) tgt.addCoding(Code14_30.convertCoding(t)); 014 if (src.hasText()) tgt.setTextElement(String14_30.convertString(src.getTextElement())); 015 return tgt; 016 } 017 018 public static org.hl7.fhir.dstu2016may.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept src) throws FHIRException { 019 if (src == null || src.isEmpty()) return null; 020 org.hl7.fhir.dstu2016may.model.CodeableConcept tgt = new org.hl7.fhir.dstu2016may.model.CodeableConcept(); 021 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 022 for (org.hl7.fhir.dstu3.model.Coding t : src.getCoding()) tgt.addCoding(Code14_30.convertCoding(t)); 023 if (src.hasText()) tgt.setTextElement(String14_30.convertString(src.getTextElement())); 024 return tgt; 025 } 026 027 public static org.hl7.fhir.dstu3.model.UsageContext convertCodeableConceptToUsageContext(org.hl7.fhir.dstu2016may.model.CodeableConcept t) throws FHIRException { 028 org.hl7.fhir.dstu3.model.UsageContext result = new org.hl7.fhir.dstu3.model.UsageContext(); 029 result.setValue(convertCodeableConcept(t)); 030 return result; 031 } 032}