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

DPTDN.m

Go to the documentation of this file.
  1. DPTDN ; IHS/TUCSON/JCM - COMPARES NAMES ;
  1. ;;1.0;PATIENT MERGE;;FEB 02, 1994
  1. ;
  1. ; Calls: SOU^DICM1
  1. ;
  1. START ;
  1. D INIT
  1. D NAME
  1. I $O(^DPT(XDRCD,.01,0)) D OTHER
  1. END D EOJ
  1. Q
  1. ;
  1. EN ; EP - Entry Point for any routines comparing names
  1. ;
  1. D INIT1
  1. D COMPARE
  1. D EOJ
  1. Q
  1. ;
  1. INIT ;
  1. D EOJ
  1. S DPTDN("MATCH")=$P(XDRDTEST(XDRDTO),U,6)
  1. S DPTDN("NO MATCH")=$P(XDRDTEST(XDRDTO),U,7)
  1. S DPTDN=$G(XDRCD(XDRFL,XDRCD,.01,"I")),DPTDN2=$G(XDRCD2(XDRFL,XDRCD2,.01,"I"))
  1. ;
  1. INIT1 S DPTDNL=$P(DPTDN,","),DPTDNF=$P($P(DPTDN,",",2)," "),DPTDNFI=$E(DPTDNF),DPTDNM=$P($P(DPTDN,",",2)," ",2),DPTDNMI=$E(DPTDNM)
  1. ;
  1. INIT2 S DPTDNL2=$P(DPTDN2,","),DPTDNF2=$P($P(DPTDN2,",",2)," "),DPTDNFI2=$E(DPTDNF2),DPTDNM2=$P($P(DPTDN2,",",2)," ",2),DPTDNMI2=$E(DPTDNM2)
  1. Q
  1. ;
  1. NAME ;
  1. D COMPARE
  1. D:$O(^DPT(XDRCD2,.01,0)) OTHER2
  1. Q
  1. ;
  1. OTHER ;
  1. F DPTDNO=0:0 S DPTDNO=$O(^DPT(XDRCD,.01,DPTDNO)) Q:'DPTDNO S DPTDN=$P(^DPT(XDRCD,.01,DPTDNO,0),U,1) S:'$D(DPTDN2) DPTDN2=XDRCD2(XDRFL,XDRCD2,.01,"I") D INIT1,NAME
  1. Q
  1. ;
  1. OTHER2 ;
  1. F DPTDNO2=0:0 S DPTDNO2=$O(^DPT(XDRCD2,.01,DPTDNO2)) Q:'DPTDNO2 S DPTDN2=$P(^DPT(XDRCD2,.01,DPTDNO2,0),U,1) D INIT2,COMPARE
  1. Q
  1. ;
  1. COMPARE ;
  1. S:'$D(DPTDN("TEST SCORE")) DPTDN("TEST SCORE")=DPTDN("NO MATCH")
  1. I DPTDN=DPTDN2 S DPTDN("TEST SCORE2")=DPTDN("MATCH") G COMPAREX
  1. I DPTDNF=DPTDNF2,DPTDNL=DPTDNL2 S DPTDN("TEST SCORE2")=DPTDN("MATCH")*.8 G COMPAREX
  1. I DPTDNFI=DPTDNFI2,DPTDNL=DPTDNL2 S DPTDN("TEST SCORE2")=DPTDN("MATCH")*.6 G COMPAREX
  1. I DPTDNL=DPTDNL2 S DPTDN("TEST SCORE2")=DPTDN("MATCH")*.4 G COMPAREX
  1. S X=DPTDNL D SOU^DICM1 S DPTDNLS=X S X=DPTDNL2 D SOU^DICM1 S DPTDNL2S=X
  1. S X=DPTDNF D SOU^DICM1 S DPTDNFS=X S X=DPTDNF2 D SOU^DICM1 S DPTDNF2S=X
  1. I DPTDNLS=DPTDNL2S,DPTDNFS=DPTDNF2S S DPTDN("TEST SCORE2")=DPTDN("MATCH")*.6 G COMPAREX
  1. I DPTDNFS=DPTDNF2S S DPTDN("TEST SCORE2")=DPTDN("MATCH")*.2 G COMPAREX
  1. S DPTDN("TEST SCORE2")=DPTDN("NO MATCH")
  1. COMPAREX ;
  1. S:DPTDN("TEST SCORE2")>(DPTDN("TEST SCORE")) DPTDN("TEST SCORE")=DPTDN("TEST SCORE2")
  1. K X,DPTDNLS,DPTDNL2S,DPTDNFS,DPTDNF2S,DPTDN("TEST SCORE2")
  1. Q
  1. ;
  1. EOJ ;
  1. S:$D(DPTDN("TEST SCORE")) XDRD("TEST SCORE")=DPTDN("TEST SCORE")
  1. K DPTDN,DPTDN2,DPTDNF,DPTDNF2,DPTDNL,DPTDNL2,DPTDNM,DPTDNM2
  1. K DPTDNMI,DPTDNMI2,DPTDNFI,DPTDNFI2,DPTDNO,DPTDNO2
  1. Q