DocBook|Search
Class Reference
%Identity.Data.Linkage
   
Server:basexml
Instance:SOAXML
User:UnknownUser
 
-
  [BASEXML] >  [%Identity] >  [Data] >  [Linkage]
Private  Storage  

persistent class %Identity.Data.Linkage extends %Persistent, %Identity.Util.CopyFrom

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
37 18 1


Summary

Properties
LinkParameters agreementModel approvedByProperty assigningAuthorityDisplayName
assigningAuthorityPropertyA blockingCond classNameA classNameB
comments createdByProperty deIdentifiedProperties entityIDA
entityIDADisplayName entityIDAProperty entityIDB entityIDBProperty
facilityCodeDisplayName facilityCodePropertyA isSoftDeletedA joinIndexID
linkIndexA linkIndexB linkLowerThresh linkUpperThresh
linkageEID linkageIDB modelName pMatch
priorStateA relationA relationB schemaVersion
sourceIDDisplayName sourceIDPropertyA sourceRefA specialAddrPred
validAsOfProperty

Methods
%%OIDGet %AddToSaveSet %AddToSyncSet %BMEBuilt
%BuildIndices %CheckUnique %ClassIsLatestVersion %ClassName
%ComposeOid %ConstructClone %Delete %DeleteExtent
%DeleteId %DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%Exists %ExistsId %Extends %GUID
%GUIDSet %GetLock %GetParameter %GetSwizzleObject
%Id %InsertBatch %IsA %IsModified
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectModified
%Oid %OnBeforeAddToSync %OnDetermineClass %Open
%OpenId %OriginalNamespace %PackageName %PhysicalAddress
%PurgeIndices %Reload %RemoveFromSaveSet %ResolveConcurrencyConflict
%RollBack %Save %SaveDirect %SaveIndices
%SerializeObject %SetModified %SortBegin %SortEnd
%SyncObjectIn %SyncTransport %UnlockExtent %UnlockId
%ValidateObject ConfigureLinkage ConvertToStoredProc CopyFrom
DropLinkage FindJoinIndexID Link1 Link1to1
LinkN MarkEntityReviewed MergeLinks PopulateLinkParameters
entityIDAGet entityIDASet entityIDBGet entityIDBSet
relationAGet relationASet relationBGet relationBSet


Properties

• property LinkParameters as list of %Identity.Data.LinkParameter [ Transient ];
• property agreementModel as %Integer [ InitialExpression = 0 ];
Agreement model, which may be either IMTPartialAgreement=0 or IMTSimpleAgreement=2
• property approvedByProperty as %String [ InitialExpression = "ApprovedBy" ];
Name of property containing the username or id of the person who approved the creation of the record
• property assigningAuthorityDisplayName as %String;
Display name of assigningAuthorityPropertyA
• property assigningAuthorityPropertyA as %String [ InitialExpression = "AssigningAuthority" ];
Identifier (typically a GUID) of an assigning authority that assigns and controls the values of the sourceIDPropertyA. When specified, the sourceIDPropertyA plus the assigningAuthorityPropertyA uniquely identify an entity in relation A. It is expected that these two fields are error-free identifiers.
• property blockingCond as %String(MAXLEN=256);
Blocking condition (SQL predicate) that is applied during all linkage operations. Specify this as an ordinary SQL condition on relation B, for example,
		"b.deceased = 'N' OR b.deceased IS NULL"

An additional, more general blocking condition may optionally be passed to the LinkN operation (See the LinkN method documentation for further details.)

