public CodeableConcept(Coding code) { super(); addCoding(code); }
/** * @return The first repetition of repeating field {@link #coding}, creating it if it does not already exist */ public Coding getCodingFirstRep() { if (getCoding().isEmpty()) { addCoding(); } return getCoding().get(0); }
@Override public Base addChild(String name) throws FHIRException { if (name.equals("coding")) { return addCoding(); } else if (name.equals("text")) { throw new FHIRException("Cannot call addChild on a primitive type CodeableConcept.text"); } else return super.addChild(name); }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1355086998: return addCoding(); case 3556653: return getTextElement(); default: return super.makeProperty(hash, name); } }
public CodeableConcept castToCodeableConcept(Base b) throws FHIRException { if (b instanceof CodeableConcept) return (CodeableConcept) b; else if (b instanceof Element) { return ObjectConverter.readAsCodeableConcept((Element) b); } else if (b instanceof CodeType) { CodeableConcept cc = new CodeableConcept(); cc.addCoding().setCode(((CodeType) b).asStringValue()); return cc; } else throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a CodeableConcept"); }
private static org.hl7.fhir.r4.model.CodeableConcept convertConditionClinicalStatus(String src) throws FHIRException { if (src == null) return null; org.hl7.fhir.r4.model.CodeableConcept cc = new org.hl7.fhir.r4.model.CodeableConcept(); cc.addCoding().setSystem("http://hl7.org/fhir/condition-clinical").setCode(src); return cc; }
private static org.hl7.fhir.r4.model.CodeableConcept convertConditionVerificationStatus(org.hl7.fhir.instance.model.Condition.ConditionVerificationStatus src) throws FHIRException { if (src == null) return null; org.hl7.fhir.r4.model.CodeableConcept cc = new org.hl7.fhir.r4.model.CodeableConcept(); switch (src) { case PROVISIONAL: cc.addCoding().setSystem("http://hl7.org/fhir/condition-ver-status").setCode("provisional"); return cc; case DIFFERENTIAL: cc.addCoding().setSystem("http://hl7.org/fhir/condition-ver-status").setCode("differential"); return cc; case CONFIRMED: cc.addCoding().setSystem("http://hl7.org/fhir/condition-ver-status").setCode("confirmed"); return cc; case REFUTED: cc.addCoding().setSystem("http://hl7.org/fhir/condition-ver-status").setCode("refuted"); return cc; case ENTEREDINERROR: cc.addCoding().setSystem("http://hl7.org/fhir/condition-ver-status").setCode("entered-in-error"); return cc; default: return null; } }
public static CodeableConcept readAsCodeableConcept(Element element) { CodeableConcept cc = new CodeableConcept(); List<Element> list = new ArrayList<Element>(); element.getNamedChildren("coding", list); for (Element item : list) cc.addCoding(readAsCoding(item)); cc.setText(element.getNamedChildValue("text")); return cc; }
/** * This is just a convenience method that creates a codeableconcept if one * doesn't already exist, and adds a coding to it */ public TranslationRequest addCode(String theSystem, String theCode) { Validate.notBlank(theSystem, "theSystem must not be null"); Validate.notBlank(theCode, "theCode must not be null"); if (getCodeableConcept() == null) { setCodeableConcept(new CodeableConcept()); } getCodeableConcept().addCoding(new Coding().setSystem(theSystem).setCode(theCode)); return this; }
public org.hl7.fhir.r4.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.instance.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.CodeableConcept tgt = new org.hl7.fhir.r4.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.instance.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); tgt.setText(src.getText()); return tgt; }
public static org.hl7.fhir.r4.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu2016may.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.CodeableConcept tgt = new org.hl7.fhir.r4.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); if (src.hasText()) tgt.setText(src.getText()); return tgt; }
case CC: CodeableConcept cc = new CodeableConcept(); cc.addCoding(buildCoding(getParamStringNoNull(vars, tgt.getParameter().get(0), tgt.toString()), getParamStringNoNull(vars, tgt.getParameter().get(1), tgt.toString()))); return cc; case C:
/** * @return The first repetition of repeating field {@link #coding}, creating it if it does not already exist */ public Coding getCodingFirstRep() { if (getCoding().isEmpty()) { addCoding(); } return getCoding().get(0); }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1355086998: return addCoding(); case 3556653: return getTextElement(); default: return super.makeProperty(hash, name); } }
protected CodeableConcept codedValueTypeToCodeableConcept(CodedValueType cvt) { return cvt != null ? new CodeableConcept().addCoding(codedValueTypeToCoding(cvt)) : null; } }
public CodeableConcept castToCodeableConcept(Base b) throws FHIRException { if (b instanceof CodeableConcept) return (CodeableConcept) b; else if (b instanceof Element) { return ObjectConverter.readAsCodeableConcept((Element) b); } else if (b instanceof CodeType) { CodeableConcept cc = new CodeableConcept(); cc.addCoding().setCode(((CodeType) b).asStringValue()); return cc; } else throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a CodeableConcept"); }
public org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.instance.model.AuditEvent.AuditEventParticipantComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent(); copyElement(src, tgt); for (org.hl7.fhir.instance.model.CodeableConcept t : src.getRole()) tgt.addRole(convertCodeableConcept(t)); tgt.setWho(convertReference(src.getReference())); if (src.hasUserId()) tgt.getWho().setIdentifier(convertIdentifier(src.getUserId())); tgt.setAltId(src.getAltId()); tgt.setName(src.getName()); tgt.setRequestor(src.getRequestor()); tgt.setLocation(convertReference(src.getLocation())); for (org.hl7.fhir.instance.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue()); tgt.setMedia(convertCoding(src.getMedia())); tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); for (org.hl7.fhir.instance.model.Coding t : src.getPurposeOfUse()) tgt.addPurposeOfUse().addCoding(convertCoding(t)); return tgt; }
public org.hl7.fhir.r4.model.AuditEvent convertAuditEvent(org.hl7.fhir.instance.model.AuditEvent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.AuditEvent tgt = new org.hl7.fhir.r4.model.AuditEvent(); copyDomainResource(src, tgt); if (src.hasEvent()) { tgt.setType(convertCoding(src.getEvent().getType())); for (org.hl7.fhir.instance.model.Coding t : src.getEvent().getSubtype()) tgt.addSubtype(convertCoding(t)); tgt.setAction(convertAuditEventAction(src.getEvent().getAction())); tgt.setRecorded(src.getEvent().getDateTime()); tgt.setOutcome(convertAuditEventOutcome(src.getEvent().getOutcome())); tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc()); for (org.hl7.fhir.instance.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(convertCoding(t)); } for (org.hl7.fhir.instance.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant()) tgt.addAgent(convertAuditEventAgentComponent(t)); tgt.setSource(convertAuditEventSourceComponent(src.getSource())); for (org.hl7.fhir.instance.model.AuditEvent.AuditEventObjectComponent t : src.getObject()) tgt.addEntity(convertAuditEventEntityComponent(t)); return tgt; }
translationRequest.getCodeableConcept().addCoding().setCodeElement(VersionConvertor_30_40.convertCode(theSourceCode)); translationRequest.getCodeableConcept().addCoding(VersionConvertor_30_40.convertCoding(theSourceCoding)); } else { translationRequest.setCodeableConcept(VersionConvertor_30_40.convertCodeableConcept(theSourceCodeableConcept));