source: FOIAVistA/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOHLSG5.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1PSOHLSG5 ;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 ;
7STRT 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
17OI 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)
24LL1 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
26LL2 ;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
Note: See TracBrowser for help on using the repository browser.