本文整理汇总了Java中ca.uhn.fhir.model.primitive.IdDt.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java IdDt.getValue方法的具体用法?Java IdDt.getValue怎么用?Java IdDt.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca.uhn.fhir.model.primitive.IdDt
的用法示例。
在下文中一共展示了IdDt.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invokeClient
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Override
public BaseHttpClientInvocation invokeClient(Object[] theArgs) throws InternalErrorException {
String id = null;
if (myIdParamIndex != null) {
IdDt idDt = (IdDt) theArgs[myIdParamIndex];
id = idDt.getValue();
}
IBaseParameters parameters = (IBaseParameters) getContext().getResourceDefinition("Parameters").newInstance();
if (theArgs != null) {
for (int idx = 0; idx < theArgs.length; idx++) {
IParameter nextParam = getParameters().get(idx);
nextParam.translateClientArgumentIntoQueryArgument(getContext(), theArgs[idx], null, parameters);
}
}
return createOperationInvocation(getContext(), getResourceName(), id, myName, parameters, false);
}
示例2: updatePatient
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
/**
* The "@Update" annotation indicates that this method supports replacing an existing
* resource (by ID) with a new instance of that resource.
*
* @param theId
* This is the ID of the patient to update
* @param thePatient
* This is the actual resource to save
* @return This method returns a "MethodOutcome"
*/
@Update()
public MethodOutcome updatePatient(@IdParam IdDt theId, @ResourceParam Patient thePatient) {
validateResource(thePatient);
Long id;
try {
id = theId.getIdPartAsLong();
} catch (DataFormatException e) {
throw new InvalidRequestException("Invalid ID " + theId.getValue() + " - Must be numeric");
}
/*
* Throw an exception (HTTP 404) if the ID is not known
*/
if (!myIdToPatientVersions.containsKey(id)) {
throw new ResourceNotFoundException(theId);
}
addNewVersion(thePatient, id);
return new MethodOutcome();
}
示例3: loadResource
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
/**
* Returns the referenced resource, fetching it <b>if it has not already been loaded</b>. This method invokes the HTTP client to retrieve the resource unless it has already been loaded, or was a
* contained resource in which case it is simply returned.
*/
public IResource loadResource(IRestfulClient theClient) throws IOException {
if (myResource != null) {
return myResource;
}
IdDt resourceId = getReference();
if (resourceId == null) {
throw new IllegalStateException("Reference has no resource ID defined");
}
String resourceUrl = resourceId.getValue();
ourLog.debug("Loading resource at URL: {}", resourceUrl);
HttpClient httpClient = theClient.getHttpClient();
FhirContext context = theClient.getFhirContext();
if (!resourceUrl.startsWith("http")) {
resourceUrl = theClient.getServerBase() + resourceUrl;
}
HttpGet get = new HttpGet(resourceUrl);
HttpResponse response = httpClient.execute(get);
try {
// TODO: choose appropriate parser based on response CT
IParser parser = context.newXmlParser();
Reader responseReader = BaseClient.createReaderFromResponse(response);
myResource = parser.parseResource(responseReader);
} finally {
if (response instanceof CloseableHttpResponse) {
((CloseableHttpResponse) response).close();
}
}
return myResource;
}
示例4: setId
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
/**
* @deprecated Use {@link #setElementSpecificId(String)} instead. This method will be removed because it is easily
* confused with other ID methods (such as patient#getIdentifier)
*/
@Deprecated
@Override
public void setId(IdDt theId) {
if (theId == null) {
myElementSpecificId = null;
} else {
myElementSpecificId = theId.getValue();
}
}
示例5: history
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Override
public <T extends IResource> Bundle history(final Class<T> theType, IdDt theIdDt, DateTimeDt theSince, Integer theLimit) {
String resourceName = theType != null ? toResourceName(theType) : null;
String id = theIdDt != null && theIdDt.isEmpty() == false ? theIdDt.getValue() : null;
HttpGetClientInvocation invocation = HistoryMethodBinding.createHistoryInvocation(resourceName, id, theSince, theLimit);
if (isKeepResponses()) {
myLastRequest = invocation.asHttpRequest(getServerBase(), createExtraParams(), getEncoding());
}
BundleResponseHandler binding = new BundleResponseHandler(theType);
Bundle resp = invokeClient(myContext, binding, invocation, myLogRequestAndResponse);
return resp;
}
示例6: resource
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Override
public IDeleteTyped resource(IResource theResource) {
Validate.notNull(theResource, "theResource can not be null");
IdDt id = theResource.getId();
Validate.notNull(id, "theResource.getId() can not be null");
if (id.hasResourceType() == false || id.hasIdPart() == false) {
throw new IllegalArgumentException("theResource.getId() must contain a resource type and logical ID at a minimum (e.g. Patient/1234), found: " + id.getValue());
}
myId = id;
return this;
}
示例7: resourceById
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Override
public IDeleteTyped resourceById(IdDt theId) {
Validate.notNull(theId, "theId can not be null");
if (theId.hasResourceType() == false || theId.hasIdPart() == false) {
throw new IllegalArgumentException("theId must contain a resource type and logical ID at a minimum (e.g. Patient/1234)found: " + theId.getValue());
}
myId = theId;
return this;
}
示例8: onInstance
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Override
public IHistoryUntyped onInstance(IdDt theId) {
if (theId.hasResourceType() == false) {
throw new IllegalArgumentException("Resource ID does not have a resource type: " + theId.getValue());
}
myId = theId;
return this;
}
示例9: withId
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
@Override
public IUpdateExecutable withId(IdDt theId) {
if (theId == null) {
throw new NullPointerException("theId can not be null");
}
if (theId.hasIdPart() == false) {
throw new NullPointerException("theId must not be blank and must contain an ID, found: " + theId.getValue());
}
myId = theId;
return this;
}
示例10: createValidateInvocation
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
public static HttpPostClientInvocation createValidateInvocation(IResource theResource, IdDt theId, FhirContext theContext) {
StringBuilder urlExtension = new StringBuilder();
urlExtension.append(theContext.getResourceDefinition(theResource).getName());
urlExtension.append('/');
urlExtension.append(Constants.PARAM_VALIDATE);
if (theId != null && theId.isEmpty() == false) {
String id = theId.getValue();
urlExtension.append('/');
urlExtension.append(id);
}
// TODO: is post correct here?
HttpPostClientInvocation retVal = new HttpPostClientInvocation(theContext, theResource, urlExtension.toString());
return retVal;
}
示例11: readPatient
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
/**
* This is the "read" operation. The "@Read" annotation indicates that this method supports the read and/or vread operation.
* <p>
* Read operations take a single parameter annotated with the {@link IdParam} paramater, and should return a single resource instance.
* </p>
*
* @param theId
* The read operation takes one parameter, which must be of type IdDt and must be annotated with the "@Read.IdParam" annotation.
* @return Returns a resource matching this identifier, or null if none exists.
*/
@Read(version = true)
public Patient readPatient(@IdParam IdDt theId) {
Deque<Patient> retVal;
try {
retVal = myIdToPatientVersions.get(theId.getIdPartAsLong());
} catch (NumberFormatException e) {
/*
* If we can't parse the ID as a long, it's not valid so this is an unknown resource
*/
throw new ResourceNotFoundException(theId);
}
if (theId.hasVersionIdPart() == false) {
return retVal.getLast();
} else {
for (Patient nextVersion : retVal) {
String nextVersionId = nextVersion.getId().getVersionIdPart();
if (theId.getVersionIdPart().equals(nextVersionId)) {
return nextVersion;
}
}
// No matching version
throw new ResourceNotFoundException("Unknown version: " + theId.getValue());
}
}
示例12: ResourceGoneException
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
public ResourceGoneException(IdDt theId) {
super(STATUS_CODE, "Resource " + (theId != null ? theId.getValue() : "") + " is gone/deleted");
}
示例13: createErrorMessage
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
private static String createErrorMessage(IdDt theId) {
return "Resource " + (theId != null ? theId.getValue() : "") + " is not known";
}
示例14: createAbsoluteVReadInvocation
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
public static HttpGetClientInvocation createAbsoluteVReadInvocation(IdDt theId) {
return new HttpGetClientInvocation(theId.getValue());
}
示例15: hasId
import ca.uhn.fhir.model.primitive.IdDt; //导入方法依赖的package包/类
/**
* Match the referenced resource if the resource has the given ID (this can be
* the logical ID or the absolute URL of the resource)
*/
public ICriterion<ReferenceClientParam> hasId(IdDt theId) {
return new StringCriterion<ReferenceClientParam>(getParamName(), theId.getValue());
}