public boolean hasType(IWorkerContext context, String... tn) { for (String n: tn) { String t = ProfiledType.ns(n); if (typesContains(t)) return true; } for (String n: tn) { String id = n.contains("#") ? n.substring(0, n.indexOf("#")) : n; String tail = null; if (n.contains("#")) { tail = n.substring( n.indexOf("#")+1); tail = tail.substring(tail.indexOf(".")); } String t = ProfiledType.ns(n); StructureDefinition sd = context.fetchResource(StructureDefinition.class, t); while (sd != null) { if (tail == null && typesContains(sd.getUrl())) return true; if (tail != null && typesContains(sd.getUrl()+"#"+sd.getType()+tail)) return true; if (sd.hasBaseDefinition()) sd = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition()); else sd = null; } } return false; }
public void populateLogicalSnapshot(StructureDefinition sd) throws FHIRException { sd.getSnapshot().getElement().add(sd.getDifferential().getElementFirstRep().copy()); if (sd.hasBaseDefinition()) { StructureDefinition base = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition()); if (base == null) throw new FHIRException("Unable to find base definition for logical model: "+sd.getBaseDefinition()+" from "+sd.getUrl()); copyElements(sd, base.getSnapshot().getElement()); } copyElements(sd, sd.getDifferential().getElement()); }
for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); if (src.hasBaseDefinition()) tgt.setBaseDefinition(src.getBaseDefinition()); if (src.hasType() && src.getDerivation() == org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT)
for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); if (src.hasBaseDefinition()) tgt.setBaseDefinition(src.getBaseDefinition()); if (src.hasType() && src.getDerivation() == org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT)