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; }
private static String renderCodeable(CodeableConcept units) { if (units == null || units.isEmpty()) return ""; String v = renderCoding(units.getCoding()); if (units.hasText()) v = v + " " +Utilities.escapeXml(units.getText()); return v; }
private void buildCodeableConceptExpression(ElementDefinition ed, StringBuilder expression, String discriminator, CodeableConcept cc) throws DefinitionException { if (cc.hasText()) throw new DefinitionException("Unsupported CodeableConcept pattern - using text - for discriminator(" + discriminator + ") for slice " + ed.getId()); if (!cc.hasCoding() || cc.getCoding().size() > 1) throw new DefinitionException("Unsupported CodeableConcept pattern - must be just one coding - for discriminator(" + discriminator + ") for slice " + ed.getId()); Coding c = cc.getCodingFirstRep(); if (c.hasExtension() || cc.hasExtension()) throw new DefinitionException("Unsupported CodeableConcept pattern - extensions are not allowed - for discriminator(" + discriminator + ") for slice " + ed.getId()); expression.append(" and " + discriminator + ".coding.where("); boolean first = true; if (c.hasSystem()) { first = false; expression.append("system = '"+c.getSystem()+"'"); } if (c.hasVersion()) { if (first) first = false; else expression.append(" and "); expression.append("version = '"+c.getVersion()+"'"); } if (c.hasCode()) { if (first) first = false; else expression.append(" and "); expression.append("code = '"+c.getCode()+"'"); } if (c.hasDisplay()) { if (first) first = false; else expression.append(" and "); expression.append("display = '"+c.getDisplay()+"'"); } expression.append(").exists()"); }
public static org.hl7.fhir.dstu2016may.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.r4.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.CodeableConcept tgt = new org.hl7.fhir.dstu2016may.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); if (src.hasText()) tgt.setText(src.getText()); 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; }
tgt.setEligibilityNote(src.getEligibilityFirstRep().getComment()); for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgram()) if (t.hasText()) tgt.addProgramName(t.getText()); for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic())
private static String renderCodeable(CodeableConcept units) { if (units == null || units.isEmpty()) return ""; String v = renderCoding(units.getCoding()); if (units.hasText()) v = v + " " +Utilities.escapeXml(units.getText()); return v; }
private void buildCodeableConceptExpression(ElementDefinition ed, StringBuilder expression, String discriminator, CodeableConcept cc) throws DefinitionException { if (cc.hasText()) throw new DefinitionException("Unsupported CodeableConcept pattern - using text - for discriminator(" + discriminator + ") for slice " + ed.getId()); if (!cc.hasCoding() || cc.getCoding().size() > 1) throw new DefinitionException("Unsupported CodeableConcept pattern - must be just one coding - for discriminator(" + discriminator + ") for slice " + ed.getId()); Coding c = cc.getCodingFirstRep(); if (c.hasExtension() || cc.hasExtension()) throw new DefinitionException("Unsupported CodeableConcept pattern - extensions are not allowed - for discriminator(" + discriminator + ") for slice " + ed.getId()); expression.append(" and " + discriminator + ".coding.where("); boolean first = true; if (c.hasSystem()) { first = false; expression.append("system = '"+c.getSystem()+"'"); } if (c.hasVersion()) { if (first) first = false; else expression.append(" and "); expression.append("version = '"+c.getVersion()+"'"); } if (c.hasCode()) { if (first) first = false; else expression.append(" and "); expression.append("code = '"+c.getCode()+"'"); } if (c.hasDisplay()) { if (first) first = false; else expression.append(" and "); expression.append("display = '"+c.getDisplay()+"'"); } expression.append(").exists()"); }
public static org.hl7.fhir.dstu2016may.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.r4.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.CodeableConcept tgt = new org.hl7.fhir.dstu2016may.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); if (src.hasText()) tgt.setText(src.getText()); return tgt; }
tgt.setEligibilityNote(src.getEligibilityFirstRep().getComment()); for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgram()) if (t.hasText()) tgt.addProgramName(t.getText()); for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic())