public static String buildRelativePathFromReference(Resource resource) { return buildRelativePathFromResourceType(resource.getResourceType()); }
public static String buildRelativePathFromReference(Resource resource, String id) { return buildRelativePathFromResourceType(resource.getResourceType(), id); }
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; }
@Override public void compose(OutputStream stream, Resource resource) throws IOException { Turtle ttl = new Turtle(); // ttl.setFormat(FFormat); ttl.prefix("fhir", "http://hl7.org/fhir/"); ttl.prefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); Section section = ttl.section("resource"); Subject subject; if (url != null) subject = section.triple("<"+url+">", "a", "fhir:"+resource.getResourceType().toString()); else subject = section.triple("[]", "a", "fhir:"+resource.getResourceType().toString()); composeResource(subject, resource); try { ttl.commit(stream, false); } catch (Exception e) { throw new IOException(e); } }
be.setResource(b.getEntry().get(i).getResource()); be.getRequest().setMethod(HTTPVerb.PUT); be.getRequest().setUrl(be.getResource().getResourceType().toString()+"/"+be.getResource().getId());
if ("Subscription".equals(next.getResource().getResourceType()) || "DataElement".equals(next.getResource().getResourceType()) || "OperationOutcome".equals(next.getResource().getResourceType()) || "OperationDefinition".equals(next.getResource().getResourceType())) { ourLog.info("Skipping " + next.getResource().getResourceType() + " example"); iterator.remove(); } else { IdDt resourceId = new IdDt(next.getResource().getResourceType() + "/EX" + next.getResource().getIdElement().getIdPart()); if (!fullIds.add(resourceId.toUnqualifiedVersionless().getValue())) { ourLog.info("Discarding duplicate resource: " + resourceId.getValue());
if (!profile.getType().equals(resource.getResourceType().toString())) throw new DefinitionException("Wrong Type");
public static String buildRelativePathFromReference(Resource resource, String id) { return buildRelativePathFromResourceType(resource.getResourceType(), id); }
public static String buildRelativePathFromReference(Resource resource) { return buildRelativePathFromResourceType(resource.getResourceType()); }
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; }
/** * Converts a {@link Bundle} into a map grouped by the entry resources types * * @param bundle Bundle * @return map of entries grouped by their resource type */ public static Map<ResourceType, List<Bundle.BundleEntryComponent>> getBundleEntries(Bundle bundle) { return bundle.getEntry().stream() .collect(Collectors.groupingBy(entry -> { Bundle.BundleEntryRequestComponent request = entry.getRequest(); if (request == null || request.getUrl() == null) { throw unprocessableEntity( OperationOutcome.IssueSeverity.ERROR, OperationOutcome.IssueType.INVALID, null, null, "Invalid bundle entry request element %s", entry); } return entry.getResource().getResourceType(); } , LinkedHashMap::new, Collectors.toList())); }
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; }
@Override public void compose(OutputStream stream, Resource resource) throws IOException { Turtle ttl = new Turtle(); // ttl.setFormat(FFormat); ttl.prefix("fhir", "http://hl7.org/fhir/"); ttl.prefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); Section section = ttl.section("resource"); Subject subject; if (url != null) subject = section.triple("<"+url+">", "a", "fhir:"+resource.getResourceType().toString()); else subject = section.triple("[]", "a", "fhir:"+resource.getResourceType().toString()); composeResource(subject, resource); try { ttl.commit(stream, false); } catch (Exception e) { throw new IOException(e); } }
be.setResource(b.getEntry().get(i).getResource()); be.getRequest().setMethod(HTTPVerb.PUT); be.getRequest().setUrl(be.getResource().getResourceType().toString()+"/"+be.getResource().getId());
.flatMap(Collection::stream) .forEach(entry -> { if (ResourceType.DocumentReference == entry.getResource().getResourceType()) { if (!expectedReferenceFullUrls.remove(entry.getFullUrl())) { throw FhirUtils.unprocessableEntity( ); } else if (ResourceType.Binary == entry.getResource().getResourceType()) { if (!expectedBinaryFullUrls.remove(entry.getFullUrl())) { throw FhirUtils.unprocessableEntity(
if (!profile.getType().equals(resource.getResourceType().toString())) throw new DefinitionException("Wrong Type");