29 lines
2.1 KiB
Mathematica
29 lines
2.1 KiB
Mathematica
|
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
|