Java Code Examples for org.hl7.fhir.instance.model.api.IBaseResource#getIdElement()

The following examples show how to use org.hl7.fhir.instance.model.api.IBaseResource#getIdElement() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IdType.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieves the ID from the given resource instance
 */
public static IdType of(IBaseResource theResouce) {
  if (theResouce == null) {
    throw new NullPointerException("theResource can not be null");
  } else {
    IIdType retVal = theResouce.getIdElement();
    if (retVal == null) {
      return null;
    } else if (retVal instanceof IdType) {
      return (IdType) retVal;
    } else {
      return new IdType(retVal.getValue());
    }
  }
}
 
Example 2
Source File: IdType.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieves the ID from the given resource instance
 */
public static IdType of(IBaseResource theResouce) {
  if (theResouce == null) {
    throw new NullPointerException("theResource can not be null");
  } else {
    IIdType retVal = theResouce.getIdElement();
    if (retVal == null) {
      return null;
    } else if (retVal instanceof IdType) {
      return (IdType) retVal;
    } else {
      return new IdType(retVal.getValue());
    }
  }
}
 
Example 3
Source File: IdType.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieves the ID from the given resource instance
 */
public static IdType of(IBaseResource theResouce) {
  if (theResouce == null) {
    throw new NullPointerException("theResource can not be null");
  } else {
    IIdType retVal = theResouce.getIdElement();
    if (retVal == null) {
      return null;
    } else if (retVal instanceof IdType) {
      return (IdType) retVal;
    } else {
      return new IdType(retVal.getValue());
    }
  }
}