Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSO53

PSO53.m

Go to the documentation of this file.
PSO53 ;BHM/DB - API FOR PATIENT STATUS FILE ;8 JUN 05
 ;;7.0;OUTPATIENT PHARMACY;**213,245**;DEC 1997;Build 20
PSO(PSOIEN,PSOTXT,LIST) ;
 N DA,DIQ,DR,X,I,DIC
 I $G(LIST)'="" K ^TMP($J,LIST)
 I $G(PSOIEN)="",$G(PSOTXT)="",$G(LIST)="" Q
 I $G(PSOIEN)="",$G(PSOTXT)="",$G(LIST)'="" S ^TMP($J,LIST,0)="-1^NO DATA FOUND" Q
 I $G(LIST)="" Q
 I $G(PSOIEN)'>0,$G(PSOTXT)'="" S DA=$O(^PS(53,"B",PSOTXT,0)) I DA'>0 S ^TMP($J,LIST,0)="-1^NO DATA FOUND" Q
 I $G(DA)'>0,$G(PSOIEN)>0 S DA=PSOIEN
 K ^UTILITY("DIQ1",$J),DIC S DIC=53,DR=".01;2;3;4;5;6;15;16",DIQ(0)="IE" D EN^DIQ1
 I '$D(^UTILITY("DIQ1",$J)) S ^TMP($J,LIST,PSOIEN,0)="-1^NO DATA FOUND" Q
 F X=.01,2,3,4,5,6,15,16 S ^TMP($J,LIST,DA,X)=^UTILITY("DIQ1",$J,53,DA,X,"I")
 S PSOTXT=$G(^UTILITY("DIQ1",$J,53,DA,.01,"E"))
 F X=5,6,15,16 S ^TMP($J,LIST,DA,X)=$S(^UTILITY("DIQ1",$J,53,DA,X,"E")'="":^TMP($J,LIST,DA,X)_"^"_^UTILITY("DIQ1",$J,53,DA,X,"E"),1:"")
 K ^UTILITY("DIQ1",$J) S ^TMP($J,LIST,"B",PSOTXT,DA)="",^TMP($J,LIST,DA,0)=$G(^TMP($J,LIST,DA,0))+1
 K DA,DIC,DIQ,DA,DR,X Q