1 | PSOHLSG5 ;BIR/SJA,PWC-Logical Links derive ;08/13/01 13:46
|
---|
2 | ;;7.0;OUTPATIENT PHARMACY;**70,156**;DEC 1997
|
---|
3 | ;Reference to ^SC( is supported by DBIA #10040
|
---|
4 | ;Reference to ^DG(40.8 is supported by DBIA #1576
|
---|
5 | ;Reference to ^HLCS(870 is supported by DBIA #1496
|
---|
6 | ;
|
---|
7 | STRT N PSONODE,PSOLL,INPTRX,NN,PSOCOI,II,CLIN,PSOS,PSRX,PXIEN,PSODISP
|
---|
8 | S II=0 F S II=$O(^UTILITY($J,"PSOHLL",II)) Q:'II S PSONODE=$G(^(II)) D
|
---|
9 | .S PXIEN=$P(PSONODE,"^"),CLIN=$P($G(^PSRX(PXIEN,0)),"^",5)
|
---|
10 | .S PSODISP=$$GET1^DIQ(59,PSOSITE_",",105,"I")
|
---|
11 | .I CLIN D OI
|
---|
12 | .I 'CLIN!($G(PSOLL)="") D LL2
|
---|
13 | .I $G(PSOLL)="" S PSOLL="PSO LLP1"
|
---|
14 | .I $G(PSODISP)=2.4 S PSOLL="PSO DISP" ;dispensing machine using V.2.4
|
---|
15 | .S $P(^UTILITY($J,"PSOHLL",II),"^",11)=CLIN_"^"_PSOLL
|
---|
16 | Q
|
---|
17 | OI S PSOCOI="" S:'$D(^SC(CLIN,0)) CLIN=""
|
---|
18 | S INPTRX=0 I $G(CLIN) S PSOCOI=$P($G(^SC(CLIN,0)),"^",4)
|
---|
19 | I '$G(PSOCOI) D
|
---|
20 | .I $G(CLIN) S INPTRX=$P($G(^SC(CLIN,0)),"^",15)
|
---|
21 | .I '$G(INPTRX) S INPTRX=$O(^DG(40.8,0))
|
---|
22 | .I '$G(DT) S DT=$$DT^XLFDT
|
---|
23 | .S PSOCOI=+$$SITE^VASITE(DT,INPTRX)
|
---|
24 | LL1 S NN=0 F S NN=$O(^PS(59,PSOSITE,"INI1",NN)) Q:'NN!($G(PSOLL)) S PSOS=$G(^(NN,0)) I $P(PSOS,"^")=PSOCOI S PSOLL=$$GET1^DIQ(870,+$P(PSOS,"^",2),.01)
|
---|
25 | Q
|
---|
26 | LL2 ;Derive the LOCICAL LINK from the top level LL field.
|
---|
27 | S PSOLL=$P($G(^PS(59,PSOSITE,8)),"^",4),PSOLL=$$GET1^DIQ(870,+PSOLL,.01)
|
---|
28 | Q
|
---|