source: FOIAVistA/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSO5241.m@ 1611

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1PSO5241 ;BHAM ISC/SAB- encap II API to return pending Rx data ; 04/07/05 10:30 am
2 ;;7.0;OUTPATIENT PHARMACY;**213**;DEC 1997
3 ;^PSDRUG supported by DBIA 221
4 ;^PS(50.7 supported by DBIA 2223
5 ;
6PEN(DFN,LIST,IEN,PLACER) ;
7 ;
8 ;DFN: Patient's IEN
9 ;LIST: Subscript name used in ^TMP global [REQUIRED]
10 ;IEN: Internal record number [optional]
11 ;PLACER: Pointer to Orders file (#100) [optional]
12 ;
13 Q:$G(DFN)']"" Q:$G(LIST)=""
14 N DA,DR,PSOPOST,DIC,DIQ,ND,LK K ^TMP($J,LIST)
15 S ^TMP($J,LIST,DFN,0)=0
16 I $G(IEN) D PROCESS G CLEAN
17 I $G(PLACER)]"",'$G(IEN) S IEN=$O(^PS(52.41,"B",PLACER,0)) D G CLEAN
18 .I 'IEN S ^TMP($J,LIST,DFN,0)="-1^NO DATA FOUND" Q
19 .D PROCESS
20 F IEN=0:0 S IEN=$O(^PS(52.41,"P",DFN,IEN)) Q:'IEN D PROCESS
21CLEAN I ^TMP($J,LIST,DFN,0)=0 S ^TMP($J,LIST,DFN,0)="-1^NO DATA FOUND"
22 K DA,DR,DIC,PSOPOST,DIQ
23 Q
24PROCESS ;
25 Q:$P($G(^PS(52.41,IEN,0)),"^",3)="DC" Q:$P($G(^PS(52.41,IEN,0)),"^",3)="DE"
26 I DFN'=$P($G(^PS(52.41,IEN,0)),"^",2) S ^TMP($J,LIST,IEN,0)="-1^NO DATA FOUND (MISMATCHED PATIENT)" Q
27 I $G(^PS(52.41,IEN,0))']"" S ^TMP($J,LIST,DFN,IEN,0)="-1^NO DATA FOUND" Q
28 K PSOPOST S DIC=52.41,DA=IEN,DR=".01;2;8;9;11",DIQ="PSOPOST",DIQ(0)="IE" D EN^DIQ1
29 F DR=.01,2,8 D I DR=8 D OI
30 .I DR=.01 S ^TMP($J,LIST,DFN,"B",PSOPOST(52.41,DA,DR,"I"),IEN)=""
31 .I PSOPOST(52.41,DA,DR,"E")'=PSOPOST(52.41,DA,DR,"I") S ^TMP($J,LIST,DFN,IEN,DR)=PSOPOST(52.41,DA,DR,"I")_"^"_PSOPOST(52.41,DA,DR,"E") Q
32 .S ^TMP($J,LIST,DFN,IEN,DR)=PSOPOST(52.41,DA,DR,"I")
33 S DR=11 D
34 .I PSOPOST(52.41,IEN,DR,"E")'=PSOPOST(52.41,IEN,DR,"I") S ^TMP($J,LIST,DFN,IEN,DR)=PSOPOST(52.41,IEN,DR,"I")_"^"_PSOPOST(52.41,IEN,DR,"E") Q
35 .S ^TMP($J,LIST,DFN,IEN,DR)=PSOPOST(52.41,IEN,DR,"I")
36 S ^TMP($J,LIST,DFN,0)=^TMP($J,LIST,DFN,0)+1
37 K DA,DR,PSOPOST,DIC,DIQ
38 Q
39OI ;orderable item
40 S DIC=50.7,DA=PSOPOST(52.41,DA,DR,"I"),DR=.02,DIQ(0)="IE" D EN^DIQ1
41 S ^TMP($J,LIST,DFN,IEN,8)=^TMP($J,LIST,DFN,IEN,8)_"^"_PSOPOST(50.7,DA,DR,"I")_"^"_PSOPOST(50.7,DA,DR,"E")
42 Q
Note: See TracBrowser for help on using the repository browser.