QAMC9 ;HISC/DAD-CONDITION: FALL OUT ;9/3/93 13:14
;;1.0;Clinical Monitoring System;;09/13/1993
EN1 ; *** CONDITION CODE
S MONITOR=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:+^("P1"),1:0)
S LOOKBACK=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:+^("P2"),1:0)
S QAMDATE=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:+^("P3"),1:0)
S X1=QAMTODAY,X2=-(LOOKBACK+1) D C^%DTC S START=X_".9999999",END=QAMTODAY+.9999999
F FALLDT=START:0 S FALLDT=$O(^QA(743.1,"AA",MONITOR,FALLDT)) Q:(FALLDT'>0)!(FALLDT>END) F QAMDFN=0:0 S QAMDFN=$O(^QA(743.1,"AA",MONITOR,FALLDT,QAMDFN)) Q:QAMDFN'>0 D LOOP1
K MONITOR,LOOKBACK,X1,X2,X,START,END,FALLDT,FALLD0
Q
LOOP1 F FALLD0=0:0 S FALLD0=$O(^QA(743.1,"AA",MONITOR,FALLDT,QAMDFN,FALLD0)) Q:FALLD0'>0 S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^(QAMDFN,$S(QAMDATE:FALLDT,1:QAMTODAY))=FALLD0
Q
EN2 ; *** PARAMETER CODE
K DIR,DIRUT S DIR(0)="POA^743:AEMNQZ",DIR("A")="FALL OUT MONITOR: ",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:$P(^("P1"),"^",2),1:"") K:DIR("B")="" DIR("B")
S DIR("?",1)="Enter the monitor you want this condition to scan."
S QAMPARAM="P1" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=+Y_"^"_Y(0,0)
2 K DIR,DIRUT S DIR(0)="NO^1:365:0",DIR("A")="LOOK BACK DAYS",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"") K:DIR("B")="" DIR("B")
S DIR("?",1)="Enter the number of days the condition should 'look back'",DIR("?")="while trying to find a fall out for this monitor."
S QAMPARAM="P2" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P2")=+Y
3 K DIR,DIRUT S DIR("A")="ENTER THE TYPE OF DATE",DIR(0)="SOB^0:AUTO ENROLL DATE;1:FALL OUT DATE",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:$P(^("P3"),"^",2),1:"") K:DIR("B")="" DIR("B")
S DIR("?",1)=" 0 AUTO ENROLL DATE",DIR("?",2)=" 1 FALL OUT DATE",DIR("?",3)="Enter the date you wish to be",DIR("?",4)="associated with this condition.",DIR("?")="Enter a 'RETURN' for the AUTO ENROLL DATE."
S QAMPARAM="P3" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P3")=+Y_"^"_Y(0)
EXIT K Y
K QAMPARAM
Y Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HQAMC9 2152 printed Sep 15, 2024@21:06:31 Page 2
QAMC9 ;HISC/DAD-CONDITION: FALL OUT ;9/3/93 13:14
+1 ;;1.0;Clinical Monitoring System;;09/13/1993
EN1 ; *** CONDITION CODE
+1 SET MONITOR=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:+^("P1"),1:0)
+2 SET LOOKBACK=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:+^("P2"),1:0)
+3 SET QAMDATE=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:+^("P3"),1:0)
+4 SET X1=QAMTODAY
SET X2=-(LOOKBACK+1)
DO C^%DTC
SET START=X_".9999999"
SET END=QAMTODAY+.9999999
+5 FOR FALLDT=START:0
SET FALLDT=$ORDER(^QA(743.1,"AA",MONITOR,FALLDT))
if (FALLDT'>0)!(FALLDT>END)
QUIT
FOR QAMDFN=0:0
SET QAMDFN=$ORDER(^QA(743.1,"AA",MONITOR,FALLDT,QAMDFN))
if QAMDFN'>0
QUIT
DO LOOP1
+6 KILL MONITOR,LOOKBACK,X1,X2,X,START,END,FALLDT,FALLD0
+7 QUIT
LOOP1 FOR FALLD0=0:0
SET FALLD0=$ORDER(^QA(743.1,"AA",MONITOR,FALLDT,QAMDFN,FALLD0))
if FALLD0'>0
QUIT
SET ^UTILITY($JOB,"QAM CONDITION",QAMD1,QAMDFN)=""
SET ^(QAMDFN,$SELECT(QAMDATE:FALLDT,1:QAMTODAY))=FALLD0
+1 QUIT
EN2 ; *** PARAMETER CODE
+1 KILL DIR,DIRUT
SET DIR(0)="POA^743:AEMNQZ"
SET DIR("A")="FALL OUT MONITOR: "
SET DIR("B")=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:$PIECE(^("P1"),"^",2),1:"")
if DIR("B")=""
KILL DIR("B")
+2 SET DIR("?",1)="Enter the monitor you want this condition to scan."
+3 SET QAMPARAM="P1"
DO EN3^QAMUTL1
IF $DATA(DIRUT)
SET Y=-1
GOTO Y
+4 if Y]""
SET ^QA(743,QAMD0,"COND",QAMD1,"P1")=+Y_"^"_Y(0,0)
2 KILL DIR,DIRUT
SET DIR(0)="NO^1:365:0"
SET DIR("A")="LOOK BACK DAYS"
SET DIR("B")=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"")
if DIR("B")=""
KILL DIR("B")
+1 SET DIR("?",1)="Enter the number of days the condition should 'look back'"
SET DIR("?")="while trying to find a fall out for this monitor."
+2 SET QAMPARAM="P2"
DO EN3^QAMUTL1
IF $DATA(DIRUT)
SET Y=-1
GOTO Y
+3 if Y]""
SET ^QA(743,QAMD0,"COND",QAMD1,"P2")=+Y
3 KILL DIR,DIRUT
SET DIR("A")="ENTER THE TYPE OF DATE"
SET DIR(0)="SOB^0:AUTO ENROLL DATE;1:FALL OUT DATE"
SET DIR("B")=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:$PIECE(^("P3"),"^",2),1:"")
if DIR("B")=""
KILL DIR("B")
+1 SET DIR("?",1)=" 0 AUTO ENROLL DATE"
SET DIR("?",2)=" 1 FALL OUT DATE"
SET DIR("?",3)="Enter the date you wish to be"
SET DIR("?",4)="associated with this condition."
SET DIR("?")="Enter a 'RETURN' for the AUTO ENROLL DATE."
+2 SET QAMPARAM="P3"
DO EN3^QAMUTL1
IF $DATA(DIRUT)
SET Y=-1
GOTO Y
+3 if Y]""
SET ^QA(743,QAMD0,"COND",QAMD1,"P3")=+Y_"^"_Y(0)
EXIT KILL Y
+1 KILL QAMPARAM
Y QUIT