[613] | 1 | PSJRXI ;IHS/DSD/JCM/RLW-LOGS PHARMACY INTERVENTIONS ; 15 May 98 / 9:28 AM
|
---|
| 2 | ;;5.0; INPATIENT MEDICATIONS ;**3**;16 DEC 97
|
---|
| 3 | ; This routine is used to create entries in the APSP INTERVENTION file.
|
---|
| 4 | ;---------------------------------------------------------------
|
---|
| 5 | START ;
|
---|
| 6 | N SAVEX,SAVEY S SAVEX=X,SAVEY=Y
|
---|
| 7 | D INIT
|
---|
| 8 | D DIC G:PSJRXI("QFLG") END
|
---|
| 9 | D EDIT
|
---|
| 10 | S:'$D(PSJNEW("PROVIDER")) PSJNEW("PROVIDER")=$P(^APSPQA(32.4,PSJRXI("DA"),0),"^",3)
|
---|
| 11 | END D EOJ
|
---|
| 12 | Q
|
---|
| 13 | ;---------------------------------------------------------------
|
---|
| 14 | INIT ;
|
---|
| 15 | W !!,"Now creating Pharmacy Intervention",!
|
---|
| 16 | I $G(PSJDRUG("IEN")) W "For ",$P($G(^PSDRUG(PSJDRUG("IEN"),0)),"^"),!
|
---|
| 17 | K PSJRXI
|
---|
| 18 | S PSJRXI("QFLG")=0
|
---|
| 19 | Q
|
---|
| 20 | ;
|
---|
| 21 | DIC ;
|
---|
| 22 | N DIC,DR,DA,X,DD,DO,Y
|
---|
| 23 | S DIC="^APSPQA(32.4,",DLAYGO=9009032.4,DIC(0)="L",X=DT
|
---|
| 24 | S DIC("DR")=".02////"_PSGP_";.04////"_DUZ_";.05////"_PSJDD_";.06///PHARMACY"
|
---|
| 25 | ;S DIC("DR")=DIC("DR")_$S($G(PSJRX("INTERVENE"))=1:";.07////18",$G(PSJRX("INTERVENE"))=2:";.07////19",1:"")_";.14////0"_";.16////"_$S($G(PSJSITE)]"":PSJSITE,1:"")
|
---|
| 26 | S DIC("DR")=DIC("DR")_";.07"_$S($G(PSJRXREQ)=1:"////18",$G(PSJRXREQ)=2:"////19",1:"////6")_";.14////1"_";.16////"_$S($G(PSJSITE)]"":PSJSITE,1:"")
|
---|
| 27 | D FILE^DICN K DIC,DR,DA
|
---|
| 28 | I Y>0 S PSJRXI("DA")=+Y
|
---|
| 29 | E S PSJRXI("QFLG")=1 G DICX
|
---|
| 30 | D DIE
|
---|
| 31 | DICX K X,Y
|
---|
| 32 | Q
|
---|
| 33 | DIE ;
|
---|
| 34 | K DIE,DIC,DR,DA
|
---|
| 35 | S DIE="^APSPQA(32.4,",DA=PSJRXI("DA"),DR=$S($G(PSJRXI("EDIT"))]"":".03:1600",1:".03;.08")
|
---|
| 36 | ;L +^APSPQA(32.4,PSJRXI("DA")) D ^DIE K DIE,DIC,DR,X,Y,DA L -^APSPQA(32.4,PSJRXI("DA"))
|
---|
| 37 | L +^APSPQA(32.4,PSJRXI("DA")):1 E W !,"Sorry, someone else is editing this intervention!" Q
|
---|
| 38 | D ^DIE K DIE,DIC,DR,X,Y,DA L -^APSPQA(32.4,PSJRXI("DA"))
|
---|
| 39 | W $C(7),!!,"See 'Pharmacy Intervention Menu' if you want to delete this",!,"intervention or for more options.",!
|
---|
| 40 | Q
|
---|
| 41 | EDIT ;
|
---|
| 42 | 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
|
---|
| 43 | S PSJRXI("EDIT")=1 D DIE
|
---|
| 44 | G EDIT
|
---|
| 45 | EDITX K X,Y
|
---|
| 46 | Q
|
---|
| 47 | ;
|
---|
| 48 | EOJ ;
|
---|
| 49 | K PSJRXI S X=SAVEX,Y=SAVEY
|
---|
| 50 | Q
|
---|
| 51 | ;
|
---|
| 52 | EN1(PSJORDER) ; Entry Point if have internal rx #
|
---|
| 53 | I PSJX']"" W !,$C(7),"No prescription data" Q
|
---|
| 54 | S PSJORDER=$S((PSJORDER["N")!(PSJORDER["P"):"^PS(53.1,"_+PSJORDER,PSJORDER["V":"^PS(55,"_DFN_",""IV"","_+PSJORDER,1:"^PS(55,"_DFN_",5,"_+PSJORDER)_","
|
---|
| 55 | N PSJDFN,PSJNEW,PSJDRUG,PSJY
|
---|
| 56 | I $G(^PS(53.1,PSJX,0))']"" W !,$C(7),"No prescription data" G EN1X
|
---|
| 57 | S PSJRXI("IRXN")=PSJORDER
|
---|
| 58 | K PSJY S PSJY=@(PSJORDER_",0)")
|
---|
| 59 | S PSJDFN=$P(PSJY,"^",15),PSJNEW("PROVIDER")=$P(PSJY,"^",2)
|
---|
| 60 | S PSJDRUG=0,PSJDRUG=$O(^PS(53.1,PSJRXI("IRXN"),1,PSJDRUG)) Q:'PSJDRUG S PSJDRUG("IEN")=$G(@(PSJORDER_","_PSJDRUG),"^")
|
---|
| 61 | D START
|
---|
| 62 | EN1X Q
|
---|