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

DPTDOB.m

Go to the documentation of this file.
DPTDOB ; IHS/TUCSON/JCM - COMPARES DATE OF BIRTHS ;
 ;;1.0;PATIENT MERGE;;FEB 02, 1994
START ;
 D INIT
EN ; EP - Entry point for comparing dates
 D COMPARE
END D EOJ
 Q
 ;
INIT ;
 K DPTDOB,DPTDOB2
 S DPTDOB=$G(XDRCD(XDRFL,XDRCD,.03,"I")),DPTDOB2=$G(XDRCD2(XDRFL,XDRCD2,.03,"I"))
 S DPTDOB("MATCH")=$P(XDRDTEST(XDRDTO),U,6)
 S DPTDOB("NO MATCH")=$P(XDRDTEST(XDRDTO),U,7)
 Q
 ;
COMPARE ;
 I DPTDOB']""!(DPTDOB2']"") G COMPAREX
 I DPTDOB=DPTDOB2 S XDRD("TEST SCORE")=DPTDOB("MATCH") G COMPAREX
 S DPTDOB("CNT")=0
 F DPTDOBI=1:1:7 Q:DPTDOB("CNT")>2  I $E(DPTDOB,DPTDOBI)'=$E(DPTDOB2,DPTDOBI) S DPTDOB("CNT")=DPTDOB("CNT")+1
 K DPTDOBI
 S XDRD("TEST SCORE")=$S(DPTDOB("CNT")>2:DPTDOB("NO MATCH"),1:(DPTDOB("MATCH")*.8))
COMPAREX Q
 ;
EOJ ;
 K DPTDOB,DPTDOB2
 Q