• property classNameA as %String [ Required ];
Class name of relation A
• property classNameB as %String [ Required ];
Class name of relation B
• property comments as %String(MAXLEN=256);
Arbitrary comment attached to this linkage model. Some applications use this field to give the linkage model a name, thereby enabling linkage models to be identified by either name or linkageID
• property createdByProperty as %String [ InitialExpression = "CreatedBy" ];
Name of property containing the username or id of the person who created the record
• property deIdentifiedProperties as %String(MAXLEN=512);
ObjectScript list of property names in relation A that have been deidentified.
• property entityIDA as %String [ Transient ];
SQL name of the property that links rows of relation A to other rows of relation A that represent the same individual, as assigned by an external system or a previous record linkage operation.
• property entityIDADisplayName as %String;
Display name of entityIDA
• property entityIDAProperty as %String [ InitialExpression = "EntityID",Required ];
• property entityIDB as %String [ Transient ];
SQL name of the property that holds the value of the entity ID of relation B, as assigned by an external system or from a previous record linkage between relationA and relationB
• property entityIDBProperty as %String;
• property facilityCodeDisplayName as %String;
Display name of the facility
• property facilityCodePropertyA as %String [ InitialExpression = "Facility" ];
Name of the property that holds the facilityCode in relation A. If the AddFacility API is used to populate facilities, then the value of this field must have a foreign key relationship with respect to the FacilityCode column of the Facility table.
• property isSoftDeletedA as %String [ InitialExpression = "SoftDeleted" ];
Name of the property in relationA that indicates when an entity member has been "soft deleted", meaning that it has been deleted but not removed from the database.
• property joinIndexID as %Integer [ Required ];
ID of the row in the %Identity.Data.Linkage class that holds the first linkage between relation A and relation B that is compatible with this linkage. The %Identity.Data.JoinIndex class shares a join index definition across multiple linkages, saving both processor time and storage requirements. The join index may be recreated at any time by calling BuildJoinIndex
• property linkIndexA as %String [ Required ];
Name of link index global for relation A
• property linkIndexB as %String [ Required ];
Name of link index global for relation B
• property linkLowerThresh as %Numeric [ InitialExpression = 0.0,Required ];
linkweight threshold below which candidate pairs may be automatically classified as a non-link
• property linkUpperThresh as %Numeric [ InitialExpression = 0.0,Required ];
linkweight threshold above which candidate pairs may be automatically classified as a link
• property linkageEID as %String;
The name of the property that is used by the MergeLinks method to link records in relation A to records in relation B after a linkage operation.
• property linkageIDB as %Integer;
LinkageID of the linkage model between relation B and relation B; that is, the linkage model that links relation B to itself.
• property modelName as %String(MAXLEN=256);
Model name. If specified, the name must be unique within the Linkage table
• property pMatch as %Numeric(MAXVAL=1,MINVAL=0,SCALE=10) [ InitialExpression = 0.2 ];
obsolete (deprecated)
• property priorStateA as %String [ InitialExpression = "PreviousState" ];
Name of the property in relationA that holds the %ID in relationA of the record containing the prior state of this record.
• property relationA as %String [ Transient ];
SQL name of table A
• property relationB as %String [ Transient ];
SQL name of table B
• property schemaVersion as %String [ InitialExpression = "1.4",Required ];
Physical schema version for this class
• property sourceIDDisplayName as %String;
Display name of sourceIDPropertyA, if different from sourceIDPropertyA
• property sourceIDPropertyA as %String [ InitialExpression = "SourceID" ];
Name of property containing the originating data source identifier, such as the Medical Record Number in a patient database. The sourceIDPropertyA is assigned by the corresponding AssigningAuthority. When specified, the sourceIDPropertyA plus the assigningAuthorityPropertyA uniquely identify an entity in relation A. It is expected that these two fields are error-free identifiers. Note: this field is used for real-time searching and linking, but it has no special significance for the linkage model. The sourceID and assigning authority may be added as link parameters, with the AssigningAuthority disabled, with an exact match on sourceID+AA given a maximum agreement weight and a near zero disagreement weight.
• property sourceRefA as %String [ InitialExpression = "%ID" ];
Name of the property in relation A that holds the value that shall be assigned to the EntityID of records in relation A when a record of relation A does not link to any record in relation B.
• property specialAddrPred as %String(MAXLEN=2000);
SQL predicate that evaluates to TRUE when the address is more common than would be expected for a typical residential address.
• property validAsOfProperty as %String [ InitialExpression = "ValidAsOf" ];
Name of property containing the date that this record was most recently updated or validated

Methods

• classmethod ConfigureLinkage(clsA As %String, plA As %String, tyl As %String = "", bC As %String = "", mvA As %String = "", eiA As %String = "", srA As %String = "", amd As %Integer = "", ptu As %Integer = "", lxA As %String = "", facA As %String = "", modelName As %String = "", clsB As %String = "", plB As %String = "", mvB As %String = "", eiB As %String = "", lxB As %String = "") as %Integer
Invoke ConfigureLinkage to create a new linkage model and a new link parameter for each parameter specified in plA, using the default characteristics defined in the LinkDefaults class. A linkage defines a "fuzzy join" between two classes, referred to here as class A and B, which may be the same class. clsA and clsB contain the name of class A and B, respectively. plA is a list of properties in A that are involved in the join, and tyl is a list that contains the corresponding "IMT type name" of each property in plA. In many cases it is sufficient to specify only clsA, plA, and tyl.

