All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.somda.sdc.biceps.model.participant.InstanceIdentifier Maven / Gradle / Ivy

Go to download

SDCri is a set of Java libraries that implements a network communication framework conforming with the IEEE 11073 SDC specifications. This project implements the model for IEEE 11073-10207.

The newest version!

package org.somda.sdc.biceps.model.participant;

import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
import org.jetbrains.annotations.Nullable;
import org.jvnet.jaxb.lang.CopyStrategy;
import org.jvnet.jaxb.lang.CopyTo;
import org.jvnet.jaxb.lang.JAXBCopyStrategy;
import org.jvnet.jaxb.lang.JAXBToStringStrategy;
import org.jvnet.jaxb.lang.ToString;
import org.jvnet.jaxb.lang.ToStringStrategy;
import org.jvnet.jaxb.locator.ObjectLocator;
import org.jvnet.jaxb.locator.util.LocatorUtils;
import org.somda.sdc.biceps.model.extension.ExtensionType;


/**
 * An identifier that uniquely identifies a thing or object.
 * 
 * Examples: object identifiers for medical record numbers, order ids, location ids, etc. InstanceIdentifier is defined in accordance to [InstanceIdentifier].
 * 
 * ./@Root and ./@Extension of an instance identifier do not identify the type of the object being identified, or the type of the association between the object and the identifier - they only form the identifier itself. The identifier type SHALL be expressed by ./Type.
 * 
 * 

Java class for InstanceIdentifier complex type

. * *

The following schema fragment specifies the expected content contained within this class.

* *
{@code
 * 
 *   
 *     
 *       
 *         
 *         
 *         
 *       
 *       
 *         
 *           
 *             
 *           
 *         
 *       
 *       
 *         
 *           
 *             
 *           
 *         
 *       
 *     
 *   
 * 
 * }
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InstanceIdentifier", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant", propOrder = { "extension", "type", "identifierName" }) @XmlSeeAlso({ OperatingJurisdiction.class }) public class InstanceIdentifier implements Cloneable, CopyTo, ToString { @XmlElement(name = "Extension", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/extension") protected ExtensionType extension; /** * Type designates the type of the instance identifier, e.g., whether it is an MRN, license number, visit number etc. * * Since it is possible that semantic meaning of an instance identifier is comprehensively conveyed using the encompassing XML ELEMENTs, Type is OPTIONAL. * */ @XmlElement(name = "Type", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant") protected CodedValue type; /** * IdentifierName is a localized human-readable name for the namespace represented in ./@Root. * * NOTE—IdentifierName has no computational value and hence can never modify the meaning of ./@Root. The purpose of IdentifierName is to assist an unaided human interpreter of an instance identifier value to interpret the identifier. Applications ought not to perform any decision-making, matching, filtering or other processing based on this presence or value of this property. It is for display and development assistance only. * */ @XmlElement(name = "IdentifierName", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/participant") protected List identifierName; /** * A unique identifier that guarantees the global uniqueness of the instance identifier. Root alone is allowed to build the entire instance identifier. * * If ./@Extension is present, Root is the unique identifier for the "namespace" of the identifier in ./@Extension. * * In situations where ./@Extension is known, but Root is not known, the implied value of a non-existent Root SHALL match the value defined in R0135. * * NOTE—Example: a POC MEDICAL DEVICE with an attached simple bar code scanner could create a new instance identifier with an unknown root and an extension that is set to the bar code number. Root is then applied later in time. * */ @XmlAttribute(name = "Root") protected String rootName; /** * A character string as a unique identifier within the scope of pm:InstanceIdentifier/pm:Root. * If a non-null Extension exists, pm:InstanceIdentifier/pm:Root specifies a namespace ("assigning authority" or "identifier type"). * * __R5008: Extension MAY be empty if pm:InstanceIdentifier/pm:Root is the complete unique identifier.__ * * __R5009: If pm:InstanceIdentifier/pm:Root is not a complete unique identifier and Extension is not known, then Extension SHALL be populated with a null-flavor "Unknown".__ * * NOTE—How the null-flavor "Unknown" is encoded, depends on the use-case and type of pm:InstanceIdentifier/pm:Root URI. * */ @XmlAttribute(name = "Extension") protected String extensionName; /** * Gets the value of the extension property. * * @return * possible object is * {@link ExtensionType } * */ @Nullable public ExtensionType getExtension() { return extension; } /** * Sets the value of the extension property. * * @param value * allowed object is * {@link ExtensionType } * */ public void setExtension( @Nullable ExtensionType value) { this.extension = value; } /** * Type designates the type of the instance identifier, e.g., whether it is an MRN, license number, visit number etc. * * Since it is possible that semantic meaning of an instance identifier is comprehensively conveyed using the encompassing XML ELEMENTs, Type is OPTIONAL. * * @return * possible object is * {@link CodedValue } * */ @Nullable public CodedValue getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link CodedValue } * * @see #getType() */ public void setType( @Nullable CodedValue value) { this.type = value; } /** * IdentifierName is a localized human-readable name for the namespace represented in ./@Root. * * NOTE—IdentifierName has no computational value and hence can never modify the meaning of ./@Root. The purpose of IdentifierName is to assist an unaided human interpreter of an instance identifier value to interpret the identifier. Applications ought not to perform any decision-making, matching, filtering or other processing based on this presence or value of this property. It is for display and development assistance only. * * Gets the value of the identifierName property. * *

