Java Code Examples for org.hl7.fhir.dstu3.model.Identifier#hasValue()

The following examples show how to use org.hl7.fhir.dstu3.model.Identifier#hasValue() . 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: ValueSetUtilities.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
public static String getOID(ValueSet vs) {
  for (Identifier id : vs.getIdentifier()) {
    if ("urn:ietf:rfc:3986".equals(id.getSystem()) && id.hasValue() && id.getValue().startsWith("urn:oid:"))
      return id.getValue().substring(8);
  }
  return null;
}
 
Example 2
Source File: ValueSetUtilities.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
public static void setOID(ValueSet vs, String oid) {
  if (!oid.startsWith("urn:oid:"))
    oid = "urn:oid:" + oid;
  for (Identifier id : vs.getIdentifier()) {
    if ("urn:ietf:rfc:3986".equals(id.getSystem()) && id.hasValue() && id.getValue().startsWith("urn:oid:")) {
      id.setValue(oid);
      return;
    }
  }
  vs.addIdentifier().setSystem("urn:ietf:rfc:3986").setValue(oid);
}
 
Example 3
Source File: LibDaoR4.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
public BaseIdentifier setIdentifier(Identifier identifier, BaseIdentifier entityIdentifier) throws OperationOutcomeException {

        if (identifier.hasType()) {
            ConceptEntity code = conceptDao.findAddCode(identifier.getType().getCoding().get(0));
            if (code != null) {
                entityIdentifier.setIdentifierType(code);
            } else {
                log.info("IdentifierType: Missing System/Code = " + identifier.getType().getCoding().get(0).getSystem() + " code = " + identifier.getType().getCoding().get(0).getCode());

                throw new IllegalArgumentException("Missing System/Code = " + identifier.getType().getCoding().get(0).getSystem() + " code = " + identifier.getType().getCoding().get(0).getCode());
            }

        }
        if (identifier.hasValue()) {
            entityIdentifier.setValue(daoutilsR4.removeSpace(identifier.getValue()));
        }

        if (identifier.hasSystem()) {
            entityIdentifier.setSystem(codeSystemSvc.findSystem(identifier.getSystem()));
        } else {
            entityIdentifier.setSystem(null);
        }
        if (identifier.hasUse()) {
            entityIdentifier.setUse(identifier.getUse());
        }

        return entityIdentifier;
    }
 
Example 4
Source File: HQMFProvider.java    From cqf-ruler with Apache License 2.0 5 votes vote down vote up
private String resolveSetId(CqfMeasure m) {
    Identifier id = this.getIdentifierFor(m, "hqmf-set-id");
    if (id != null && id.hasValue() && !id.getValue().isEmpty()) {
        return id.getValue();
    }
    
    return m.getName();
}