source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJ53P1.m@ 703

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

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1PSJ53P1 ;BIR/DB - API FOR INFORMATION FROM FILE 53.1; 5 Sep 03
2 ;;5.0; INPATIENT MEDICATIONS ;**172**;16 DEC 97;Build 13
3PSJ(PSJIEN,LIST) ;
4 ;PSJIEN - INTERNAL ENTRY NUMBER [REQUIRED]
5 ;LIST: Subscript name used in ^TMP global [REQUIRED]
6 I $G(PSJIEN)="" Q
7 I $G(LIST)="" Q
8 K ^TMP($J,LIST),DA,^UTILITY("DIQ1",$J),DIQ
9 I $G(PSJIEN)]"" S DA=PSJIEN I '$D(^PS(53.1,DA,0)) G RET0
10 K ^UTILITY("DIQ1",$J),DIC S DIC=53.1,DR=".01;1;3;7;10;25;26;28;108;109",DIQ(0)="IE" D EN^DIQ1
11 I '$D(^UTILITY("DIQ1",$J)) G RET0
12 S ^TMP($J,LIST,0)=1,PSJDA=DA
13 S PSJTXT=^UTILITY("DIQ1",$J,53.1,DA,.01,"E")
14 F X=.01,1,3,7,10,26,28,25,108,109 S ^TMP($J,LIST,DA,X)=$G(^UTILITY("DIQ1",$J,53.1,DA,X,"I"))
15 F X=1,3,7,10,28,25,108 S ^TMP($J,LIST,DA,X)=$S($G(^UTILITY("DIQ1",$J,53.1,DA,X,"E"))'="":^TMP($J,LIST,DA,X)_"^"_$G(^UTILITY("DIQ1",$J,53.1,DA,X,"E")),1:"")
16 S ^TMP($J,LIST,"B",PSJTXT,DA)=""
17 S PSJDRG=0 F S PSJDRG=$O(^PS(53.1,PSJDA,1,PSJDRG)) Q:PSJDRG'>0 D
18 .S DA=PSJDA,DIC=53.1,DR=2,DR(53.11)=".01;.02",DIQ(0)="IE",DA(53.11)=PSJDRG D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J))
19 .S ^TMP($J,LIST,PSJDA,"DDRUG",PSJDRG,.01)=$G(^UTILITY("DIQ1",$J,53.11,PSJDRG,.01,"I"))
20 .S ^TMP($J,LIST,PSJDA,"DDRUG",PSJDRG,.02)=$G(^UTILITY("DIQ1",$J,53.11,PSJDRG,.02,"I"))
21 .S ^TMP($J,LIST,PSJDA,"DDRUG",PSJDRG,.01)=$S($G(^UTILITY("DIQ1",$J,53.11,PSJDRG,.01,"E"))'="":^TMP($J,LIST,PSJDA,"DDRUG",PSJDRG,.01)_"^"_$G(^UTILITY("DIQ1",$J,53.11,PSJDRG,.01,"E")),1:"")
22 .S ^TMP($J,LIST,PSJDA,"DDRUG",0)=$G(^TMP($J,LIST,PSJDA,"DDRUG",0))+1
23 I '$D(^TMP($J,LIST,PSJDA,"DDRUG",0)) S ^TMP($J,LIST,PSJDA,"DDRUG",0)="-1^NO DATA FOUND"
24 K PSJIEN,DA,X,PSJTXT,DR,DIC,^UTILITY("DIQ1",$J),DIQ,PSJDA,PSJDRG
25 Q
26RET0 ;return no data
27 K PSJIEN,PSJTXT S ^TMP($J,LIST,0)="-1^NO DATA FOUND" Q
Note: See TracBrowser for help on using the repository browser.