source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJXRFS.m@ 776

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

initial load of WorldVistAEHR

File size: 1.5 KB
Line 
1PSJXRFS ; SLC/PKR - Routines for setting 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 ;
10SPSPA(X,DA,NODE) ;Set index for Pharmacy Patient File.
11 ;X(1)=START DATE/TIME;X(2)=STOP DATE/TIME
12 ;The possible values for NODE are "IV" and "UD".
13 N ADD,DAS,DFN,DRUG,IND,SOL
14 S DFN=DA(1)
15 ;Process UNIT DOSE entries.
16 I NODE="UD" D Q
17 . S IND=0
18 . F S IND=+$O(^PS(55,DA(1),5,DA,1,IND)) Q:IND=0 D
19 .. S DRUG=$P(^PS(55,DA(1),5,DA,1,IND,0),U,1)
20 .. S DAS=DA(1)_";5;"_DA_";1;"_IND_";0"
21 .. S ^PXRMINDX(55,"IP",DRUG,DFN,X(1),X(2),DAS)=""
22 .. S ^PXRMINDX(55,"PI",DFN,DRUG,X(1),X(2),DAS)=""
23 ;Process IV node entries.
24 I NODE="IV" D
25 .;Process additives.
26 . S IND=0
27 . F S IND=+$O(^PS(55,DA(1),"IV",DA,"AD",IND)) Q:IND=0 D
28 .. S ADD=$P(^PS(55,DA(1),"IV",DA,"AD",IND,0),U,1)
29 .. S DRUG=$P($G(^PS(52.6,ADD,0)),U,2)
30 .. I DRUG="" Q
31 .. S DAS=DA(1)_";IV;"_DA_";AD;"_IND_";0"
32 .. S ^PXRMINDX(55,"IP",DRUG,DFN,X(1),X(2),DAS)=""
33 .. S ^PXRMINDX(55,"PI",DFN,DRUG,X(1),X(2),DAS)=""
34 .;Process solutions.
35 . S IND=0
36 . F S IND=+$O(^PS(55,DA(1),"IV",DA,"SOL",IND)) Q:IND=0 D
37 .. S SOL=$P(^PS(55,DA(1),"IV",DA,"SOL",IND,0),U,1)
38 .. S DRUG=$P($G(^PS(52.7,SOL,0)),U,2)
39 .. I DRUG="" Q
40 .. S DAS=DA(1)_";IV;"_DA_";SOL;"_IND_";0"
41 .. S ^PXRMINDX(55,"IP",DRUG,DFN,X(1),X(2),DAS)=""
42 .. S ^PXRMINDX(55,"PI",DFN,DRUG,X(1),X(2),DAS)=""
43 Q
Note: See TracBrowser for help on using the repository browser.