public static org.hl7.fhir.dstu2016may.model.Coding convertCoding(org.hl7.fhir.dstu3.model.Coding src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Coding tgt = new org.hl7.fhir.dstu2016may.model.Coding(); copyElement(src, tgt); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasCode()) tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasUserSelected()) tgt.setUserSelected(src.getUserSelected()); return tgt; }
private boolean hasDescription(Type fixed) { if (fixed instanceof Coding) { return ((Coding) fixed).hasDisplay(); } else if (fixed instanceof CodeableConcept) { CodeableConcept cc = (CodeableConcept) fixed; if (cc.hasText()) return true; for (Coding c : cc.getCoding()) if (c.hasDisplay()) return true; } // (fixed instanceof CodeType) || (fixed instanceof Quantity); return false; }
@SuppressWarnings("rawtypes") private String describeTransformCCorC(StructureMapGroupRuleTargetComponent tgt) throws FHIRException { if (tgt.getParameter().size() < 2) return null; Type p1 = tgt.getParameter().get(0).getValue(); Type p2 = tgt.getParameter().get(1).getValue(); if (p1 instanceof IdType || p2 instanceof IdType) return null; if (!(p1 instanceof PrimitiveType) || !(p2 instanceof PrimitiveType)) return null; String uri = ((PrimitiveType) p1).asStringValue(); String code = ((PrimitiveType) p2).asStringValue(); if (Utilities.noString(uri)) throw new FHIRException("Describe Transform, but the uri is blank"); if (Utilities.noString(code)) throw new FHIRException("Describe Transform, but the code is blank"); Coding c = buildCoding(uri, code); return NarrativeGenerator.describeSystem(c.getSystem())+"#"+c.getCode()+(c.hasDisplay() ? "("+c.getDisplay()+")" : ""); }
public static org.hl7.fhir.dstu2016may.model.Coding convertCoding(org.hl7.fhir.dstu3.model.Coding src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Coding tgt = new org.hl7.fhir.dstu2016may.model.Coding(); copyElement(src, tgt); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasCode()) tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasUserSelected()) tgt.setUserSelected(src.getUserSelected()); return tgt; }