private String getSubsettedCodeSystem() { if (myContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.R4)) { return Constants.TAG_SUBSETTED_SYSTEM_R4; } else { return Constants.TAG_SUBSETTED_SYSTEM_DSTU3; } }
private void scanBlock(Class<? extends IBase> theClass) { ourLog.debug("Scanning resource block class: {}", theClass.getName()); String resourceName = theClass.getCanonicalName(); if (isBlank(resourceName)) { throw new ConfigurationException("Block type @" + Block.class.getSimpleName() + " annotation contains no name: " + theClass.getCanonicalName()); } // Just in case someone messes up when upgrading from DSTU2 if (myContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { if (BaseIdentifiableElement.class.isAssignableFrom(theClass)) { throw new ConfigurationException("@Block class for version " + myContext.getVersion().getVersion().name() + " should not extend " + BaseIdentifiableElement.class.getSimpleName() + ": " + theClass.getName()); } } RuntimeResourceBlockDefinition blockDef = new RuntimeResourceBlockDefinition(resourceName, theClass, isStandardType(theClass), myContext, myClassToElementDefinitions); blockDef.populateScanAlso(myScanAlso); myClassToElementDefinitions.put(theClass, blockDef); }
if (!theContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.R4)) { String[] expressionSplit = BaseSearchParamExtractor.SPLIT.split(theExpression); for (String nextPath : expressionSplit) { if (theContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { if (theDaoConfig.isValidateSearchParameterExpressionsOnSave()) { IBaseResource temporaryInstance = theContext.getResourceDefinition(resourceName).newInstance();
public static IBaseResource parseResourceFromRequest(RequestDetails theRequest, BaseMethodBinding<?> theMethodBinding, Class<? extends IBaseResource> theResourceType) { IBaseResource retVal = null; if (theResourceType != null && IBaseBinary.class.isAssignableFrom(theResourceType)) { String ct = theRequest.getHeader(Constants.HEADER_CONTENT_TYPE); if (EncodingEnum.forContentTypeStrict(ct) == null) { FhirContext ctx = theRequest.getServer().getFhirContext(); IBaseBinary binary = BinaryUtil.newBinary(ctx); binary.setId(theRequest.getId()); binary.setContentType(ct); binary.setContent(theRequest.loadRequestContents()); retVal = binary; /* * Security context header, which is only in * DSTU3+ */ if (ctx.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { String securityContext = theRequest.getHeader(Constants.HEADER_X_SECURITY_CONTEXT); if (isNotBlank(securityContext)) { BinaryUtil.setSecurityContext(ctx, binary, securityContext); } } } } if (retVal == null) { retVal = loadResourceFromRequest(theRequest, theMethodBinding, theResourceType); } return retVal; }
private String getSubsettedCodeSystem() { if (myContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.R4)) { return Constants.TAG_SUBSETTED_SYSTEM_R4; } else { return Constants.TAG_SUBSETTED_SYSTEM_DSTU3; } }
private void scanBlock(Class<? extends IBase> theClass) { ourLog.debug("Scanning resource block class: {}", theClass.getName()); String resourceName = theClass.getCanonicalName(); if (isBlank(resourceName)) { throw new ConfigurationException("Block type @" + Block.class.getSimpleName() + " annotation contains no name: " + theClass.getCanonicalName()); } // Just in case someone messes up when upgrading from DSTU2 if (myContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { if (BaseIdentifiableElement.class.isAssignableFrom(theClass)) { throw new ConfigurationException("@Block class for version " + myContext.getVersion().getVersion().name() + " should not extend " + BaseIdentifiableElement.class.getSimpleName() + ": " + theClass.getName()); } } RuntimeResourceBlockDefinition blockDef = new RuntimeResourceBlockDefinition(resourceName, theClass, isStandardType(theClass), myContext, myClassToElementDefinitions); blockDef.populateScanAlso(myScanAlso); myClassToElementDefinitions.put(theClass, blockDef); }
if (!theContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.R4)) { String[] expressionSplit = BaseSearchParamExtractor.SPLIT.split(theExpression); for (String nextPath : expressionSplit) { if (theContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { if (theDaoConfig.isValidateSearchParameterExpressionsOnSave()) { IBaseResource temporaryInstance = theContext.getResourceDefinition(resourceName).newInstance();
public static IBaseResource parseResourceFromRequest(RequestDetails theRequest, BaseMethodBinding<?> theMethodBinding, Class<? extends IBaseResource> theResourceType) { IBaseResource retVal = null; if (theResourceType != null && IBaseBinary.class.isAssignableFrom(theResourceType)) { String ct = theRequest.getHeader(Constants.HEADER_CONTENT_TYPE); if (EncodingEnum.forContentTypeStrict(ct) == null) { FhirContext ctx = theRequest.getServer().getFhirContext(); IBaseBinary binary = BinaryUtil.newBinary(ctx); binary.setId(theRequest.getId()); binary.setContentType(ct); binary.setContent(theRequest.loadRequestContents()); retVal = binary; /* * Security context header, which is only in * DSTU3+ */ if (ctx.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { String securityContext = theRequest.getHeader(Constants.HEADER_X_SECURITY_CONTEXT); if (isNotBlank(securityContext)) { BinaryUtil.setSecurityContext(ctx, binary, securityContext); } } } } if (retVal == null) { retVal = loadResourceFromRequest(theRequest, theMethodBinding, theResourceType); } return retVal; }