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

APCDKDE1.m

Go to the documentation of this file.
  1. APCDKDE1 ; IHS/CMI/LAB - cont. of APCDKDE data entry visit re-linker ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. ;
  1. ;
  1. NONXCHK ;EP - called from APCDKDE to review A visits
  1. ;go through all V file entries on other visit
  1. S APCDKV=APCDKXVS D PROCVF
  1. S APCDKV=APCDVSIT D PROCVF
  1. K APCDKV,APCDKOSP,APCDKOPP,APCDK12N,APCDK("C"),APCDKVFL,APCDKIGR,APCDKVDG,APCDVDFN,APCDK("SCORE")
  1. Q
  1. PROCVF ;process v files
  1. I APCDVSIT'=APCDKV NEW X,P,S S (S,X)=0,APCDKOSP="" F S X=$O(^AUPNVPRV("AD",APCDKV,X)) Q:X'=+X S:$P(^AUPNVPRV(X,0),U,4)="P" APCDKOPP=+^(0) I $P(^(0),U,4)="S"!($P(^(0),U,4)="") S S=S+1,$P(APCDKOSP,U,S)=+^(0)
  1. S APCDKVFL=9000010 F S APCDKVFL=$O(^DIC(APCDKVFL)) Q:APCDKVFL>9000010.99!(APCDKVFL'=+APCDKVFL) D VENTRIES
  1. Q
  1. ;
  1. VENTRIES ;
  1. S APCDKVDG=^DIC(APCDKVFL,0,"GL"),APCDKIGR=APCDKVDG_"""AD"",APCDKV,APCDVDFN)"
  1. S APCDVDFN="" F APCDVI=1:1 S APCDVDFN=$O(@APCDKIGR) Q:APCDVDFN="" D SCORE
  1. Q
  1. ;
  1. SCORE ;
  1. Q:$D(APCDK("C",APCDKVFL,APCDVDFN)) ;quit if already reviewe
  1. S APCDK("C",APCDKVFL,APCDVDFN)=""
  1. S APCDK12N=APCDKVDG_APCDVDFN_",12)"
  1. Q:'$D(@(APCDK12N))
  1. S APCDK12N=@(APCDK12N)
  1. Q:APCDK12N=""
  1. S APCDK("SCORE CLIN")=$P(^AUPNVSIT(APCDKXVS,0),U,8),APCDK("SCORE")="APCDKOVS",@APCDK("SCORE")=0,APCDK("SCORE PP")=APCDKOPP,APCDK("SCORE SP")=APCDKOSP D SCORE1
  1. S APCDK("SCORE CLIN")=$P(APCDKDVR,U,8),APCDK("SCORE")="APCDKDVS",@APCDK("SCORE")=0,APCDK("SCORE PP")=APCDKDPP,APCDK("SCORE SP")=APCDKDSP D SCORE1
  1. I APCDKV=APCDVSIT,APCDKOVS>APCDKDVS S APCDK("REPOINT V")=APCDKXVS D RELINK Q
  1. I APCDKV=APCDKXVS,APCDKDVS>APCDKOVS S APCDK("REPOINT V")=APCDVSIT D RELINK Q
  1. Q
  1. SCORE1 ;
  1. CLINIC ;check clinic
  1. ;if both v record clinic and visit record clinic are not null, and they match, re-link v record and quit
  1. I $P(APCDK12N,U,3)]"",APCDK("SCORE CLIN")]"",$P(APCDK12N,U,3)=APCDK("SCORE CLIN") S @APCDK("SCORE")=@APCDK("SCORE")+1
  1. ENCPROV ;
  1. ;if both v record encounter provider and any provider in V Provider for this visit match, re-link and quit (both must have a value)
  1. G:$P(APCDK12N,U,4)="" ORDPROV
  1. I $G(APCDK("SCORE PP"))=$P(APCDK12N,U,4) S @APCDK("SCORE")=@APCDK("SCORE")+1
  1. S X=0 F I=1:1 S X=$P(APCDK("SCORE SP"),U,I) Q:X="" I $P(APCDK12N,U,4)=X S @APCDK("SCORE")=@APCDK("SCORE")+1
  1. ORDPROV ;
  1. G:$P(APCDK12N,U,2)="" SCOREXIT
  1. I $G(APCDK("SCORE PP"))=$P(APCDK12N,U,2) S @APCDK("SCORE")=@APCDK("SCORE")+1
  1. S X=0 F I=1:1 S X=$P(APCDK("SCORE SP"),U,I) Q:X="" I $P(APCDK12N,U,2)=X S @APCDK("SCORE")=@APCDK("SCORE")+1
  1. SCOREXIT ;
  1. Q
  1. K DIE,DR,DA,DIU,DIV S DITC="",DA=APCDVDFN,DIE=APCDKVDG,DR=".03////"_APCDVSIT D ^DIE K DIE,DA,DR,DIU,DIV,DITC
  1. Q
  1. SCOREV ;check visit to see if should be deleted
  1. Q