public String summary(CodeableConcept code) { StringBuilder b = new StringBuilder(); b.append("{"); boolean first = true; for (Coding c : code.getCoding()) { if (first) first = false; else b.append(","); b.append(summary(c)); } b.append("}: \""); b.append(code.getText()); b.append("\""); return b.toString(); }
public static boolean matches(CodeableConcept c1, CodeableConcept c2, MatchProfile profile) throws FHIRException { if (profile != null) throw new NotImplementedException("Not Implemented Yet"); if (c1.getCoding().isEmpty() && c2.getCoding().isEmpty()) { return matches(c1.getText(), c2.getText(), null); } else { // in the absence of specific guidance, we just require that all codes match boolean ok = true; for (Coding c : c1.getCoding()) { ok = ok && inList(c2.getCoding(), c, null); } for (Coding c : c2.getCoding()) { ok = ok && inList(c1.getCoding(), c, null); } return ok; } }
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; }
public org.hl7.fhir.instance.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.r4.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.CodeableConcept tgt = new org.hl7.fhir.instance.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); tgt.setText(src.getText()); return tgt; }
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; }
public String summary(CodeableConcept code) { StringBuilder b = new StringBuilder(); b.append("{"); boolean first = true; for (Coding c : code.getCoding()) { if (first) first = false; else b.append(","); b.append(summary(c)); } b.append("}: \""); b.append(code.getText()); b.append("\""); return b.toString(); }
public static boolean matches(CodeableConcept c1, CodeableConcept c2, MatchProfile profile) throws FHIRException { if (profile != null) throw new NotImplementedException("Not Implemented Yet"); if (c1.getCoding().isEmpty() && c2.getCoding().isEmpty()) { return matches(c1.getText(), c2.getText(), null); } else { // in the absence of specific guidance, we just require that all codes match boolean ok = true; for (Coding c : c1.getCoding()) { ok = ok && inList(c2.getCoding(), c, null); } for (Coding c : c2.getCoding()) { ok = ok && inList(c1.getCoding(), c, null); } return ok; } }
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; }
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()) tgt.addCharacteristic(convertCodeableConcept(t));
public org.hl7.fhir.instance.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.r4.model.CodeableConcept src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.CodeableConcept tgt = new org.hl7.fhir.instance.model.CodeableConcept(); copyElement(src, tgt); for (org.hl7.fhir.r4.model.Coding t : src.getCoding()) tgt.addCoding(convertCoding(t)); tgt.setText(src.getText()); return tgt; }
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; }
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()) tgt.addCharacteristic(convertCodeableConcept(t));