public org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.instance.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent(); copyElement(src, tgt); List<String> slicePaths = new ArrayList<String>(); for (org.hl7.fhir.instance.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) slicePaths.add(t.getPath()); tgt.addElement(convertElementDefinition(t, slicePaths)); } return tgt; }
/** * @return The first repetition of repeating field {@link #element}, creating it if it does not already exist */ public ElementDefinition getElementFirstRep() { if (getElement().isEmpty()) { addElement(); } return getElement().get(0); }
@Override public Base addChild(String name) throws FHIRException { if (name.equals("element")) { return addElement(); } else return super.addChild(name); }
public org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.instance.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent(); copyElement(src, tgt); List<String> slicePaths = new ArrayList<String>(); for (org.hl7.fhir.instance.model.ElementDefinition t : src.getElement()) { if (t.hasSlicing()) slicePaths.add(t.getPath()); tgt.addElement(convertElementDefinition(t, slicePaths)); } return tgt; }
public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(convertElementDefinition(t)); return tgt; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1662836996: return addElement(); default: return super.makeProperty(hash, name); } }
private void copyElements(StructureDefinition sd, List<ElementDefinition> list) { for (ElementDefinition ed : list) { if (ed.getPath().contains(".")) { ElementDefinition n = ed.copy(); n.setPath(sd.getSnapshot().getElementFirstRep().getPath()+"."+ed.getPath().substring(ed.getPath().indexOf(".")+1)); sd.getSnapshot().addElement(n); } } }
public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) tgt.addElement(convertElementDefinition(t)); return tgt; }