source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOPXRMU.m@ 1578

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

initial load of WorldVistAEHR

File size: 1.7 KB
RevLine 
[613]1PSOPXRMU ;BHM/MFR - Set/Kill of Clinical Reminders Index;07/12/2004
2 ;;7.0;OUTPATIENT PHARMACY;**118**;DEC 1997
3 ;Reference to ^PXRMINDX supported by DBIA 4114
4 ;
5SKIDX(X,DA,NODE,CMD) ;Set/Kill Clinical Reminder Index
6 ;Input: X(1) - DAYS SUPPLY, X(2)=RELEASED DATE/TIME
7 ; DA - PRESCRIPTION file IEN
8 ; NODE - "O":Original; "R":Refill; "P":Partial
9 ; CMD - "S":Set; "K": Kill
10 ;
11 N D0,DAS,DATE,DFN,DRUG,Z
12 S D0=$S(NODE="O":DA,1:DA(1))
13 S Z=$G(^PSRX(D0,0)),DFN=$P(Z,U,2),DRUG=$P(Z,U,6)
14 I DFN=""!(DRUG="") Q
15 S DATE=+$$FMADD^XLFDT(X(2),X(1))
16 S DAS=DA_";2"
17 S:NODE="R" DAS=DA(1)_";1;"_DA_";0"
18 S:NODE="P" DAS=DA(1)_";P;"_DA_";0"
19 ;
20 I CMD="S" D
21 . S ^PXRMINDX(52,"IP",DRUG,DFN,X(2),DATE,DAS)=""
22 . S ^PXRMINDX(52,"PI",DFN,DRUG,X(2),DATE,DAS)=""
23 I CMD="K" D
24 . K ^PXRMINDX(52,"IP",DRUG,DFN,X(2),DATE,DAS)
25 . K ^PXRMINDX(52,"PI",DFN,DRUG,X(2),DATE,DAS)
26 Q
27 ;
28 ;=============================================
29KNVA(X,DA) ;Delete index for NVA node.
30 N DAS,START,STOP
31 ;Reference to ^PXRMINDX("55NVA" is supported by DBIA# 4114.
32 S START=$S(X(3)'="":X(3),1:X(2))
33 S STOP=$S(X(4)'="":X(4),1:"U"_DA(1))
34 S DAS=DA(1)_";NVA;"_DA_";0"
35 K ^PXRMINDX("55NVA","IP",X(1),DA(1),START,STOP,DAS)
36 K ^PXRMINDX("55NVA","PI",DA(1),X(1),START,STOP,DAS)
37 Q
38 ;
39 ;=============================================
40SNVA(X,DA) ;Set index for NVA node
41 ;X(1)=PHARMACY ORDERABLE ITEM,X(2)=DOCUMENTED DATE,
42 ;X(3)=START DATE (optional), X(4)=DISCONTINUED DATE (optional)
43 ;Reference to ^PXRMINDX(55 is supported by DBIA# 4114.
44 N DAS,START,STOP
45 S START=$S(X(3)'="":X(3),1:X(2))
46 S STOP=$S(X(4)'="":X(4),1:"U"_DA(1))
47 S DAS=DA(1)_";NVA;"_DA_";0"
48 S ^PXRMINDX("55NVA","IP",X(1),DA(1),START,STOP,DAS)=""
49 S ^PXRMINDX("55NVA","PI",DA(1),X(1),START,STOP,DAS)=""
50 Q
51 ;
Note: See TracBrowser for help on using the repository browser.