Java Code Examples for org.hl7.fhir.r4.model.Identifier#setValue()

The following examples show how to use org.hl7.fhir.r4.model.Identifier#setValue() . 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: TestData.java    From bunsen with Apache License 2.0 6 votes vote down vote up
/**
 * Returns a FHIR Observation for testing purposes.
 */
public static Observation newObservation() {

  // Observation based on https://www.hl7.org/FHIR/observation-example-bloodpressure.json.html
  Observation observation = new Observation();

  observation.setId("blood-pressure");

  Identifier identifier = observation.addIdentifier();
  identifier.setSystem("urn:ietf:rfc:3986");
  identifier.setValue("urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281");

  observation.setStatus(Observation.ObservationStatus.FINAL);

  Quantity quantity = new Quantity();
  quantity.setValue(new java.math.BigDecimal("123.45"));
  quantity.setUnit("mm[Hg]");
  observation.setValue(quantity);

  return observation;
}
 
Example 2
Source File: daoutilsR4.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
public static Identifier getIdentifier(BaseIdentifier baseIdentifier, Identifier identifier) {
    if (baseIdentifier.getSystem() != null) identifier.setSystem(baseIdentifier.getSystem().getUri());
    if (baseIdentifier.getValue() != null) identifier.setValue(baseIdentifier.getValue());
    if (baseIdentifier.getUse() != null) {
        identifier.setUse(LibDaoR4.convertIdentifier(baseIdentifier.getIdentifierUse()));

    }
    if (baseIdentifier.getIdentifierType() != null) {
        identifier.getType()
                .addCoding()
                    .setCode(baseIdentifier.getIdentifierType().getCode())
                    .setDisplay(baseIdentifier.getIdentifierType().getDisplay())
                    .setSystem(baseIdentifier.getIdentifierType().getSystem());
    }
    return identifier;
}
 
Example 3
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 4
Source File: FhirR4.java    From synthea with Apache License 2.0 5 votes vote down vote up
private static Identifier generateIdentifier(String uid) {
  Identifier identifier = new Identifier();
  identifier.setUse(Identifier.IdentifierUse.OFFICIAL);
  identifier.setSystem("urn:ietf:rfc:3986");
  identifier.setValue("urn:oid:" + uid);
  return identifier;
}
 
Example 5
Source File: IContactHelper.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
public List<Identifier> getIdentifiers(IContact contact){
	List<Identifier> ret = new ArrayList<>();
	List<IXid> xids = xidService.getXids(contact);
	for (IXid xid : xids) {
		Identifier identifier = new Identifier();
		identifier.setSystem(xid.getDomain());
		identifier.setValue(xid.getDomainId());
		ret.add(identifier);
	}
	return ret;
}
 
Example 6
Source File: IPatientPatientAttributeMapper.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
private void mapIdentifiersAndPatientNumber(IPatient source, Patient target) {
	List<Identifier> identifiers = contactHelper.getIdentifiers(source);
	identifiers.add(getElexisObjectIdentifier(source));
	String patNr = source.getPatientNr();
	Identifier identifier = new Identifier();
	identifier.setSystem(IdentifierSystem.ELEXIS_PATNR.getSystem());
	identifier.setValue(patNr);
	identifiers.add(identifier);
	target.setIdentifier(identifiers);
}
 
Example 7
Source File: ObjectConverter.java    From org.hl7.fhir.core with Apache License 2.0 4 votes vote down vote up
public static Identifier readAsIdentifier(Element item) {
  Identifier r = new Identifier();
  r.setSystem(item.getNamedChildValue("system"));
  r.setValue(item.getNamedChildValue("value"));
  return r;
}
 
Example 8
Source File: IFhirTransformer.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
default Identifier getElexisObjectIdentifier(Identifiable dbObject) {
	Identifier identifier = new Identifier();
	identifier.setSystem(IdentifierSystem.ELEXIS_OBJID.getSystem());
	identifier.setValue(dbObject.getId());
	return identifier;
}
 
Example 9
Source File: IPatientPatientAttributeMapper.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
private Identifier getElexisObjectIdentifier(Identifiable dbObject) {
	Identifier identifier = new Identifier();
	identifier.setSystem(IdentifierSystem.ELEXIS_OBJID.getSystem());
	identifier.setValue(dbObject.getId());
	return identifier;
}