persistent class %Identity.Data.MPI
extends %Persistent, %Populate, %XML.Adaptor
property address1
as %String(MAXLEN=50);
property address2
as %String(MAXLEN=50);
property altPatientID
as %Integer;
Output of the linkage process
property dataSource
as %String;
property dataSourceRecId
as %String(MAXLEN=20);
Index dataSourceIdx On dataSource [ Type = bitmap ];
property dateOfBirth
as %Date;
property emailAddr
as %String(MAXLEN=50);
property genderGuess
as %String(MAXLEN=1);
property givenName
as %Text(LANGUAGECLASS="%Text.Name",MAXLEN=20);
property governmentIdSuffix
as %Integer(MINVAL=0);
property mothersMaidenName
as %Text(LANGUAGECLASS="%Text.Name",MAXLEN=30);
property patientID
as %Integer;
Output of the linkage process
property phoneNumbers
as %String(MAXLEN=32);
property postcode
as %String(MAXLEN=4,MINLEN=4);
property state
as %String(MAXLEN=5);
property streetNumber
as %String;
property suburb
as %String(MAXLEN=30);
property surname
as %Text(LANGUAGECLASS="%Text.Name",MAXLEN=30);
property trueRecordId
as %Integer;
classmethod CodeVersion()
as %String
Returns the code version that generated the Import/Export methods in MMMM.mm.v format
classmethod ConvertTextFileToObjectInstance(pLine As %String, ByRef pColPos As %Binary, pSeparator As %String = "|", pDateFormat As %Integer = 3)
as %Status
Create a new object instance from a line in delimited text format.
classmethod Dedupe(linkageID)
classmethod ExportTextFile(pPathname As %String, ByRef pLines As %Integer, pSeparator As %String = "|", pDateFormat As %Integer = 3, pNotifyClass As %String = "", pMode As %String = "")
as %Status
Export this class in delimited text format.
classmethod ExportToHealthShare(pMaxRows As %Integer = "")
as %Status
classmethod ExportToIdentityManager(pMaxRows As %Integer = "", pStartAfter As %Integer = "")
as %Status
method GetLinkKeys()
as %String
classmethod ImportTextFile(pPathname As %String, ByRef pLines As %Integer, pSeparator As %String = "|", pDateFormat As %Integer = 3, pConsecutiveAsOne As %Boolean = 0, pNotifyClass As %String = "")
as %Status
Import the first pLines lines of file pPathname in delimited text format into Sample. The first line must contain
the property names of the Sample class. If pLines is initially 0 then the entire file will be imported.
classmethod RecordId(dsrecid As %String)
as %Integer
[ SQLProc ]
classmethod RunQualityLinkage(linkageID As %Integer = "")
as %Status
classmethod RunTestLinkage()
as %Status
query AgreementPatterns(linkageID As %Integer, loLinkweight As %Numeric, hiLinkweight As %Numeric)
SQL Query
:
select up.linkweight, up.agreePat, COUNT(*) as nPairs,
a.%id, b.%id,
a.dataSourceRecId, b.dataSourceRecId,
a.givenName, b.givenName,
a.surname, b.surname,
a.dateOfBirth, b.dateOfBirth,
a.streetNumber, b.streetNumber,
a.address1, b.address1,
a.address2, b.address2,
a.suburb, b.suburb,
a.postcode, b.postcode
FROM %Identity_Data.Unclassified up, %Identity_Data.MPI a, %Identity_Data.MPI b
where
up.linkageid = :linkageID and
up.aeid = a.%ID and up.beid = b.%ID
group by up.agreePat
order by up.linkweight desc
query Classified(linkageID As %Integer, linkweight As %Numeric, category As %Integer)
SQL Query
:
SELECT * FROM
(SELECT cp.%id as prllinkid, cp.linkweight, cp.agreePat, a.*
FROM %Identity_Data.Classified cp, %Identity_Data.MPI a
WHERE cp.linkageid = :linkageID AND cp.category = :category AND cp.aeid = a.%ID AND cp.linkweight > :linkweight
UNION ALL
SELECT cp.%id as prllinkid, cp.linkweight, cp.agreePat, b.*
FROM %Identity_Data.Classified cp, %Identity_Data.MPI b
WHERE cp.linkageid = :linkageID AND cp.category = :category AND cp.beid = b.%ID AND cp.linkweight > :linkweight)
ORDER BY linkweight DESC, prllinkid
query DuplicatePersons()
SQL Query
:
SELECT p1.* FROM %Identity_Data.MPI p1 WHERE p1.patientID=p1.%ID AND p1.patientID IN (SELECT p2.patientID FROM %Identity_Data.MPI p2 WHERE p2.patientID <> p2.%ID)
UNION ALL
SELECT p2.* FROM %Identity_Data.MPI p2 WHERE p2.patientID <> p2.%ID
ORDER BY patientID
query Unclassified(linkageID As %Integer, linkweight As %Numeric)
SQL Query
:
SELECT * FROM
(SELECT up.%id as prllinkid, up.linkweight, up.agreePat, a.*
FROM %Identity_Data.Unclassified up, %Identity_Data.MPI a
WHERE up.linkageid = :linkageID AND up.aeid = a.%ID AND up.linkweight > :linkweight
UNION ALL
SELECT up.%id as prllinkid, up.linkweight, up.agreePat, b.*
FROM %Identity_Data.Unclassified up, %Identity_Data.MPI b
WHERE up.linkageid = :linkageID AND up.beid = b.%ID AND up.linkweight > :linkweight)
ORDER BY linkweight DESC, prllinkid
index (altPatientIDIdx on patientID);
index (gnIndex on givenName) [Type = bitmap];
index (linkIndex on linkKeys(ELEMENTS):Exact);
index (patientIDIdx on patientID);
index (snIndex on surname) [Type = bitmap];
index (trueRecIdx on trueRecordId);