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

APCPSR2.m

Go to the documentation of this file.
APCPSR2 ; IHS/TUCSON/LAB - CONT. APCPSR1 AUGUST 14, 1992 ; [ 05/18/99 8:54 AM ]
 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**2**;APR 03, 1998
 ;IHS/TUCSON/LAB - patch 3 made file 200 compatible
TYPE ;EP
 K ^UTILITY("DIQ1",$J)
 K DIQ,DIC,DA,DR
 S DIC="^AUPNVSIT(",DR=".03",DA=APCPSR("V"),DIQ(0)="E" D EN^DIQ1 K DIC,DA,DR,DIQ
 S APCPSR("TYPE")=^UTILITY("DIQ1",$J,9000010,APCPSR("V"),.03,"E")
 S X="^XTMP("_APCPSR("PROC")_",APCPVAR,APCPSR(""TYPE""))" D COUNT
 Q
SC ;EP
 K ^UTILITY("DIQ1",$J)
 K DIQ,DIC,DA,DR
 S DIC="^AUPNVSIT(",DR=".07",DA=APCPSR("V"),DIQ(0)="E" D EN^DIQ1 K DIC,DA,DR,DIQ
 S APCPSR("SC")=^UTILITY("DIQ1",$J,9000010,APCPSR("V"),.07,"E")
 S X="^XTMP("_APCPSR("PROC")_",APCPVAR,APCPSR(""SC""))" D COUNT
 K ^UTILITY("DIQ1",$J)
 Q
CLINIC ;EP
 S APCPSR("CLN")=$P(^AUPNVSIT(APCPSR("V"),0),U,8) I APCPSR("CLN")="" S APCPSR("CLN")="NO CLINIC",APCPSR("CLN CODE")="" G SETCLIN
 S APCPSR("CLN CODE")=$P(^DIC(40.7,APCPSR("CLN"),0),U,2),APCPSR("CLN")=$P(^DIC(40.7,APCPSR("CLN"),0),U)
 I APCPSR("CLN CODE")=56,$D(^AUPNVMED("AD",APCPSR("V"))),APCPVAR="CLINIC" D DENTAL^APCPSR1 S APCPSR("CLN")=APCPSR("PHARM NAME"),APCPSR("CLN CODE")=39
 ;Q:APCPSR("CLN CODE")=56
SETCLIN ;EP
 S X="^XTMP("_APCPSR("PROC")_",APCPVAR,APCPSR(""CLN""))" D COUNT
 ;
 Q
LOC ;EP
 S APCPSR("LOC")=$P(^AUPNVSIT(APCPSR("V"),0),U,6)
 S X="^XTMP("_APCPSR("PROC")_",APCPVAR,APCPSR(""LOC""))" D COUNT
 ;
 Q
PROV ;EP -provider type
 S APCPSR("X")=0 F  S APCPSR("X")=$O(^AUPNVPRV("AD",APCPSR("V"),APCPSR("X"))) Q:APCPSR("X")'=+APCPSR("X")  I $P(^AUPNVPRV(APCPSR("X"),0),U,4)="P" D PROV1
 Q
VD ;EP -tally by visit date
 S APCPSR("V DATE")=$P($P(^AUPNVSIT(APCPSR("V"),0),U),".")
 S X="^XTMP("_APCPSR("PROC")_",APCPVAR,APCPSR(""V DATE""))" D COUNT
 Q
PROV1 ;
 S APCPSR("PROV")=$P(^AUPNVPRV(APCPSR("X"),0),U)
 S APCPSR("DISC")=$$VAL^XBDIQ1(APCPS("PROV FILE"),APCPSR("PROV"),9999999.03)
 Q:APCPSR("DISC")=88
 Q:APCPSR("DISC")=""
 S APCPSR("DISC")=$$VAL^XBDIQ1(APCPS("PROV FILE"),APCPSR("PROV"),$S(APCPS("PROV FILE")=200:53.5,1:2))
 Q:APCPSR("DISC")=""
 S X="^XTMP("_APCPSR("PROC")_",APCPVAR,APCPSR(""DISC""))" D COUNT
 Q
 Q
COUNT ;
 I '$D(@X) S @X=0
 S %=@X,%=%+1,@X=%
 Q
C42 ;;
C51 ;
C52 ;;
C53 ;;
C54 ;;
C56 ;;
C60 ;;
C68 ;;