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

APSPPT.m

Go to the documentation of this file.
APSPPT ; IHS/DSD/ENM - FIX PHARMACY PATIENT FILE ;  [ 09/03/97   1:30 PM ]
 ;;6.0;IHS PHARMACY MODIFICATIONS;;09/03/97
 ;
START ;
 F APSPPT("PAT")=0:0 S APSPPT("PAT")=$O(^PS(55,APSPPT("PAT"))) Q:'APSPPT("PAT")  D PT
END D EOJ
 Q
 ;---------------------------------------------------------------------
PT ;
 F APSPPTI=0:0 S APSPPTI=$O(^PS(55,APSPPT("PAT"),"P",APSPPTI)) Q:'APSPPTI  D CHECK
 K APSPPTI
 Q
 ;
CHECK ;
 F APSPPT("IRXN")=21788,21789,21790,21791,21792,21793 I ^PS(55,APSPPT("PAT"),"P",APSPPTI,0)=APSPPT("IRXN") D DELETE
 K APSPPT("IRXN")
 Q
DELETE ;
 W !,$P(^DPT(APSPPT("PAT"),0),U,1)_"    "_APSPPT("IRXN")
 S ^PS(55,APSPPT("PAT"),"P",0)=$P(^PS(55,APSPPT("PAT"),"P",0),U,1,3)_U_($P(^(0),U,4)-1)
 K ^PS(55,APSPPT("PAT"),"P",APSPPTI)
 F %=0:0 S %=$O(^PS(55,APSPPT("PAT"),"P","A",%)) Q:'%  I $D(^(%,APSPPT("IRXN"))) K ^(APSPPT("IRXN"))
 K:$D(^PS(55,APSPPT("PAT"),"P","CP",APSPPT("IRXN"))) ^(APSPPT("IRXN"))
 Q
 ;
EOJ ;
 K APSPPT,%
 Q