Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DPTDSSN

DPTDSSN.m

Go to the documentation of this file.
DPTDSSN ; IHS/TUCSON/JCM - COMPARES SSN'S ;
 ;;1.0;PATIENT MERGE;;FEB 02, 1994
 ;
START ;
 I $G(XDRCD(XDRFL,XDRCD,.09,"I"))']""!($G(XDRCD2(XDRFL,XDRCD2,.09,"I"))']"") G END
 D INIT
 D COMPARE
END D EOJ
 Q
 ;
INIT ;
 D EOJ
 S DPTDSSN("MATCH")=$P(XDRDTEST(XDRDTO),U,6)
 S DPTDSSN("NO MATCH")=$P(XDRDTEST(XDRDTO),U,7)
 S DPTDSN=$G(XDRCD(XDRFL,XDRCD,.09,"I"))
 S DPTDSN2=$G(XDRCD2(XDRFL,XDRCD2,.09,"I"))
 S DPTDSNF=$E(DPTDSN,1,3),DPTDSN2F=$E(DPTDSN2,1,3)
 S DPTDSNS=$E(DPTDSN,4,5),DPTDSN2S=$E(DPTDSN2,4,5)
 S DPTDSNT=$E(DPTDSN,6,9),DPTDSN2T=$E(DPTDSN2,6,9)
 Q
 ;
COMPARE ;
 ;CHECK TO SEE IF LAST FOUR MATCH OR TWO OF THREE PARTS MATCH
 I DPTDSNT=DPTDSN2T S XDRD("TEST SCORE")=DPTDSSN("MATCH") G COMPAREX
 S DPTDSSN("CNT")=0
 I DPTDSNF=DPTDSN2F S DPTDSSN("CNT")=DPTDSSN("CNT")+1
 I DPTDSNS=DPTDSN2S S DPTDSSN("CNT")=DPTDSSN("CNT")+1
 I DPTDSSN("CNT")>1 S XDRD("TEST SCORE")=DPTDSSN("MATCH")*.8 K DPTDSSN("CNT") G COMPAREX
 ;
 ;CHECK POSITIONAL RELATIONSHIP OF LAST FOUR DIGITS OF SSN'S
 S DPTDSSN("PCNT")=0
 F DPTDSSN("I")=1:1:4 Q:(DPTDSSN("PCNT")>2)  I $E(DPTDSNT,DPTDSSN("I"))'=$E(DPTDSN2T,DPTDSSN("I")) S DPTDSSN("PCNT")=DPTDSSN("PCNT")+1
 I DPTDSSN("PCNT")'>2,DPTDSSN("CNT")>0 S XDRD("TEST SCORE")=DPTDSSN("MATCH")*.5 G COMPAREX
 ;
 ;ASSIGN NEGATIVE VALUE FOR NO SSN MATCH
 S XDRD("TEST SCORE")=DPTDSSN("NO MATCH")
COMPAREX ;
 Q
 ;
EOJ ;
 K DPTDSN,DPTDSN2,DPTDSNF,DPTDSN2F,DPTDSNS,DPTDSN2S,DPTDSNT,DPTDSN2T
 K DPTDSSN
 Q