This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the identifierName property.

* *

* For example, to add a new item, do as follows: *

*
     * getIdentifierName().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link LocalizedText } *

* * * @return * The value of the identifierName property. */ public List getIdentifierName() { if (identifierName == null) { identifierName = new ArrayList<>(); } return this.identifierName; } /** * A unique identifier that guarantees the global uniqueness of the instance identifier. Root alone is allowed to build the entire instance identifier. * * If ./@Extension is present, Root is the unique identifier for the "namespace" of the identifier in ./@Extension. * * In situations where ./@Extension is known, but Root is not known, the implied value of a non-existent Root SHALL match the value defined in R0135. * * NOTE—Example: a POC MEDICAL DEVICE with an attached simple bar code scanner could create a new instance identifier with an unknown root and an extension that is set to the bar code number. Root is then applied later in time. * * @return * possible object is * {@link String } * */ @Nullable public String getRootName() { return rootName; } /** * Sets the value of the rootName property. * * @param value * allowed object is * {@link String } * * @see #getRootName() */ public void setRootName( @Nullable String value) { this.rootName = value; } /** * A character string as a unique identifier within the scope of pm:InstanceIdentifier/pm:Root. * If a non-null Extension exists, pm:InstanceIdentifier/pm:Root specifies a namespace ("assigning authority" or "identifier type"). * * __R5008: Extension MAY be empty if pm:InstanceIdentifier/pm:Root is the complete unique identifier.__ * * __R5009: If pm:InstanceIdentifier/pm:Root is not a complete unique identifier and Extension is not known, then Extension SHALL be populated with a null-flavor "Unknown".__ * * NOTE—How the null-flavor "Unknown" is encoded, depends on the use-case and type of pm:InstanceIdentifier/pm:Root URI. * * @return * possible object is * {@link String } * */ @Nullable public String getExtensionName() { return extensionName; } /** * Sets the value of the extensionName property. * * @param value * allowed object is * {@link String } * * @see #getExtensionName() */ public void setExtensionName( @Nullable String value) { this.extensionName = value; } public void setIdentifierName( @Nullable List value) { this.identifierName = null; if (value!= null) { List draftl = this.getIdentifierName(); draftl.addAll(value); } } @Override public boolean equals(Object object) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final InstanceIdentifier that = ((InstanceIdentifier) object); { ExtensionType leftExtension; leftExtension = this.getExtension(); ExtensionType rightExtension; rightExtension = that.getExtension(); if (this.extension!= null) { if (that.extension!= null) { if (!leftExtension.equals(rightExtension)) { return false; } } else { return false; } } else { if (that.extension!= null) { return false; } } } { CodedValue leftType; leftType = this.getType(); CodedValue rightType; rightType = that.getType(); if (this.type!= null) { if (that.type!= null) { if (!leftType.equals(rightType)) { return false; } } else { return false; } } else { if (that.type!= null) { return false; } } } { List leftIdentifierName; leftIdentifierName = (((this.identifierName!= null)&&(!this.identifierName.isEmpty()))?this.getIdentifierName():null); List rightIdentifierName; rightIdentifierName = (((that.identifierName!= null)&&(!that.identifierName.isEmpty()))?that.getIdentifierName():null); if ((this.identifierName!= null)&&(!this.identifierName.isEmpty())) { if ((that.identifierName!= null)&&(!that.identifierName.isEmpty())) { if (!leftIdentifierName.equals(rightIdentifierName)) { return false; } } else { return false; } } else { if ((that.identifierName!= null)&&(!that.identifierName.isEmpty())) { return false; } } } { String leftRootName; leftRootName = this.getRootName(); String rightRootName; rightRootName = that.getRootName(); if (this.rootName!= null) { if (that.rootName!= null) { if (!leftRootName.equals(rightRootName)) { return false; } } else { return false; } } else { if (that.rootName!= null) { return false; } } } { String leftExtensionName; leftExtensionName = this.getExtensionName(); String rightExtensionName; rightExtensionName = that.getExtensionName(); if (this.extensionName!= null) { if (that.extensionName!= null) { if (!leftExtensionName.equals(rightExtensionName)) { return false; } } else { return false; } } else { if (that.extensionName!= null) { return false; } } } return true; } @Override public int hashCode() { int currentHashCode = 1; { currentHashCode = (currentHashCode* 31); ExtensionType theExtension; theExtension = this.getExtension(); if (this.extension!= null) { currentHashCode += theExtension.hashCode(); } } { currentHashCode = (currentHashCode* 31); CodedValue theType; theType = this.getType(); if (this.type!= null) { currentHashCode += theType.hashCode(); } } { currentHashCode = (currentHashCode* 31); List theIdentifierName; theIdentifierName = (((this.identifierName!= null)&&(!this.identifierName.isEmpty()))?this.getIdentifierName():null); if ((this.identifierName!= null)&&(!this.identifierName.isEmpty())) { currentHashCode += theIdentifierName.hashCode(); } } { currentHashCode = (currentHashCode* 31); String theRootName; theRootName = this.getRootName(); if (this.rootName!= null) { currentHashCode += theRootName.hashCode(); } } { currentHashCode = (currentHashCode* 31); String theExtensionName; theExtensionName = this.getExtensionName(); if (this.extensionName!= null) { currentHashCode += theExtensionName.hashCode(); } } return currentHashCode; } @Override public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.getInstance(); final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } @Override public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } @Override public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { ExtensionType theExtension; theExtension = this.getExtension(); strategy.appendField(locator, this, "extension", buffer, theExtension, (this.extension!= null)); } { CodedValue theType; theType = this.getType(); strategy.appendField(locator, this, "type", buffer, theType, (this.type!= null)); } { List theIdentifierName; theIdentifierName = (((this.identifierName!= null)&&(!this.identifierName.isEmpty()))?this.getIdentifierName():null); strategy.appendField(locator, this, "identifierName", buffer, theIdentifierName, ((this.identifierName!= null)&&(!this.identifierName.isEmpty()))); } { String theRootName; theRootName = this.getRootName(); strategy.appendField(locator, this, "rootName", buffer, theRootName, (this.rootName!= null)); } { String theExtensionName; theExtensionName = this.getExtensionName(); strategy.appendField(locator, this, "extensionName", buffer, theExtensionName, (this.extensionName!= null)); } return buffer; } @Override public Object clone() { return copyTo(createNewInstance()); } @Override public Object copyTo(Object target) { final CopyStrategy strategy = JAXBCopyStrategy.getInstance(); return copyTo(null, target, strategy); } @Override public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof InstanceIdentifier) { final InstanceIdentifier copy = ((InstanceIdentifier) draftCopy); { Boolean extensionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.extension!= null)); if (extensionShouldBeCopiedAndSet == Boolean.TRUE) { ExtensionType sourceExtension; sourceExtension = this.getExtension(); ExtensionType copyExtension = ((ExtensionType) strategy.copy(LocatorUtils.property(locator, "extension", sourceExtension), sourceExtension, (this.extension!= null))); copy.setExtension(copyExtension); } else { if (extensionShouldBeCopiedAndSet == Boolean.FALSE) { copy.extension = null; } } } { Boolean typeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.type!= null)); if (typeShouldBeCopiedAndSet == Boolean.TRUE) { CodedValue sourceType; sourceType = this.getType(); CodedValue copyType = ((CodedValue) strategy.copy(LocatorUtils.property(locator, "type", sourceType), sourceType, (this.type!= null))); copy.setType(copyType); } else { if (typeShouldBeCopiedAndSet == Boolean.FALSE) { copy.type = null; } } } { Boolean identifierNameShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.identifierName!= null)&&(!this.identifierName.isEmpty()))); if (identifierNameShouldBeCopiedAndSet == Boolean.TRUE) { List sourceIdentifierName; sourceIdentifierName = (((this.identifierName!= null)&&(!this.identifierName.isEmpty()))?this.getIdentifierName():null); @SuppressWarnings("unchecked") List copyIdentifierName = ((List ) strategy.copy(LocatorUtils.property(locator, "identifierName", sourceIdentifierName), sourceIdentifierName, ((this.identifierName!= null)&&(!this.identifierName.isEmpty())))); copy.setIdentifierName(copyIdentifierName); } else { if (identifierNameShouldBeCopiedAndSet == Boolean.FALSE) { copy.identifierName = null; } } } { Boolean rootNameShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.rootName!= null)); if (rootNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceRootName; sourceRootName = this.getRootName(); String copyRootName = ((String) strategy.copy(LocatorUtils.property(locator, "rootName", sourceRootName), sourceRootName, (this.rootName!= null))); copy.setRootName(copyRootName); } else { if (rootNameShouldBeCopiedAndSet == Boolean.FALSE) { copy.rootName = null; } } } { Boolean extensionNameShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.extensionName!= null)); if (extensionNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceExtensionName; sourceExtensionName = this.getExtensionName(); String copyExtensionName = ((String) strategy.copy(LocatorUtils.property(locator, "extensionName", sourceExtensionName), sourceExtensionName, (this.extensionName!= null))); copy.setExtensionName(copyExtensionName); } else { if (extensionNameShouldBeCopiedAndSet == Boolean.FALSE) { copy.extensionName = null; } } } } return draftCopy; } @Override public Object createNewInstance() { return new InstanceIdentifier(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy