VistA-WorldVistAEHR/r/CLINICAL_MONITORING_SYSTEM-QAM/QAMPMON1.m

35 lines
2.8 KiB
Mathematica
Raw Permalink Normal View History

2009-11-29 13:37:14 -05:00
QAMPMON1 ;HISC/DAD-MONITOR DESCRIPTION REPORT ;9/14/92 11:29
;;1.0;Clinical Monitoring System;;09/13/1993
S (QAMPAGE,QAMHEAD,QAMPAUSE)=1,QAMZERO=$S($D(^QA(743,QAMD0,0))#2:^(0),1:""),QAMONE=$S($D(^(1))#2:^(1),1:"") Q:QAMZERO="" S QAMFOUND=1 D HEAD
W !!,"CODE: ",$P(QAMZERO,"^")," ",$S($P(QAMZERO,"^",4):"(a)",1:"(m)"),?43,"TITLE: ",$P(QAMZERO,"^",2) S X=$P(QAMZERO,"^",3),X=$S($D(^DIC(49,+X,0))#2:$P(^(0),"^"),1:X) W !,"SERVICE: ",X
W !,"STATUS: ",$S($P(QAMZERO,"^",5):"Finished",1:"Under Construction"),?28,"SWITCH: ",$S($P(QAMONE,"^",5):"On",1:"Off") S Y=$P(QAMONE,"^",6) X ^DD("DD") W ?43,"START: ",Y S Y=$P(QAMONE,"^",7) X ^DD("DD") W ?62,"END: ",Y
S X=$P(QAMONE,"^"),X=$S($D(^QA(743.92,+X,0))#2:$P(^(0),"^"),1:X)
W !,"TIME FRAME: ",X,?43,"THRESHOLD: ",$P(QAMONE,"^",3),?60,$S($P(QAMONE,"^",3)["%":"MIN SAMPLE: ",1:"ALERT LEVEL: "),$P(QAMONE,"^",2)
W !?43,"HI/LO %: ",$S($P(QAMONE,"^",3)'["%":"n/a",$P(QAMONE,"^",4)="H":"High",$P(QAMONE,"^",4)="L":"Low",1:""),?60,"DUPLICATES: ",$S($P(QAMONE,"^",14):"Yes",1:"No")
W !!," STANDARD OF CARE",!,"------------------" K ^UTILITY($J,"W") S DIWL=2,DIWR=78,DIWF="W"
F QAMD1=0:0 S QAMD1=$O(^QA(743,QAMD0,"STDC",QAMD1)) Q:QAMD1'>0!QAMQUIT S X=^QA(743,QAMD0,"STDC",QAMD1,0) D ^DIWP,PAGE
G:QAMQUIT EXIT D ^DIWW,PAGE G:QAMQUIT EXIT
W !!," CLINICAL INDICATOR",!,"--------------------" K ^UTILITY($J,"W") S DIWL=2,DIWR=78,DIWF="W" D PAGE
F QAMD1=0:0 S QAMD1=$O(^QA(743,QAMD0,"CLIN",QAMD1)) Q:QAMD1'>0!QAMQUIT S X=^QA(743,QAMD0,"CLIN",QAMD1,0) D ^DIWP,PAGE
G:QAMQUIT EXIT D ^DIWW,PAGE G:QAMQUIT EXIT
W !!," RATIONALE",?35,"EXPLANATION",!,"-----------",?34,"-------------" S QAMHEAD=$O(^QA(743,QAMD0,"RAT",0)) D PAGE
F QAMD1=0:0 S QAMD1=$O(^QA(743,QAMD0,"RAT",QAMD1)) Q:QAMD1'>0!QAMQUIT D RAT1
EXIT D:$E(IOST)="C" PAUSE
Q
RAT1 ;
S X=$S($D(^QA(743,QAMD0,"RAT",QAMD1,0))#2:$P(^(0),"^"),1:""),QAMRAT=$S($D(^QA(743.91,+X,0))#2:$P(^(0),"^"),1:X)
K ^UTILITY($J,"W") S DIWL=35,DIWR=78,DIWF="" F QAMD2=0:0 S QAMD2=$O(^QA(743,QAMD0,"RAT",QAMD1,"EXP",QAMD2)) Q:QAMD2'>0 S X=^QA(743,QAMD0,"RAT",QAMD1,"EXP",QAMD2,0) D ^DIWP
W !?1,QAMRAT S QAMD2=$O(^UTILITY($J,"W",DIWL,0)) W:QAMD2 ?DIWL,^UTILITY($J,"W",DIWL,QAMD2,0) S QAMHEAD=$O(^UTILITY($J,"W",DIWL,QAMD2)) D PAGE
I QAMD2 F QAMD2=QAMD2:0 S QAMD2=$O(^UTILITY($J,"W",DIWL,QAMD2)) Q:QAMD2'>0!QAMQUIT W !?DIWL,^UTILITY($J,"W",DIWL,QAMD2,0) S QAMHEAD=$O(^UTILITY($J,"W",DIWL,QAMD2)) D PAGE
Q
HEAD ;REPORT HEADER
W:(QAMPAGE>1)!($E(IOST)="C") @IOF
W !!?27,"MONITOR DESCRIPTION REPORT",?68,QAMTODAY,!?68,"PAGE: ",QAMPAGE S QAMPAGE=QAMPAGE+1 W !,"================================================================================"
Q
PAUSE ;PAUSE AT END OF PAGE
I QAMPAUSE K DIR S DIR(0)="E" D ^DIR K DIR S QAMQUIT=$S(Y:0,1:1),QAMPAUSE=0
Q
PAGE ;CHECK FOR END OF PAGE
S QAMPAUSE=1 Q:$Y'>(IOSL-6) D:$E(IOST)="C" PAUSE Q:QAMQUIT D:QAMHEAD HEAD
Q