source: WorldVistAEHR/trunk/r/MEDICINE-MC/MCARDNQ.m@ 1482

Last change on this file since 1482 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1MCARDNQ ;WISC/TJK,JA-SCREEN INPUT - QUESTIONMARKS ;8/23/96 08:08
2 ;;2.3;Medicine;;09/13/1996
3 S D=""
4A S DJX="" X DJCP
5 I DJ4["R" W "**REQUIRED**",*7
6 S:'$D(X) X=DJXX G:X'="??" F G:'$D(^DD(DJDD,DJAT,21,0)) F G:'$P(^(0),U,4) F
7 S DJZ1=0,DIWL=1,DIWR=79,DIWF="" K ^UTILITY($J,"W")
8 S DJXX=X F DJK=1:1 S DJZ1=$O(^DD(DJDD,DJAT,21,DJZ1)) Q:DJZ1="" S X=^(DJZ1,0) D ^DIWP
9 D ^DIWW ; purge WP buffer
10 S DJZ1=0 F DJK=1:1 S DJZ1=$O(^UTILITY($J,"W",DIWL,DJZ1)) Q:DJZ1="" D:$Y>21 CONT Q:DJX[U W !,^(DJZ1,0)
11 K DJZ1,DJK,^UTILITY($J,"W",DIWL),DIWL,DIWR,DIWF S X=DJXX G:DJX'[U F Q
12CONT D MCMASS W !,"Press <RETURN> to Continue, '^' to Quit: " R DJX:DTIME X DJCP W ! Q
13F D MCMASS D:$Y>21 CONT Q:DJX[U D:$D(^DD(DJDD,DJAT,3)) MCDJHELP I $D(^DD(DJDD,DJAT,4)) W ! X ^(4)
14 ;I DJ4["S",DJ4'["M" D:$Y>21 CONT Q:DJX[U W !,"CHOOSE FROM:" S DJS=$P(^DD(DJDD,DJAT,0),U,3) F DJK=1:1 S Y=$P(DJS,";",DJK) Q:Y="" S Y="'"_$P(Y,":",1)_"' FOR "_$P(Y,":",2) D:$Y>21 CONT Q:DJX[U W !,Y
15 ;
16 I DJ4["S",DJ4'["M" D:$Y>21 CONT Q:DJX[U D
17 . N DIC,DJX S DIC("S")=$G(^DD(DJDD,DJAT,12.1)),DJX=""
18 . W !,"CHOOSE FROM:"
19 . S DJS=$P(^DD(DJDD,DJAT,0),U,3)
20 . F DJK=1:1 S Y=$P(DJS,";",DJK) Q:Y=""!(DJX[U) D
21 .. I DIC("S")]"" S Y=$P(Y,":") X DIC("S") Q:'$T S Y=$P(DJS,";",DJK)
22 .. S Y="'"_$P(Y,":",1)_"' FOR "_$P(Y,":",2)
23 .. D:$Y>21 CONT Q:DJX[U
24 .. W !,Y
25 .. Q
26 . Q
27 ;
28 D DCS
29 I DJ4["P" K DIC("S") S DJDIC=DIC,DJD0=D0,DIC(0)=$S(DJ4["'":"MEQZ",1:"MEQZL"),DIC=+$P(DJ4,"P",2) D:$Y>21 CONT X:$P(^DD(DJDD,DJAT,0),U,2)["*" ^(12.1) D ^MCARDC K DIC S DIC=DJDIC,D0=DJD0 G:Y<0 R1 S V(V)=$P(Y,U,2) G P1
30 ;I DJ4["D" S:'$D(%DT) %DT="E" D HELP
31 I DJ4["D" D
32 . N %DT,X,Y
33 . I 'DJ4 S Y=$P($P(DJ0,U,5,99)," D ^%DT")
34 . I DJ4 S Y=$P($P($G(^DD(+DJ4,.01,0)),U,5,99)," D ^%DT")
35 . X $S(Y]"":Y,1:"S %DT=""E""")
36 . D HELP
37 . Q
38 K DJS,DJZ1 I $Y>23 X DJCL R "Press <RETURN> to Continue",X:DTIME S DJZ=V D N^MCARDPL S V=DJZ Q
39 S @$P(DJJ(V),U,2) X XY W $G(V(V)) Q
40P D DCS,MCMASS
41 K DIC("S") S DJDIC=DIC,DJD0=D0,DIC(0)=$S(DJ4["'":"MEQZ",1:"MEQZL"),DIC=+$P(DJ4,"P",2) X DJCP X:$P(^DD(DJDD,DJAT,0),U,2)["*" ^(12.1) D ^MCARDC K DIC S:+Y>0 V(V)=$E($P(Y,U,2),1,+DJJ(V)),DIC=DJDIC,D0=DJD0 G:Y<0 R1
42P1 S X=+Y,V(V)=$E($P(Y,U,2),1,+DJJ(V)),(DIE,DIC)=DJDIC,DA=DJDN,DR=DJ3_"////"_X X DJCP W ! D ^DIE S D0=DJD0 K DJD0 D PP S V(V)=$E(V(V),1,+DJJ(V))
43 S YMLH=$O(^MCAR(697.3,DJN,1,"A",V,0)) S:YMLH="" YMLH=-1
44 X:$D(^MCAR(697.3,DJN,1,YMLH,1)) ^(1)
45 I $Y>23 S DJZ=V D N^MCARDPL S V=DJZ Q
46 S DY=17,DX=0 X XY W DJEOP S @$P(DJJ(V),U,2) X XY W DJHIN X XY W V(V),DJLIN Q
47R1 K DJD0 S DIC=DJDIC D MCMASS
48 S @$P(DJJ(V),U,2) X XY W:$D(V(V)) DJHIN W:$D(V(V)) V(V) X XY Q
49HELP ;
50 D MCMASS
51 D:$Y>21 R W !,"EXAMPLES OF VALID DATES:"
52 D:$Y>21 R W !," JAN 22 1957 or 22 JAN 57 or 1/22/57 or 012257"
53 D:$Y>21 R W !," T (FOR TODAY), T+1 (FOR TOMORROW), T+2, T+7, etc."," T-1 (FOR YESTERDAY)"
54 D:$Y>21 R W !," T-3W (3 WEEKS AGO), etc."
55 D:$Y>21 R W !,"IF THE YEAR IS OMITTED, THE COMPUTER USES THE CURRENT YEAR"
56 D:$Y>21 R I %DT'["X" W !,"YOU MAY OMIT THE PRECISE DAY, AS: JAN, 1957",!
57 D:$Y>21 R I %DT["T" W !,"FOLLOW DATE WITH TIME, AS: JAN 22@10, T@10PM, ETC."
58 D R
59 Q
60R D MCMASS X DJCL W "Press <RETURN> to Continue" R DJX:10 X DJCP
61PP D MCMASS S DJZ=+$P($P(^DD(DJDD,DJAT,0),"^",2),"P",2) Q:$P(^DD(DJZ,.01,0),"^",2)'["P"
62P11 I $D(@("^"_$P(^DD(DJZ,.01,0),U,3)_"V(V),0)")) S V(V)=$P(^(0),U,1)
63 S DJZ=+$P($P(^DD(DJZ,.01,0),"^",2),"P",2) Q:$P(^DD(DJZ,.01,0),"^",2)'["P" G P11
64DCS S DJNODE=.01 Q:DJ4'["P"
65 S DJ44=$S(DJ4'["'":DJ4,1:$P(DJ4,"P",2))
66 Q:'$D(^DD(+DJ44,0,"UP")) I $D(^DD(^DD(+DJ44,0,"UP"),0,"UP")) S DJ44=^DD(+DJ44,0,"UP"),DJNODE=$P(DJJ(V),U,3)
67 I DJNODE=.01,$D(^DD(DJDD,DJ3,12.1)) X ^(12.1) G DCS1
68 K DIC("S") Q:'$D(^DD(+DJ44,DJNODE)) S:'$D(DIC(0)) DIC(0)=""
69 I $D(^DD(+DJ44,DJNODE,12.1)) X ^(12.1)
70 E K DJNODE,DJ44 Q
71DCS1 S:'$D(DIC(0)) DIC(0)="" K:DIC(0)'="" DIC("S") K DJNODE,DJ44 Q
72MCDJHELP ;
73 S MCCNT=0,MCDJHELP(1)=^DD(DJDD,DJAT,3)
74 D MCDJHEL1
75 R !,"Press <RETURN> to Continue: ",MCXRET:DTIME
76 X DJCP
77 K MCDJHELP,MCCNT,MCXRET
78 Q
79MCDJHEL1 ;
80 S MCCNT=MCCNT+1
81 Q:'$D(MCDJHELP(MCCNT))
82 F I=79:-1:1 Q:$E(MCDJHELP(MCCNT),I)=" "
83 I $L(MCDJHELP(MCCNT))>79 S MCDJHELP(MCCNT+1)=$E(MCDJHELP(MCCNT),I+1,$L(MCDJHELP(MCCNT))),MCDJHELP(MCCNT)=$E(MCDJHELP(MCCNT),1,I-1)
84 W !,MCDJHELP(MCCNT)
85 G MCDJHEL1
86MCMASS ;Let the Screen Handlers know that the command was erase.
87 S MCMASS=1
88 Q
Note: See TracBrowser for help on using the repository browser.