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

QAMAUTO3.m

Go to the documentation of this file.
QAMAUTO3 ;HISC/GJC-AUTO ENROLL FALL OUT REPORT ;9/13/93  08:42
 ;;1.0;Clinical Monitoring System;;09/13/1993
 ;
 S ZTIO=$P($G(^QA(740,1,"QAM")),U,2) G:ZTIO="" K9
 S ZTDESC="Generate Fall-Out reports.",ZTDTH=$H,ZTRTN="EN1^QAMAUTO3",(ZTSAVE("^UTILITY($J,"),ZTSAVE("QAMD0"),ZTSAVE("QAMTODAY"))="" D ^%ZTLOAD
 G K9
EN1 U IO
 K QAMST S QAMPG=0,Y=DT X ^DD("DD") S QAMDT=Y,$P(QAMST,"-",81)="",Y=QAMTODAY X ^DD("DD") S QAMDT0=Y
 D HDER G:'$D(QAMD0) K1
 I $D(^UTILITY($J,"QAM FALL OUT",QAMD0)),^(QAMD0)'>0 W !,"Zero fall outs for the ",$P($G(^QA(743,QAMD0,0)),U)," monitor." G K1
 ;GRAB THE PATIENT(S) FOR THE SPECIFIC MONITOR.
 S QAM1=0 K ^TMP($J,"QAMAUTO3")
 F  S QAM1=$O(^UTILITY($J,"QAM FALL OUT",QAMD0,QAM1)) Q:QAM1'>0  D
 . S X=$P($G(^DPT(QAM1,0)),"^") Q:X=""
 . S ^TMP($J,"QAMAUTO3",X,QAM1)=""
 . Q
 S QAMPAT="" F  S QAMPAT=$O(^TMP($J,"QAMAUTO3",QAMPAT)) Q:QAMPAT=""  F QAM1=0:0 S QAM1=$O(^TMP($J,"QAMAUTO3",QAMPAT,QAM1)) Q:QAM1'>0  D PAT
 W !!,"Total number of Fall Outs is: ",^UTILITY($J,"QAM FALL OUT",QAMD0),!,"Fall Out sample size is: ",^UTILITY($J,"QAM SAMPLE",QAMD0),!,"Percent Fall Out: "
 I ^UTILITY($J,"QAM SAMPLE",QAMD0)>0 W $J((^UTILITY($J,"QAM FALL OUT",QAMD0)/^UTILITY($J,"QAM SAMPLE",QAMD0)*100),3,3)_"%",!
 E  W "Division by zero!",!
K1 W !
K9 D ^%ZISC,HOME^%ZIS
 K %ZIS,DFN,IOP,QAM1,QAMDT,QAMDT0,QAMFG,QAMPG,QAMSSN,QAMST,QAMZ,VA,Y,ZTDESC,ZTDTH,ZTRTN,ZTSAVE,ZTSK,^TMP($J,"QAMAUTO3")
 S:$D(ZTQUEUED) ZTREQ="@"
 Q
PAT ;
 S DFN=QAM1 D PID^VADPT6 S QAMSSN=VA("PID") W !,"PATIENT: ",$S($D(^DPT(QAM1,0))#2:$P(^(0),U),1:QAM1),?45,"SSN: ",QAMSSN D DATE
 Q
DATE ;
 F QAMZ=0:0 S QAMZ=$O(^UTILITY($J,"QAM FALL OUT",QAMD0,QAM1,QAMZ)) Q:QAMZ'>0  S Y=QAMZ X ^DD("DD") W !,"   DATE:   ",Y W:^UTILITY($J,"QAM FALL OUT",QAMD0,QAM1,QAMZ)="*" ?45,"*** Duplicate ***" D:$Y>(IOSL-5) HDER
 Q
HDER ;HEADER
 S QAMPG=QAMPG+1 W:(QAMPG>1)!($E(IOST)="C") @IOF
 W !!?30,"DAILY FALL OUT REPORT",?68,QAMDT,!?32,"FOR: ",QAMDT0,?68,"PAGE: ",QAMPG D EN6^QAQAUTL W !,QAMST
 I $S($D(QAMD0)[0:1,$D(^QA(743,+QAMD0,0))[0:1,1:0) W !!,"*** Monitor data not found ***" Q
 S QAM=$G(^QA(743,+QAMD0,0))
 W !!,"CODE: ",$P(QAM,U)," ",$S($P(QAM,U,4):"(a)",1:"(m)"),?43,"TITLE: ",$P(QAM,U,2),! W "SERVICE: " I $P(QAM,U,3) W $P($G(^DIC(49,+$P(QAM,U,3),0)),U)
 W !
 Q