source: FOIAVistA/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSORXI.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1PSORXI ;IHS/DSD/JCM - logs pharmacy interventions ; 03/19/93 11:56
2 ;;7.0;OUTPATIENT PHARMACY;**268**;DEC 1997;Build 9
3 ; This routine is used to create entries in the APSP INTERVENTION file.
4START ;
5 D INIT,DIC G:PSORXI("QFLG") END
6 D EDIT
7 S:'$D(PSONEW("PROVIDER")) PSONEW("PROVIDER")=$P(^APSPQA(32.4,PSORXI("DA"),0),"^",3)
8END D EOJ
9 Q
10INIT ;
11 W !!,"Now creating Pharmacy Intervention",!
12 I $G(PSODRUG("IEN")) W "for "_$P($G(^PSDRUG(PSODRUG("IEN"),0)),"^"),!
13 K PSORXI S PSORXI("QFLG")=0
14 Q
15DIC ;
16 K DIC,DR,DA,X,Y,DD,DO S DIC="^APSPQA(32.4,",DLAYGO=9009032.4,DIC(0)="L",X=DT
17 S DIC("DR")=".02////"_+PSODFN_";.04////"_DUZ_";.05////"_PSODRUG("IEN")_";.06///PHARMACY"
18 S DIC("DR")=DIC("DR")_";.07"_$S($G(PSORX("INTERVENE"))=1:"////18",$G(PSORX("INTERVENE"))=2:"////19",1:"////6")_";.14////0"_";.16////"_$S($G(PSOSITE)]"":PSOSITE,1:"")
19 D FILE^DICN K DIC,DR,DA
20 I Y>0 S PSORXI("DA")=+Y
21 E S PSORXI("QFLG")=1 G DICX
22 D DIE
23DICX K X,Y
24 Q
25DIE ;
26 K DIE,DIC,DR,DA
27 S DIE="^APSPQA(32.4,",DA=PSORXI("DA"),DR=$S($G(PSORXI("EDIT"))]"":".03:1600",1:".03;.08")
28 L +^APSPQA(32.4,PSORXI("DA")):$S(+$G(^DD("DILOCKTM"))>0:+^DD("DILOCKTM"),1:3) D ^DIE K DIE,DIC,DR,X,Y,DA L -^APSPQA(32.4,PSORXI("DA"))
29 W $C(7),!!,"See 'Pharmacy Intervention Menu' if you want to delete this",!,"intervention or for more options.",!
30 Q
31EDIT ;
32 K DIR W ! S DIR(0)="Y",DIR("A")="Would you like to edit this intervention ",DIR("B")="N" D ^DIR K DIR I $D(DIRUT)!'Y G EDITX
33 S PSORXI("EDIT")=1 D DIE G EDIT
34EDITX K X,Y
35 Q
36EOJ ;
37 K PSORXI
38 Q
39EN1(PSOX) ; Entry Point if have internal rx #
40 N PSODFN,PSONEW,PSODRUG,PSOY
41 I $G(^PSRX(+$G(PSOX),0))']"" W !,$C(7),"No prescription data" G EN1X
42 S PSORXI("IRXN")=PSOX K PSOY S PSOY=^PSRX(PSORXI("IRXN"),0)
43 S PSODFN=$P(PSOY,"^",2),PSONEW("PROVIDER")=$P(PSOY,"^",4),PSODRUG("IEN")=$P(PSOY,"^",6)
44 D START
45EN1X Q
Note: See TracBrowser for help on using the repository browser.