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

31 lines
2.0 KiB
Mathematica

QAMPINQ4 ;HISC/DAD-INQUIRE: CONDITION FILE ;11/13/92 08:23
;;1.0;Clinical Monitoring System;;09/13/1993
EN1 D XIT S QAQDIC="^QA(743.3,",QAQDIC(0)="AEMNQ",QAQDIC("A")="Select CONDITION: ",QAQUTIL=743.3 D ^QAQSELCT G:QAQQUIT EXIT
K %ZIS,IOP S %ZIS="MQ",%ZIS("B")="HOME" W ! D ^%ZIS G:POP EXIT I $D(IO("Q")) K IO("Q") S ZTRTN="ENTSK^QAMPINQ4",ZTSAVE("^UTILITY($J,")="",ZTDESC="Condition file inquire" D ^%ZTLOAD G EXIT
ENTSK ;
S QAMQUIT=0,QAMCTXT="" K QAMUNDL S $P(QAMUNDL,"=",81)="" U IO
F S QAMCTXT=$O(^UTILITY($J,743.3,QAMCTXT)) Q:QAMCTXT=""!QAMQUIT F QAMD0=0:0 S QAMD0=$O(^UTILITY($J,743.3,QAMCTXT,QAMD0)) Q:QAMD0'>0!QAMQUIT D LOOP
EXIT ;
W ! D ^%ZISC
XIT K %ZIS,DIR,DIW,DIWF,DIWL,DIWR,DIWT,DN,POP,QA,QAM,QAMAUTO,QAMCOND,QAMCTXT,QAMD0,QAMD1,QAMELEM,QAMFOUND,QAMPAGE,QAMQUIT,QAMUNDL,QAQQUIT,X,Y,ZTRTN,ZTSAVE,^UTILITY($J,743.3),^UTILITY($J,"W"),^UTILITY($J,"QAMPINQ4")
S:$D(ZTQUEUED) ZTREQ="@"
Q
LOOP ;
S QAM=$S($D(^QA(743.3,QAMD0,0))#2:^(0),1:"") Q:QAM="" S QAMCOND=$P(QAM,"^"),QAMAUTO=$S($P(QAM,"^",2):"YES",1:"NO")
K ^UTILITY($J,"QAMPINQ4") F QAMD1=0:0 S QAMD1=$O(^QA(743.3,QAMD0,"ELEM",QAMD1)) Q:QAMD1'>0 S QA=+^QA(743.3,QAMD0,"ELEM",QAMD1,0),QAM=$S($D(^QA(743.4,QA,0))#2:$P(^(0),"^"),1:QA),^UTILITY($J,"QAMPINQ4",QAM)=""
S QAMPAGE=1 D HEAD W !,"CONDITION: ",QAMCOND,?44,"AUTO ENROLL: ",QAMAUTO,!!,"DESCRIPTION:"
S QAMFOUND=0,DIWL=6,DIWR=75,DIWF="W" K ^UTILITY($J,"W")
F QAMD1=0:0 S QAMD1=$O(^QA(743.3,QAMD0,"DESC",QAMD1)) Q:QAMD1'>0!QAMQUIT S X=^QA(743.3,QAMD0,"DESC",QAMD1,0),QAMFOUND=1 D ^DIWP,PAUSE:$O(^QA(743.3,QAMD0,"DESC",QAMD1))
I 'QAMFOUND S X="Sorry, no description found for this condition." D ^DIWP,PAUSE
Q:QAMQUIT D ^DIWW,PAUSE Q:QAMQUIT
W !,"DATA ELEMENTS:" D PAUSE Q:QAMQUIT
S QAMELEM="" F S QAMELEM=$O(^UTILITY($J,"QAMPINQ4",QAMELEM)) Q:QAMELEM=""!QAMQUIT W !?5,QAMELEM D:$O(^UTILITY($J,"QAMPINQ4",QAMELEM))]"" PAUSE
I 'QAMQUIT W !!,QAMUNDL D WAIT
Q
PAUSE Q:$Y'>(IOSL-4) D WAIT,HEAD:'QAMQUIT
Q
HEAD W:(QAMPAGE>1)!($E(IOST)="C") @IOF,!,QAMUNDL,! S QAMPAGE=QAMPAGE+1
Q
WAIT I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR S QAMQUIT=$S(Y'>0:1,1:0)
Q