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

APCLUTL.m

Go to the documentation of this file.
  1. APCLUTL ; IHS/CMI/LAB - Area Database Utility Routine ;
  1. ;;2.0;IHS PCC SUITE;**6**;MAY 14, 2009;Build 11
  1. ;
  1. DEMO(P,T) ;EP - called to exclude demo patients
  1. I $G(P)="" Q 0
  1. I $G(T)="" S T="I"
  1. I T="I" Q 0
  1. NEW R
  1. S R=""
  1. I T="E" D Q R
  1. .I $P($G(^DPT(P,0)),U)["DEMO,PATIENT" S R=1 Q
  1. .NEW %
  1. .S %=$O(^DIBT("B","RPMS DEMO PATIENT NAMES",0))
  1. .I '% S R=0 Q
  1. .I $D(^DIBT(%,1,P)) S R=1 Q
  1. I T="O" D Q R
  1. .I $P($G(^DPT(P,0)),U)["DEMO,PATIENT" S R=0 Q
  1. .NEW %
  1. .S %=$O(^DIBT("B","RPMS DEMO PATIENT NAMES",0))
  1. .I '% S R=1 Q
  1. .I $D(^DIBT(%,1,P)) S R=0 Q
  1. .S R=1 Q
  1. Q 0
  1. ;
  1. RZERO(V,L) ;ep right zero fill
  1. NEW %,I
  1. S %=$L(V),Z=L-% F I=1:1:Z S V=V_"0"
  1. Q V
  1. LZERO(V,L) ;EP - left zero fill
  1. NEW %,I
  1. S %=$L(V),Z=L-% F I=1:1:Z S V="0"_V
  1. Q V
  1. LBLK(V,L) ;EP - left blank fill
  1. NEW %,I
  1. S %=$L(V),Z=L-% F I=1:1:Z S V=" "_V
  1. Q V
  1. RBLK(V,L) ;EP right blank fill
  1. NEW %,I
  1. S %=$L(V),Z=L-% F I=1:1:Z S V=V_" "
  1. Q V
  1. ;
  1. DEMOCHK(R) ;EP - check demo pat
  1. NEW DIR,DA
  1. S R=-1
  1. S DIR(0)="S^I:Include ALL Patients;E:Exclude DEMO Patients;O:Include ONLY DEMO Patients",DIR("A")="Demo Patient Inclusion/Exclusion",DIR("B")="E"
  1. KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) S R=-1 Q
  1. S R=Y
  1. Q