If some of the records need to be excluded from consideration, then specify a SQL blocking condition in the bc parameter. For example, in a class that contains both persons and companies, you might want to create a linkage on only the people, or on only the companies. The blocking predicate is specified in ordinary SQL using simple conditions of the form:

andTerms :== andTerm [ AND andTerms ], where

andTerm :== a . sqlCol op b . sqlCol | b . sqlCol op literalExpr.

If property values such as 'unknown' or 'tbd' are used as placeholders for missing information, such values may be treated like SQL NULL by specifying them in the missing value lists (mvA for class A, mvB for class B). Each missing value list is a SQL fragment that will be substituted into a SQL IN expression, for example: "'unknown','tbd'"

When records are identified that represent the same individual or entity, the records are associated by giving them a common entity identifier. If the records are already associated in this way prior to performing the linkage, then the linkage operation will potentially link sets of records in class A to sets of records in class B. Specify the name of the existing entity identifier column in eiA for class A, or eiB for class B. By default the existing entity identifier is the %ID. When eiA or eiB is a unique property (such as %ID) the linkage is carried out at the record level.

The agreementModel may be specified as $$$IMTSimpleAgreement (2) or $$$IMTPartialAgreement (0). When values are compared under the simple agreement model, the full agreement or disagreement weight is applied to the outcome, or a weight of zero is used if either the A value or the B value is missing. Under the partial agreement model, "partial credit" may be attributed to values that have intermediate levels of agreement.

Parameter tuning (ptu) determines how the initial parameter weighting is determined, and may be specified as an integer between 0 and 4. Specify $$$IMTNoTuning (0) to get the default weights as specified in the LinkDefaults class. Specify $$$IMTInheritTuning (1) to use previously determined weights when another linkage exists between the same pair of classes. In this case, the weightings from most recent linkage between the same pair of classes will be used. Specify $$$IMTSemiAutoTuning (2) to select weights empirically based on the contents of the join index. Specify $$$IMTAutoTuning (3) to estimate the weights statistically using Bayes' Rule. Specify $$$IMTTuneTableTuning (4) to choose weights based on selectivity information gathered by TuneTable.

Specify the name of the link index global for class A in lxA, for example "^Sample.PersonI(""LinkIndex"")". If the class uses default storage and the link index is named "LinkIndex" (case insensitive), then lxa will default properly and need not be specified.

Parameters ending in the letter B (clsB, plB, mvB, eiB, and lxB) refer to the corresponding item in class B. If class B is not specified, then it defaults to class A, and when clsB equals clsA, all other 'B' variables also default to the value specified for the corresponding 'A' parameter.

• method ConvertToStoredProc()
Convert extrinsic function calls to stored procedure calls
• method DropLinkage()
Drop the specified linkage model and any structures that reference it. If there are multiple linkage models that share the same join index, then the join index will be deleted when the last linkage model that references it is dropped. Linkage model linkageID may not be dropped if it is referenced as "class B" by some other linkage, and there is no other linkage between the same pair of classes as linkage model linkageID.
• classmethod FindJoinIndexID(relationA As %String, relationB As %String) as %Integer
• classmethod Link1(objRefA As %Binary, linkageID As %Integer, blockingPred As %String = "", agreePatFlag As %Boolean = "", distinctByEID As %Boolean = 1, idCommaList As %String = "", thresh As %Numeric = "") as %List
ObjectScript interface to the real-time search operation, which returns a $list. The general interface returns a custom result set. See the Link1ResultSet class for details. Link1 returns a list of lists of potential matches having a linkweight greater than the low linkweight threshold (as specified in the linkage model), with each inner list containing the (entityID, ID, linkweight) of a potential match. If agreePatFlag=1, then the agreement pattern will be returned as a string in the 4th list element, enabling heuristic filtering to be performed if desired.

If blockingPred is not null, then it must be a SQL WHERE clause fragment, and any of the records found (from "class B") must satisfy this predicate.

