@Override public String getIdBase() { return getId(); }
private StructureDefinition resolveProfile(StructureDefinition profile, String pr) { if (pr.startsWith("#")) { for (Resource r : profile.getContained()) { if (r.getId().equals(pr.substring(1)) && r instanceof StructureDefinition) return (StructureDefinition) r; } return null; } else { long t = System.nanoTime(); StructureDefinition fr = context.fetchResource(StructureDefinition.class, pr); sdTime = sdTime + (System.nanoTime() - t); return fr; } }
nextEntry.getRequest().setMethod(HTTPVerb.PUT); if (next.getIdElement().isAbsolute()) { nextEntry.getRequest().setUrl(next.getId()); } else { String resourceType = myContext.getResourceDefinition(next).getName();
public StructureDefinition getProfile(StructureDefinition source, String url) { StructureDefinition profile = null; String code = null; if (url.startsWith("#")) { profile = source; code = url.substring(1); } else if (context != null) { String[] parts = url.split("\\#"); profile = context.fetchResource(StructureDefinition.class, parts[0]); code = parts.length == 1 ? null : parts[1]; } if (profile == null) return null; if (code == null) return profile; for (Resource r : profile.getContained()) { if (r instanceof StructureDefinition && r.getId().equals(code)) return (StructureDefinition) r; } return null; }
public void dropResource(Resource r) throws FHIRException { dropResource(r.fhirType(), r.getId()); }
private ValueSet resolveBindingReference(DomainResource ctxt, String reference, String uri) { if (reference != null) { if (reference.startsWith("#")) { for (Resource c : ctxt.getContained()) { if (c.getId().equals(reference.substring(1)) && (c instanceof ValueSet)) return (ValueSet) c; } return null; } else { long t = System.nanoTime(); if (!Utilities.isAbsoluteUrl(reference)) reference = resolve(uri, reference); ValueSet fr = context.fetchResource(ValueSet.class, reference); txTime = txTime + (System.nanoTime() - t); return fr; } } else return null; }
public static BundleEntryComponent getEntryById(Bundle feed, ResourceType type, String reference) { for (BundleEntryComponent item : feed.getEntry()) { if (item.getResource().getId().equals(reference) && item.getResource().getResourceType() == type) return item; } return null; }
public static Resource getById(Bundle feed, ResourceType type, String reference) { for (BundleEntryComponent item : feed.getEntry()) { if (item.getResource().getId().equals(reference) && item.getResource().getResourceType() == type) return item.getResource(); } return null; }
be.setResource(b.getEntry().get(i).getResource()); be.getRequest().setMethod(HTTPVerb.PUT); be.getRequest().setUrl(be.getResource().getResourceType().toString()+"/"+be.getResource().getId());
allResourcesById.put(r.fhirType(), map); map.put(r.getId(), r);
params.add(arg); arg.setName(getSingleValue(parg)); arg.addValue(new StringValue(source.fhirType()+"/"+source.getId())); services.listResources(appInfo, field.getName().substring(0, field.getName().length() - 4), params, list); arg = null;
private void processReverseReferenceSearch(Resource source, Field field, ObjectValue target, boolean inheritedList, String suffix) throws EGraphQLException, FHIRException { if (services == null) throw new EGraphQLException("Resource Referencing services not provided"); List<Argument> params = new ArrayList<Argument>(); Argument parg = null; for (Argument a : field.getArguments()) if (!(a.getName().equals("_reference"))) params.add(a); else if ((parg == null)) parg = a; else throw new EGraphQLException("Duplicate parameter _reference"); if (parg == null) throw new EGraphQLException("Missing parameter _reference"); Argument arg = new Argument(); params.add(arg); arg.setName(getSingleValue(parg)); arg.addValue(new StringValue(source.fhirType()+"/"+source.getId())); Bundle bnd = services.search(appInfo, field.getName().substring(0, field.getName().length()-10), params); Base bndWrapper = new SearchWrapper(field.getName(), bnd); arg = target.addField(field.getAlias()+suffix, listStatus(field, false)); ObjectValue obj = new ObjectValue(); arg.addValue(obj); processObject(null, bndWrapper, obj, field.getSelectionSet(), inheritedList, suffix); }
public void copyResource(org.hl7.fhir.r4.model.Resource src, org.hl7.fhir.instance.model.Resource tgt) throws FHIRException { tgt.setId(src.getId()); if (src.hasMeta()) tgt.setMeta(convertMeta(src.getMeta())); if (src.hasImplicitRules()) tgt.setImplicitRules(src.getImplicitRules()); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); }
b = getParam(vars, tgt.getParameter().get(0)); if (b instanceof Resource) return new UriType("urn:uuid:"+((Resource) b).getId()); else throw new FHIRException("Rule \""+ruleId+"\": Transform engine cannot point at an element of type "+b.fhirType());
private static void copyResource(org.hl7.fhir.r4.model.Resource src, org.hl7.fhir.dstu2016may.model.Resource tgt) throws FHIRException { if (src.hasId()) tgt.setId(src.getId()); if (src.hasMeta()) tgt.setMeta(convertMeta(src.getMeta())); if (src.hasImplicitRules()) tgt.setImplicitRules(src.getImplicitRules()); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); }
public static Resource getById(Bundle feed, ResourceType type, String reference) { for (BundleEntryComponent item : feed.getEntry()) { if (item.getResource().getId().equals(reference) && item.getResource().getResourceType() == type) return item.getResource(); } return null; }
public void copyResource(org.hl7.fhir.r4.model.Resource src, org.hl7.fhir.instance.model.Resource tgt) throws FHIRException { tgt.setId(src.getId()); if (src.hasMeta()) tgt.setMeta(convertMeta(src.getMeta())); if (src.hasImplicitRules()) tgt.setImplicitRules(src.getImplicitRules()); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); }
private static void copyResource(org.hl7.fhir.r4.model.Resource src, org.hl7.fhir.dstu2016may.model.Resource tgt) throws FHIRException { if (src.hasId()) tgt.setId(src.getId()); if (src.hasMeta()) tgt.setMeta(convertMeta(src.getMeta())); if (src.hasImplicitRules()) tgt.setImplicitRules(src.getImplicitRules()); if (src.hasLanguage()) tgt.setLanguage(src.getLanguage()); }