source: FOIAVistA/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJXRFK.m@ 1354

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

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1PSJXRFK ; SLC/PKR - Routines for killing indexes. ;24 Sep 03 / 1:17 PM
2 ;;5.0;INPATIENT MEDICATIONS;**90**;16 DEC 97
3 ;
4 ;Reference to ^PS(52.6 is supported by DBIA# 1231.
5 ;Reference to ^PS(55 is supported by DBIA# 2191.
6 ;Reference to ^PS(52.7 is supported by DBIA# 2173.
7 ;Reference to ^PXRMINDX(55 is supported by DBIA# 4114.
8 Q
9 ;
10KPSPA(X,DA,NODE) ;Delete index for Pharmacy Patient File.
11 N ADD,DAS,DFN,DRUG,IND,SOL
12 S DFN=DA(1)
13 I NODE="UD" D Q
14 . S IND=0
15 . F S IND=+$O(^PS(55,DA(1),5,DA,1,IND)) Q:IND=0 D
16 .. S DRUG=$P(^PS(55,DA(1),5,DA,1,IND,0),U,1)
17 .. S DAS=DA(1)_";5;"_DA_";1;"_IND_";0"
18 .. K ^PXRMINDX(55,"IP",DRUG,DFN,X(1),X(2),DAS)
19 .. K ^PXRMINDX(55,"PI",DFN,DRUG,X(1),X(2),DAS)
20 I NODE="IV" D
21 .;Process additives.
22 . S IND=0
23 . F S IND=+$O(^PS(55,DA(1),"IV",DA,"AD",IND)) Q:IND=0 D
24 .. S ADD=$P(^PS(55,DA(1),"IV",DA,"AD",IND,0),U,1)
25 .. S DRUG=$P($G(^PS(52.6,ADD,0)),U,2)
26 .. I DRUG="" Q
27 .. S DAS=DA(1)_";IV;"_DA_";AD;"_IND_";0"
28 .. K ^PXRMINDX(55,"IP",DRUG,DFN,X(1),X(2),DAS)
29 .. K ^PXRMINDX(55,"PI",DFN,DRUG,X(1),X(2),DAS)
30 . S IND=0
31 . F S IND=+$O(^PS(55,DA(1),"IV",DA,"SOL",IND)) Q:IND=0 D
32 .. S SOL=$P(^PS(55,DA(1),"IV",DA,"SOL",IND,0),U,1)
33 .. S DRUG=$P($G(^PS(52.7,SOL,0)),U,2)
34 .. I DRUG="" Q
35 .. S DAS=DA(1)_";IV;"_DA_";SOL;"_IND_";0"
36 .. K ^PXRMINDX(55,"IP",DRUG,DFN,X(1),X(2),DAS)
37 .. K ^PXRMINDX(55,"PI",DFN,DRUG,X(1),X(2),DAS)
38 Q
Note: See TracBrowser for help on using the repository browser.