45 lines
1.8 KiB
Mathematica
45 lines
1.8 KiB
Mathematica
|
QAOEDT ;HISC/DAD-PATIENT SELECTOR ;2/4/93 08:03
|
||
|
;;3.0;Occurrence Screen;;09/14/1993
|
||
|
EN1 ; *** OPEN/CLOSED/BOTH RECORDS SCREEN
|
||
|
K QALIMIT D ENCHOS^QAOUTL0 G:QAOSQUIT EXIT
|
||
|
EN2 ; *** NO/USER SUPPLIED SCREEN
|
||
|
S QALIMIT=$S($G(QALIMIT)]"":QALIMIT,1:"I 1")
|
||
|
;
|
||
|
I $P($G(^QA(740,1,"OS")),"^",8)'>0 G SINGPAT
|
||
|
K DIR S DIR(0)="SO^1:Single/Multiple Records;2:Records by Date Range;"
|
||
|
S DIR("A")="Patient selection method",DIR("B")="Single/Multiple Records"
|
||
|
S DIR("?",1)="Enter 1 to choose one or more Occurrence Screen records."
|
||
|
S DIR("?")="Enter 2 to choose all Occurrence Screen records within a date range."
|
||
|
D ^DIR G EXIT:$D(DIRUT),DATRANG:Y=2
|
||
|
;
|
||
|
MULTPAT ; *** SELECT MULTIPLE PATIENTS
|
||
|
S QAQDIC="^QA(741,",QAQDIC(0)="AEMNQ",QAQDIC("A")="Select PATIENT: "
|
||
|
S QAQDIC("S")=QALIMIT,QAQUTIL="QAOEDT" D ^QAQSELCT G:QAQQUIT EXIT
|
||
|
S QAOSQUIT=0,QAOSONE="" F S QAOSONE=$O(^UTILITY($J,"QAOEDT",QAOSONE)) Q:QAOSONE=""!QAOSQUIT F QAOSD0=0:0 S QAOSD0=$O(^UTILITY($J,"QAOEDT",QAOSONE,QAOSD0)) Q:QAOSD0'>0!QAOSQUIT D
|
||
|
. I $D(^QA(741,QAOSD0,0))#2 D PROGRAM(QAOSD0)
|
||
|
. Q
|
||
|
G EXIT
|
||
|
;
|
||
|
DATRANG ; *** SELECT PATIENTS BY DATE RANGE
|
||
|
D ^QAQDATE G:QAQQUIT EXIT S QAOSQUIT=0
|
||
|
F QAOSONE=QAQNBEG-.00000001:0 S QAOSONE=$O(^QA(741,"C",QAOSONE)) Q:(QAOSONE'>0)!(QAOSONE>(QAQNEND+.24))!QAOSQUIT F QAOSD0=0:0 S QAOSD0=$O(^QA(741,"C",QAOSONE,QAOSD0)) Q:QAOSD0'>0!QAOSQUIT D
|
||
|
. I $D(^QA(741,QAOSD0,0))#2 S Y=QAOSD0 X QALIMIT D:$T PROGRAM(QAOSD0)
|
||
|
. Q
|
||
|
G EXIT
|
||
|
;
|
||
|
SINGPAT ; *** SELECT PATIENTS ONE AT A TIME
|
||
|
F D Q:QAQQUIT
|
||
|
. K DIC S DIC="^QA(741,",DIC(0)="AEMNQZ",DIC("A")="Select PATIENT: "
|
||
|
. S DIC("S")=QALIMIT W ! D ^DIC S QAQQUIT=$S(Y'>0:1,1:0) Q:QAQQUIT
|
||
|
. S QAOSD0=+Y D PROGRAM(QAOSD0)
|
||
|
. Q
|
||
|
;
|
||
|
EXIT ; *** EXIT PATIENT SELECTOR ROUTINE
|
||
|
K ^UTILITY($J,"QAOEDT") D K^QAQDATE
|
||
|
Q
|
||
|
;
|
||
|
PROGRAM(QAOSD0) ; *** RUN THE OPTION (QAOSD0 = IEN IN FILE #741)
|
||
|
N QALIMIT,QAOSONE,QAQNBEG,QAQNEND
|
||
|
D @QAOSPROG
|
||
|
Q
|