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 void copyResource(org.hl7.fhir.instance.model.Resource src, org.hl7.fhir.r4.model.Resource tgt) throws FHIRException { tgt.setId(src.getId()); tgt.setMeta(convertMeta(src.getMeta())); tgt.setImplicitRules(src.getImplicitRules()); tgt.setLanguage(src.getLanguage()); } public void copyResource(org.hl7.fhir.r4.model.Resource src, org.hl7.fhir.instance.model.Resource tgt) throws FHIRException {
public String getLanguage(String defValue) { return hasLanguage() ? getLanguage() : defValue; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 3355: return getIdElement(); case 3347973: return getMeta(); case -961826286: return getImplicitRulesElement(); case -1613589672: return getLanguageElement(); default: return super.makeProperty(hash, name); } }
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()); }
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()); next.getResource().setId(resourceId); } else { ourLog.info("Discarding resource with not explicit ID"); for (Iterator<org.hl7.fhir.r4.model.Bundle.BundleEntryComponent> iterator = bundle.getEntry().iterator(); iterator.hasNext(); ) { org.hl7.fhir.r4.model.Bundle.BundleEntryComponent next = iterator.next(); if (next.getResource().getIdElement().getIdPart() != null) { String nextId = next.getResource().getIdElement().getValue(); next.getRequest().setMethod(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); next.getRequest().setUrl(nextId);
public static String buildRelativePathFromReference(Resource resource, String id) { return buildRelativePathFromResourceType(resource.getResourceType(), id); }
@Override public String getIdBase() { return getId(); }
if (next instanceof DomainResource) { for (Resource nextContained : ((DomainResource) next).getContained()) { if (nextContained.getIdElement().isEmpty() == false) { containedIds.add(nextContained.getIdElement().getValue()); if (next.getIdElement().hasBaseUrl()) { entry.setFullUrl(next.getId()); if (httpVerb != null) { entry.getRequest().getMethodElement().setValueAsString(httpVerb); entry.getRequest().getUrlElement().setValue(next.getId());
for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent i : bundle.getEntry()) { org.hl7.fhir.r4.model.Resource next = i.getResource(); next.setId(next.getIdElement().toUnqualifiedVersionless()); ourLog.info("Uploading ValueSet {}/{} : {} ({} bytes}", new Object[] {count, total, next.getIdElement().getValue(), bytes}); try { IIdType id = client.update().resource(next).execute().getId(); for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent i : bundle.getEntry()) { org.hl7.fhir.r4.model.Resource next = i.getResource(); next.setId(next.getIdElement().toUnqualifiedVersionless()); ourLog.info("Uploading v3-codesystems ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()}); client.update().resource(next).execute(); for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent i : bundle.getEntry()) { org.hl7.fhir.r4.model.Resource next = i.getResource(); if (next.getIdElement().isIdPartValidLong()) { next.setIdElement(new org.hl7.fhir.r4.model.IdType("v2-" + next.getIdElement().getIdPart())); next.setId(next.getIdElement().toUnqualifiedVersionless()); ourLog.info("Uploading v2-tables ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()}); client.update().resource(next).execute(); count++;
public boolean hasContained() { if (this.contained == null) return false; for (Resource item : this.contained) if (!item.isEmpty()) return true; return false; }
next.setId(next.getIdElement().toUnqualifiedVersionless()); if (next instanceof org.hl7.fhir.r4.model.CapabilityStatement) { continue; ourLog.info("Uploading {} StructureDefinition {}/{} : {}", new Object[] {theName, count, total, next.getIdElement().getValue()}); try { theClient.update().resource(next).execute();
@Override public void setIdBase(String value) { setId(value); } public abstract ResourceType getResourceType();
@Override public IPrimitiveType<Date> getLastUpdated(IBaseResource theResource) { return ((Resource) theResource).getMeta().getLastUpdatedElement(); }
private boolean targetTypeOk(List<Argument> arguments, Resource dest) throws EGraphQLException { List<String> list = new ArrayList<String>(); for (Argument arg : arguments) { if ((arg.getName().equals("type"))) { List<Value> vl = resolveValues(arg); for (Value v : vl) list.add(v.toString()); } } if (list.size() == 0) return true; else return list.indexOf(dest.fhirType()) > -1; }
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()); }
public static String buildRelativePathFromReference(Resource resource) { return buildRelativePathFromResourceType(resource.getResourceType()); }