@Override public IReadExecutable withIdAndVersion(String theId, String theVersion) { Validate.notBlank(theId, "The ID can not be blank"); myId = new IdDt(myType.getName(), theId, theVersion); return this; }
@Override public IDeleteWithQuery resourceConditionalByType(Class<? extends IBaseResource> theResourceType) { Validate.notNull(theResourceType, "theResourceType can not be null"); myConditional = true; myResourceType = myContext.getResourceDefinition(theResourceType).getName(); return this; }
@Override public int compare(RuntimeResourceDefinition theO1, RuntimeResourceDefinition theO2) { int cmp = theO1.getName().compareTo(theO2.getName()); if (cmp==0) { cmp=theO1.getResourceProfile(serverBase).compareTo(theO2.getResourceProfile(serverBase)); } return cmp; }}); ArrayList<StructureDefinition> retVal = new ArrayList<>();
@Override public IReadExecutable withId(Long theId) { Validate.notNull(theId, "The ID can not be null"); myId = new IdDt(myType.getName(), theId); return this; }
private void setType(Class<? extends IBaseResource> theResourceType) { myResourceType = theResourceType; RuntimeResourceDefinition definition = myContext.getResourceDefinition(theResourceType); myResourceName = definition.getName(); }
private void initializeMaps(Collection<IFhirResourceDao> theResourceDaos) { myResourceNameToResourceDao = new HashMap<>(); for (IFhirResourceDao nextResourceDao : theResourceDaos) { RuntimeResourceDefinition nextResourceDef = myContext.getResourceDefinition(nextResourceDao.getResourceType()); myResourceNameToResourceDao.put(nextResourceDef.getName(), nextResourceDao); } }
@Override public IReadExecutable withId(String theId) { Validate.notBlank(theId, "The ID can not be blank"); if (theId.indexOf('/') == -1) { myId = new IdDt(myType.getName(), theId); } else { myId = new IdDt(theId); } return this; }
public static HttpPutClientInvocation createUpdateInvocation(FhirContext theContext, IBaseResource theResource, String theResourceBody, Map<String, List<String>> theMatchParams) { String resourceType = theContext.getResourceDefinition(theResource).getName(); StringBuilder b = createUrl(resourceType, theMatchParams); HttpPutClientInvocation retVal; if (StringUtils.isBlank(theResourceBody)) { retVal = new HttpPutClientInvocation(theContext, theResource, b.toString()); } else { retVal = new HttpPutClientInvocation(theContext, theResourceBody, false, b.toString()); } return retVal; }
@Override protected BaseHttpClientInvocation createClientInvocation(Object[] theArgs, IBaseResource theResource) { StringBuilder urlExtension = new StringBuilder(); urlExtension.append(getContext().getResourceDefinition(theResource).getName()); return new HttpPostClientInvocation(getContext(), theResource, urlExtension.toString()); }
public Collection<RuntimeSearchParam> getSearchParams(IBaseResource theResource) { RuntimeResourceDefinition def = getContext().getResourceDefinition(theResource); Collection<RuntimeSearchParam> retVal = mySearchParamRegistry.getActiveSearchParams(def.getName()).values(); List<RuntimeSearchParam> defaultList = Collections.emptyList(); retVal = ObjectUtils.defaultIfNull(retVal, defaultList); return retVal; }
@Override public IBaseResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase) { StructureDefinition retVal = new StructureDefinition(); RuntimeResourceDefinition def = theRuntimeResourceDefinition; myId = def.getId(); if (StringUtils.isBlank(myId)) { myId = theRuntimeResourceDefinition.getName().toLowerCase(); } retVal.setId(new IdDt(myId)); return retVal; }
@Override public IBaseResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase) { StructureDefinition retVal = new StructureDefinition(); RuntimeResourceDefinition def = theRuntimeResourceDefinition; myId = def.getId(); if (StringUtils.isBlank(myId)) { myId = theRuntimeResourceDefinition.getName().toLowerCase(); } retVal.setId(new IdDt(myId)); return retVal; }
@Override public void resourceUpdated(RequestDetails theRequest, IBaseResource theOldResource, IBaseResource theNewResource) { if (myDao.getContext().getResourceDefinition(theNewResource).getName().equals(ResourceTypeEnum.SUBSCRIPTION.getCode())) { verifyStatusOk(RestOperationTypeEnum.UPDATE, theOldResource, theNewResource); } }
@Override public void resourceCreated(RequestDetails theRequest, IBaseResource theResource) { if (myDao.getContext().getResourceDefinition(theResource).getName().equals(ResourceTypeEnum.SUBSCRIPTION.getCode())) { verifyStatusOk(RestOperationTypeEnum.CREATE, null, theResource); } }
@Override public void resourceCreated(RequestDetails theRequest, IBaseResource theResource) { if (myDao.getContext().getResourceDefinition(theResource).getName().equals(ResourceTypeEnum.SUBSCRIPTION.getCode())) { verifyStatusOk(RestOperationTypeEnum.CREATE, null, theResource); } }
@Override public void resourceCreated(RequestDetails theRequest, IBaseResource theResource) { if (myDao.getContext().getResourceDefinition(theResource).getName().equals(ResourceTypeEnum.SUBSCRIPTION.getCode())) { verifyStatusOk(RestOperationTypeEnum.CREATE, null, theResource); } }
public static BaseHttpClientInvocation createValidateInvocation(FhirContext theContext, IBaseResource theResource) { IBaseParameters parameters = (IBaseParameters) theContext.getResourceDefinition("Parameters").newInstance(); ParametersUtil.addParameterToParameters(theContext, parameters, "resource", theResource); String resourceName = theContext.getResourceDefinition(theResource).getName(); String resourceId = theResource.getIdElement().getIdPart(); BaseHttpClientInvocation retVal = createOperationInvocation(theContext, resourceName, resourceId, null,Constants.EXTOP_VALIDATE, parameters, false); return retVal; }
@Override public IBaseResource getResource(IIdType payloadId) throws ResourceGoneException { RuntimeResourceDefinition resourceDef = myFhirContext.getResourceDefinition(payloadId.getResourceType()); return myClient.search().forResource(resourceDef.getName()).withIdAndCompartment(payloadId.getIdPart(), payloadId.getResourceType()).execute(); } }
SubscriptionMatchResult match(String criteria, IBaseResource resource) { ResourceTable entity = new ResourceTable(); String resourceType = myContext.getResourceDefinition(resource).getName(); entity.setResourceType(resourceType); ResourceIndexedSearchParams searchParams = new ResourceIndexedSearchParams(); mySearchParamExtractorService.extractFromResource(searchParams, entity, resource); myResourceLinkExtractor.extractResourceLinks(searchParams, entity, resource, resource.getMeta().getLastUpdated(), myInlineResourceLinkResolver, false); return myCriteriaResourceMatcher.match(criteria, resource, searchParams); } }
private void populateBundleEntryFullUrl(IBaseResource next, BundleEntryComponent entry) { if (next.getIdElement().hasBaseUrl()) { entry.setFullUrl(next.getIdElement().toVersionless().getValue()); } else { if (isNotBlank(myBase) && next.getIdElement().hasIdPart()) { IIdType id = next.getIdElement().toVersionless(); id = id.withServerBase(myBase, myContext.getResourceDefinition(next).getName()); entry.setFullUrl(id.getValue()); } } }