Java Code Examples for org.hl7.fhir.r4.model.CodeableConcept#addCoding()
The following examples show how to use
org.hl7.fhir.r4.model.CodeableConcept#addCoding() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FhirR4.java From synthea with Apache License 2.0 | 6 votes |
/** * Helper function to convert a Code into a CodeableConcept. Takes an optional system, which * replaces the Code.system in the resulting CodeableConcept if not null. * * @param from The Code to create a CodeableConcept from. * @param system The system identifier, such as a URI. Optional; may be null. * @return The converted CodeableConcept */ private static CodeableConcept mapCodeToCodeableConcept(Code from, String system) { CodeableConcept to = new CodeableConcept(); system = system == null ? null : ExportHelper.getSystemURI(system); from.system = ExportHelper.getSystemURI(from.system); if (from.display != null) { to.setText(from.display); } Coding coding = new Coding(); coding.setCode(from.code); coding.setDisplay(from.display); if (from.system == null) { coding.setSystem(system); } else { coding.setSystem(from.system); } to.addCoding(coding); return to; }
Example 2
Source File: ObjectConverter.java From org.hl7.fhir.core with Apache License 2.0 | 5 votes |
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; }
Example 3
Source File: StructureMapUtilities.java From org.hl7.fhir.core with Apache License 2.0 | 5 votes |
private Type generateFixedValue(StructureMapGroupRuleTargetComponent tgt) { if (!allParametersFixed(tgt)) return null; if (!tgt.hasTransform()) return null; switch (tgt.getTransform()) { case COPY: return tgt.getParameter().get(0).getValue(); case TRUNCATE: return null; //case ESCAPE: //case CAST: //case APPEND: case TRANSLATE: return null; //case DATEOP, //case UUID, //case POINTER, //case EVALUATE, case CC: CodeableConcept cc = new CodeableConcept(); cc.addCoding(buildCoding(tgt.getParameter().get(0).getValue(), tgt.getParameter().get(1).getValue())); return cc; case C: return buildCoding(tgt.getParameter().get(0).getValue(), tgt.getParameter().get(1).getValue()); case QTY: return null; //case ID, //case CP, default: return null; } }