docs: protected void preProcessResourceForStorage(T theResource) {
  		String type = getContext().getResourceDefinition(theResource).getName();
  		if (!getResourceName().equals(type)) {
  			throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "incorrectResourceType", type, getResourceName()));
  		}
  
  		if (theResource.getIdElement().hasIdPart()) {
  			if (!theResource.getIdElement().isIdPartValid()) {
  				throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "failedToCreateWithInvalidId", theResource.getIdElement().getIdPart()));
  			}
  		}
  
  		/*
  		 * Replace absolute references with relative ones if configured to do so
  		 */
  		if (getConfig().getTreatBaseUrlsAsLocal().isEmpty() == false) {
  			FhirTerser t = getContext().newTerser();
  			List<ResourceReferenceInfo> refs = t.getAllResourceReferences(theResource);
  			for (ResourceReferenceInfo nextRef : refs) {
  				IIdType refId = nextRef.getResourceReference().getReferenceElement();
  				if (refId != null && refId.hasBaseUrl()) {
  					if (getConfig().getTreatBaseUrlsAsLocal().contains(refId.getBaseUrl())) {
  						IIdType newRefId = refId.toUnqualified();
  						nextRef.getResourceReference().setReference(newRefId.getValue());
  					}
  				}
  			}
  		}
  	}