If distinctByEID = 1, then the results will be made distinct by entityID.

If idCommaList is specified, it must be a comma-separated list of IDs of class B. The rows referenced by the idCommaList will be included in the linkweight computation, and will be returned if the linkweight exceeds the low linkweight threshold. In this manner it is possible to provide candidate ranking even if a record cannot be located through the link index.

If thresh is specified, it will be used instead of the low linkweight threshold for this linkage model.

• classmethod Link1to1(objRefA As %Binary, objRefB As %Binary, linkageID As %Integer, blockingPred As %String = "", agreePatFlag As %Boolean = "") as %List
The Link1to1 function supports the ability to do ranking when "class A" is an object reference, and "class B" is also an object reference. Conceptually this is identical to the Link1 operation, except that in this case there are no SQL tables involved, so it cannot be treated quite like a SQL join. This function is intended for re-ranking of candidates found by different record locator services so that the linkweights are comparable to one another.
• classmethod LinkN(linkageID As %Integer, blockingPred As %String = "")
The bulk linkage operation. The LinkN operation clears the %Identity.Data.Unclassified for this linkage, finds all potential links that are not already in %Identity.Data.Classified, and creates an entry in Unclassified for each potential match it finds where the linkweight is greater than or equal to the low linkweight threshold.

Just as the Link1 operation returns the (entityID, ID, linkweight, agreementPattern) for each potential link, LinkN calculates and stores the same information in Unclassified, where it can be subsequently analyzed.

If supplied, the blocking predicate (blockingPred) restricts the record pairs that are considered for linkage, and can divide a large problem into simpler subsets and enable large problems to be solved with limited resources. Refer to relation A with SQL alias "a", to relation B with SQL alias "b", or to the join index with SQL alias "ji".

For example, a blocking predicate that restricts the LinkN operation to those pairs that exactly match on postcode, year of birth, gender (or NULL), and the first character of the given name might be specified as:

			(a.postcode = b.postcode AND LENGTH(a.postcode)>3 
			 AND YEAR(a.DOB)=YEAR(b.DOB) AND a.DOB>0
			 AND (a.gender = b.gender OR a.gender IS NULL OR b.gender IS NULL)
			 AND SUBSTR(a.givenName,1,1) = SUBSTR(b.givenName,1,1))

Such a blocking predicate would restrict the LinkN operation to only a tiny fraction of the record pairs that would otherwise have been scored and ranked by the LinkN operation, but perhaps to a subset that contains many of the pairs of interest. A subsequent LinkN operation would be needed to process the record pairs that did not satisfy the blocking condition.

Note that the blocking predicate must be specified using the SQL column name when this is different from the class property name.

• method MarkEntityReviewed(objRefA As %Binary)
Assert that the specified object is an entity that is distinct from any other existing entities that are not linked to it.
• method MergeLinks(linkageEID As %String, preserveExistingLinks As %Boolean = 0)
Merge the potential links between relation A and relation B for this linkage model that have been classified as links, assigning the property specified in linkageEID the value of sourceRefA. If preserveExistingLinks=0, then the values will be overwritten, otherwise the classified pairs for linkageID will only augment the existing linkages.
• method PopulateLinkParameters() as %Status
Populate link parameters for this linkage.
Example of usage:
Set tLinkageID = ##class(%Identity.API).GetDefaultLinkageID()
Set pObject = ##class(%Identity.Data.Linkage).%OpenId(tLinkageID)
Do pObject.PopulateLinkParameters()
Write pObject.LinkParameters.Count()
• method entityIDAGet() as %String
This is a Get accessor method for the entityIDA property.
• method entityIDASet(pSQLColumnName As %String) as %Status
This is a Set accessor method for the entityIDA property.
• method entityIDBGet() as %String
This is a Get accessor method for the entityIDB property.
• method entityIDBSet(pSQLColumnName As %String) as %Status
This is a Set accessor method for the entityIDB property.
• method relationAGet() as %String
This is a Get accessor method for the relationA property.
• method relationASet(pSchemaDotTable) as %Status
This is a Set accessor method for the relationA property.
• method relationBGet() as %String
This is a Get accessor method for the relationB property.
• method relationBSet(pSchemaDotTable) as %Status
This is a Set accessor method for the relationB property.

Indices

• index (modelNameIdx on modelName) [Unique];