AZZDACK ; CHECK DATA FOR ALL REG PATIENTS AT SELECTED SITE;[ 01/02/90 1:50 PM ]
; Mike Remillard, ISC/BAO
; IHS/MFD changed description- active registration patients
START ;
K ^AZZDA D ^AUKVAR,^%AUCLS
W ?6,"* * CHECK ALL ACTIVE PATIENTS FOR MISSING OR INVALID REG DATA * *"
;-----> ASK LOCATION.
W !!!!,"Select a Location for the patient records you wish to scan.",!
S:'$D(IOSL) IOSL=24
S DIC="^AUTTLOC(",DIC(0)="QEMA",DIC("A")="Location: "
D ^DIC Q:Y=-1
S DUZ(2)=$P(Y,U),(AZZDA("ALL"),AZZDA("HERE"),AZZDA("BAD"),DFN)=0
S AZZDA("SITE")=$P(^DIC(4,DUZ(2),0),U)
D PROMPT Q:QQ=U
SCAN ;-----> BEGIN SCAN.
D VARS,HEADER1 Q:QQ="^" W !!
F S DFN=$O(^DPT(DFN)) Q:'DFN S AZZDA("ALL")=AZZDA("ALL")+1 D
.W:'(AZZDA("ALL")#1500) !!?12," *** STILL SCANNING ",AZZDA("SITE")," *** ",!!
.;-----> CHECK IF DECEASED.
.I $D(^DPT(DFN,.35)) W "-" Q
.;-----> CHECK IF REG'D AT THIS SITE; ALSO, QUIT IF FILE IS INACTIVE.
.I $D(^AUPNPAT(DFN,41,DUZ(2))) Q:$P(^(DUZ(2),0),U,3) S AZZDA("HERE")=AZZDA("HERE")+1 D ^AGDATCK W:AG("DTOT")=0 "." D:AG("DTOT")>0 STORE Q
.W "-"
D PROMPT1 D:QQ'=U TOTALS
D PROMPT D:QQ'=U PRINT
EXIT ;
X ^%ZIS("C")
K AG,AZZDA,X,I,QQ,^AZZDA
Q
STORE ;
;-----> STORE DATA IN GLOBAL, TOTALS IN LOCAL VARIABLES.
S AZZDA("BAD")=AZZDA("BAD")+1 W "X"
S ^AZZDA(DFN)=$P(^DPT(DFN,0),"^",1)
S $P(^AZZDA(DFN),U,2)=$P(^AUPNPAT(DFN,41,DUZ(2),0),"^",2)
F I=1:1:12 S:$D(AG("ER",I)) $P(^AZZDA(DFN),U,(I+2))=1,AZZDA("AG",I)=AZZDA("AG",I)+1
Q
TOTALS ;
;-----> PRINT TOTAL STATISTICS ON SCAN FOR THIS LOCATION.
W !! S %ZIS="",%ZIS("A")="Select DEVICE to print statistics: " D ^%ZIS Q:POP U IO
D HEADER3
F I=1:1:12 D:$Y>(IOSL-7) PROMPT Q:QQ=U D:$Y>(IOSL-7) HEADER3 W:AZZDA("AG",I) !!?5,"Patients with ",AG(I),":",?55,$J(AZZDA("AG",I),10)
W !!," ----------------------------------------------",?55,"-----------"
D:$Y>(IOSL-8) PROMPT Q:QQ=U D:$Y>(IOSL-8) HEADER3
W !?5,"Total patients at ",AZZDA("SITE")
W !?5,"with Missing or Invalid data: ",?55,$J(AZZDA("BAD"),10)
W !!?5,"Total patients in this database"
W !?5,"registered at ",AZZDA("SITE"),": ",?55,$J(AZZDA("HERE"),10)
W !!?5,"Total patients in the database: ",?55,$J(AZZDA("ALL"),10)
X ^%ZIS("C")
Q
PRINT ;
;-----> PRINT MISSING/INVALID DATA FOR EACH INDIVIDUAL PATIENT.
W !! S %ZIS="",%ZIS("A")="Select DEVICE to print individual errors: " D ^%ZIS Q:POP U IO
S DFN=0 D HEADER2
F S DFN=$O(^AZZDA(DFN)) Q:'DFN D:$Y>(IOSL-10) PROMPT Q:QQ=U D:$Y>(IOSL-10) HEADER2 D
.W !!,"PATIENT: ",$P(^AZZDA(DFN),U),!
.W "CHART #: ",$P(^AUPNPAT(DFN,41,DUZ(2),0),"^",2)
.W " at ",AZZDA("SITE")
.W !!?5,"Missing/Invalid data:"
.F I=1:1:12 W:$P(^AZZDA(DFN),U,(I+2)) ?28,"** ",AG(I),!
D:QQ'=U PROMPT
W @IOF X ^%ZIS("C")
Q
VARS ;
;-----> SET UP NECESSARY LOCAL VARIABLES.
S AG(1)="invalid NAME entry",AG(2)="invalid CHART NUMBER",AG(3)="missing DATE OF BIRTH",AG(4)="invalid SEX entry",AG(5)="missing TRIBE entry"
S AG(6)="missing INDIAN QUANTUM",AG(7)="missing CURRENT COMMUNITY",AG(8)="missing BENEFICIARY entry",AG(9)="invalid ELIGIBILITY entry"
S AG(10)="patient not eligible for BIC",AG(11)="missing SOCIAL SECURITY NUMBER",AG(12)="OLD (unused) TRIBE still use"
F I=1:1:12 S AZZDA("AG",I)=0
Q
PROMPT ;
I IOSL>24 S QQ="" Q
F W ! Q:$Y>17
PROMPT1 R !!?23,"Press <return> to continue. ",QQ:DTIME
Q
D ^%AUCLS W "During the scanning processes the following symbols will be displayed:"
W !!?3,"""X"" = Patients with missing/invalid data."
W !?3,"""."" = Patients registered with correct data."
W !?3,"""-"" = Patients in the database not registered at ",$E(AZZDA("SITE"),1,28)
D PROMPT1 Q:QQ="^"
W !!!!?6,"* * * SCANNING FOR PATIENTS WITH MISSING OR INVALID DATA * * *",!,?22,"AT ",AZZDA("SITE")
Q
W @IOF,!?8,"* * * PATIENTS WITH MISSING OR INVALID REQUIRED DATA * * *",!,?22,"AT ",AZZDA("SITE"),!! Q
W @IOF,?6,"* * * STATISTICS ON PATIENTS WITH MISSING OR INVALID DATA * * *",!,?22,"AT ",AZZDA("SITE"),!! Q
AZZDACK ; CHECK DATA FOR ALL REG PATIENTS AT SELECTED SITE;[ 01/02/90 1:50 PM ]
+1 ; Mike Remillard, ISC/BAO
+2 ; IHS/MFD changed description- active registration patients
START ;
+1 KILL ^AZZDA
DO ^AUKVAR
DO ^%AUCLS
+2 WRITE ?6,"* * CHECK ALL ACTIVE PATIENTS FOR MISSING OR INVALID REG DATA * *"
+3 ;-----> ASK LOCATION.
+4 WRITE !!!!,"Select a Location for the patient records you wish to scan.",!
+5 IF '$DATA(IOSL)
SET IOSL=24
+6 SET DIC="^AUTTLOC("
SET DIC(0)="QEMA"
SET DIC("A")="Location: "
+7 DO ^DIC
IF Y=-1
QUIT
+8 SET DUZ(2)=$PIECE(Y,U)
SET (AZZDA("ALL"),AZZDA("HERE"),AZZDA("BAD"),DFN)=0
+9 SET AZZDA("SITE")=$PIECE(^DIC(4,DUZ(2),0),U)
+10 DO PROMPT
IF QQ=U
QUIT
SCAN ;-----> BEGIN SCAN.
+1 DO VARS
DO HEADER1
IF QQ="^"
QUIT
WRITE !!
+2 FOR
SET DFN=$ORDER(^DPT(DFN))
IF 'DFN
QUIT
SET AZZDA("ALL")=AZZDA("ALL")+1
Begin DoDot:1
+3 IF '(AZZDA("ALL")#1500)
WRITE !!?12," *** STILL SCANNING ",AZZDA("SITE")," *** ",!!
+4 ;-----> CHECK IF DECEASED.
+5 IF $DATA(^DPT(DFN,.35))
WRITE "-"
QUIT
+6 ;-----> CHECK IF REG'D AT THIS SITE; ALSO, QUIT IF FILE IS INACTIVE.
+7 IF $DATA(^AUPNPAT(DFN,41,DUZ(2)))
IF $PIECE(^(DUZ(2),0),U,3)
QUIT
SET AZZDA("HERE")=AZZDA("HERE")+1
DO ^AGDATCK
IF AG("DTOT")=0
WRITE "."
IF AG("DTOT")>0
DO STORE
QUIT
+8 WRITE "-"
End DoDot:1
+9 DO PROMPT1
IF QQ'=U
DO TOTALS
+10 DO PROMPT
IF QQ'=U
DO PRINT
EXIT ;
+1 XECUTE ^%ZIS("C")
+2 KILL AG,AZZDA,X,I,QQ,^AZZDA
+3 QUIT
STORE ;
+1 ;-----> STORE DATA IN GLOBAL, TOTALS IN LOCAL VARIABLES.
+2 SET AZZDA("BAD")=AZZDA("BAD")+1
WRITE "X"
+3 SET ^AZZDA(DFN)=$PIECE(^DPT(DFN,0),"^",1)
+4 SET $PIECE(^AZZDA(DFN),U,2)=$PIECE(^AUPNPAT(DFN,41,DUZ(2),0),"^",2)
+5 FOR I=1:1:12
IF $DATA(AG("ER",I))
SET $PIECE(^AZZDA(DFN),U,(I+2))=1
SET AZZDA("AG",I)=AZZDA("AG",I)+1
+6 QUIT
TOTALS ;
+1 ;-----> PRINT TOTAL STATISTICS ON SCAN FOR THIS LOCATION.
+2 WRITE !!
SET %ZIS=""
SET %ZIS("A")="Select DEVICE to print statistics: "
DO ^%ZIS
IF POP
QUIT
USE IO
+3 DO HEADER3
+4 FOR I=1:1:12
IF $Y>(IOSL-7)
DO PROMPT
IF QQ=U
QUIT
IF $Y>(IOSL-7)
DO HEADER3
IF AZZDA("AG",I)
WRITE !!?5,"Patients with ",AG(I),":",?55,$JUSTIFY(AZZDA("AG",I),10)
+5 WRITE !!," ----------------------------------------------",?55,"-----------"
+6 IF $Y>(IOSL-8)
DO PROMPT
IF QQ=U
QUIT
IF $Y>(IOSL-8)
DO HEADER3
+7 WRITE !?5,"Total patients at ",AZZDA("SITE")
+8 WRITE !?5,"with Missing or Invalid data: ",?55,$JUSTIFY(AZZDA("BAD"),10)
+9 WRITE !!?5,"Total patients in this database"
+10 WRITE !?5,"registered at ",AZZDA("SITE"),": ",?55,$JUSTIFY(AZZDA("HERE"),10)
+11 WRITE !!?5,"Total patients in the database: ",?55,$JUSTIFY(AZZDA("ALL"),10)
+12 XECUTE ^%ZIS("C")
+13 QUIT
PRINT ;
+1 ;-----> PRINT MISSING/INVALID DATA FOR EACH INDIVIDUAL PATIENT.
+2 WRITE !!
SET %ZIS=""
SET %ZIS("A")="Select DEVICE to print individual errors: "
DO ^%ZIS
IF POP
QUIT
USE IO
+3 SET DFN=0
DO HEADER2
+4 FOR
SET DFN=$ORDER(^AZZDA(DFN))
IF 'DFN
QUIT
IF $Y>(IOSL-10)
DO PROMPT
IF QQ=U
QUIT
IF $Y>(IOSL-10)
DO HEADER2
Begin DoDot:1
+5 WRITE !!,"PATIENT: ",$PIECE(^AZZDA(DFN),U),!
+6 WRITE "CHART #: ",$PIECE(^AUPNPAT(DFN,41,DUZ(2),0),"^",2)
+7 WRITE " at ",AZZDA("SITE")
+8 WRITE !!?5,"Missing/Invalid data:"
+9 FOR I=1:1:12
IF $PIECE(^AZZDA(DFN),U,(I+2))
WRITE ?28,"** ",AG(I),!
End DoDot:1
+10 IF QQ'=U
DO PROMPT
+11 WRITE @IOF
XECUTE ^%ZIS("C")
+12 QUIT
VARS ;
+1 ;-----> SET UP NECESSARY LOCAL VARIABLES.
+2 SET AG(1)="invalid NAME entry"
SET AG(2)="invalid CHART NUMBER"
SET AG(3)="missing DATE OF BIRTH"
SET AG(4)="invalid SEX entry"
SET AG(5)="missing TRIBE entry"
+3 SET AG(6)="missing INDIAN QUANTUM"
SET AG(7)="missing CURRENT COMMUNITY"
SET AG(8)="missing BENEFICIARY entry"
SET AG(9)="invalid ELIGIBILITY entry"
+4 SET AG(10)="patient not eligible for BIC"
SET AG(11)="missing SOCIAL SECURITY NUMBER"
SET AG(12)="OLD (unused) TRIBE still use"
+5 FOR I=1:1:12
SET AZZDA("AG",I)=0
+6 QUIT
PROMPT ;
+1 IF IOSL>24
SET QQ=""
QUIT
+2 FOR
WRITE !
IF $Y>17
QUIT
PROMPT1 READ !!?23,"Press <return> to continue. ",QQ:DTIME
+1 QUIT
+1 DO ^%AUCLS
WRITE "During the scanning processes the following symbols will be displayed:"
+2 WRITE !!?3,"""X"" = Patients with missing/invalid data."
+3 WRITE !?3,"""."" = Patients registered with correct data."
+4 WRITE !?3,"""-"" = Patients in the database not registered at ",$EXTRACT(AZZDA("SITE"),1,28)
+5 DO PROMPT1
IF QQ="^"
QUIT
+6 WRITE !!!!?6,"* * * SCANNING FOR PATIENTS WITH MISSING OR INVALID DATA * * *",!,?22,"AT ",AZZDA("SITE")
+7 QUIT
+1 WRITE @IOF,!?8,"* * * PATIENTS WITH MISSING OR INVALID REQUIRED DATA * * *",!,?22,"AT ",AZZDA("SITE"),!!
QUIT
+1 WRITE @IOF,?6,"* * * STATISTICS ON PATIENTS WITH MISSING OR INVALID DATA * * *",!,?22,"AT ",AZZDA("SITE"),!!
QUIT