source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSODEDT.m@ 1742

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1PSODEDT ;BHAM ISC/SAB - edit due answer sheet ; 06/03/92 17:26
2 ;;7.0;OUTPATIENT PHARMACY;**2,268**;DEC 1997;Build 9
3SEQNUM K DIC S DIC="^PS(50.0731,",DIC("A")="Select DUE ANSWER SEQUENCE NUMBER ('^S' to Search): ",DIC(0)="QEAM" D ^DIC K DIC
4 G:(X="^")!($D(DTOUT))!(X="") EXIT
5 S PSA=+Y
6 I (PSA<1)&($E(X,1,2)="^S") D SEARCH G:PSA<1 SEQNUM
7 I PSA<1 W " ??",$C(7) G SEQNUM
8EDIT S DIE="^PS(50.0731,",(DA,PSODUEL)=PSA,DR=".01" L +^PS(50.0731,PSODUEL):$S(+$G(^DD("DILOCKTM"))>0:+^DD("DILOCKTM"),1:3) I '$T W !,"Entry is being edited by another user. Try Later!" G EXIT
9 D ^DIE L -^PS(50.0731,PSODUEL) K DIE,DA,DR,PSODUEL
10 G:$D(Y) EXIT
11 D:$D(^PS(50.0731,PSA,0)) DIE^PSODLKP
12 G PSODEDT
13EXIT K ^TMP("PSOD",$J)
14 K DA,DIC,DIE,DIQ,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,DX,DY,FLD,I,ID,IX,IXN
15 K IXS,N,PID,PSDPOP,PSA,PSCH,PSDIG,PSEED,PSFLAG,PSHI,PSHIT,PSIX,PSL,PSLEN
16 K PSLO,PSMARG,PSQ,PSQN,PSQNUM,PSQP,PSTXT,PSTYP,PSWRAP,X,Y
17 QUIT
18 ;
19SEARCH K DIR,DUOUT,DTOUT,PSCH,PSIX,PID,^TMP("PSOD",$J)
20 W !!!!!,"If you do not know the Sequence Number, you may search by any or all of the",!,"following fields: "
21 W !!?5,"QUESTIONNAIRE",!?5,"DRUG",!?5,"PROVIDER",!!?5,"Type '^' to exit.",!
22 S PSFLAG=0
23 F FLD=1,2,4 Q:$D(DTOUT)!$D(DUOUT) S DIR(0)="50.0731,"_FLD_"O" D ASK
24 Q:'PSFLAG
25 S IXS=""
26 F FLD=1,2,4 I $D(PSCH(FLD)),PSCH(FLD) S IXS=$S(FLD=1:"Q",FLD=2:"D",1:"P")_IXS
27 I $L(IXS)>1 S PSEED=$E(IXS) F N=0:0 S IX=PSEED D GETIXN S N=$O(^PS(50.0731,PSEED,PSCH(IXN),N)) Q:'N S PSHIT=1 D GETN I PSHIT S ^TMP("PSOD",$J,N)=""
28 I $L(IXS)=1 S IX=IXS D GETIXN F N=0:0 S N=$O(^PS(50.0731,IXS,PSCH(IXN),N)) Q:'N S ^TMP("PSOD",$J,N)=""
29 I '$D(^TMP("PSOD",$J)) W !!?5,"No Matches Found!!!",!! Q
30 I '$O(^TMP("PSOD",$J,$O(^TMP("PSOD",$J,0)))) S PSA=$O(^TMP("PSOD",$J,0)) W !! Q
31 S PSDPOP=0
32CHOICES W !!?2,"CHOOSE FROM...",!!
33 S DIC="^PS(50.0731,",DR="1:9",DIQ="PID",DIQ(0)="E"
34 S PSL=$S($D(IOSL):IOSL-3,1:21),(DX,DY)=0 X ^%ZOSF("XY")
35 F N=0:0 S N=$O(^TMP("PSOD",$J,N)) Q:'N D DISPLAY Q:PSDPOP
36 K DIC,DIQ
37 S PSA=0
38 Q
39ASK K DA
40 D ^DIR K DIR
41 S PSCH(FLD)=+Y,PSFLAG=PSFLAG+Y
42 Q
43GETN F I=2:1:$L(IXS) S IX=$E(IXS,I) D GETIXN S PSHIT=PSHIT*$D(^PS(50.0731,IX,PSCH(IXN),N))
44 Q
45GETIXN S IXN=$S(IX="Q":1,IX="D":2,1:4)
46 Q
47DISPLAY I $Y,$Y>PSL S (DX,DY)=0 X ^%ZOSF("XY") S DIR(0)="E" D ^DIR W $C(13),$J("",45),$C(13) I 'Y S PSDPOP=1 Q
48 S (PSQNUM,DA)=N,PSQ=""
49 D EN^DIQ1
50 F ID=.01:0 S ID=$O(PID(50.0731,DA,ID)) Q:'ID S PSQ=PSQ_PID(50.0731,DA,ID,"E")_$S($L(PID(50.0731,DA,ID,"E")):"/",1:"")
51 D WRAP
52 Q
53WRAP ;Enter here from PSODACT,PSODLKP,PSODEDT to format Question
54 ;Needs PSQ=text, PSQNUM=question number
55 NEW I,K
56 S PSTXT=$P(PSQ,"^") W !,PSQNUM,"."
57 S PSWRAP=1,PSMARG=$S('$G(PSORM):80,$D(IOM):IOM,1:80)-5
58W1 S:$L(PSTXT)<PSMARG PSWRAP(PSWRAP)=PSTXT I $L(PSTXT)'<PSMARG F I=PSMARG:-1:0 I $E(PSTXT,I)?1P S PSWRAP(PSWRAP)=$E(PSTXT,1,I),PSTXT=$E(PSTXT,I+1,999),PSWRAP=PSWRAP+1 G W1
59 F K=1:1:PSWRAP W ?($L(PSQNUM)+2),PSWRAP(K),!
60 Q
61QUES2 I PSTYP=1 W !!,?5,"Enter Y for YES, N for NO, U for UNKNOWN."
62 I PSTYP=2 W !!,?5,"Enter a FREE TEXT answer from 1 to ",PSLEN," characters."
63 I PSTYP=3 W !!,?5,"Enter a number between ",PSLO," and ",PSHI,!,?5,"with a maximum of ",PSDIG," decimal digits."
64 W !?5,"Enter carriage return to bypass."
65 W !?5,"Enter '^' to exit."
66 D WRAP
67 Q
Note: See TracBrowser for help on using the repository browser.