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

BPCAPPT.m

Go to the documentation of this file.
  1. BPCAPPT ; IHS/OIT/MJL - GUI APPT LIST ;
  1. ;;1.5;BPC;;MAY 26, 2005
  1. ;MODIFIED FOR IHS GUI CHART FJE 5/1/00 FROM BPC2D RTN
  1. ;
  1. GETAPPT(BGUARRAY,BPCPIEN,BPCSDATE,BPCEDATE) ;EP REMOTE PROC: BPC GET SD APPT DATA
  1. D ENA,KILL Q
  1. ;
  1. ENA ;
  1. ;S BPCPIEN=25241,BPCSDATE="06/11/00",BPCEDATE="06/11/01"
  1. D ^XBKVAR
  1. S BPCCVD="S:Y]"""" Y=+Y,Y=$E(Y,4,5)_""/""_$S($E(Y,6,7):$E(Y,6,7)_""/"",1:"""")_$E(Y,2,3)"
  1. S BPCGUI=1,X="",XWBWRAP=1 K ^TMP($J)
  1. S BGUARRAY="^TMP("_$J_")"
  1. I $G(BPCPIEN)="" S ^TMP($J,1)=-1,^TMP($J,2)="PATIENT IEN NOT SENT!" Q
  1. I $G(BPCSDATE)="" S ^TMP($J,1)=-1,^TMP($J,2)="STARTING DATE NOT SENT!" Q
  1. I $G(BPCEDATE)="" S ^TMP($J,1)=-1,^TMP($J,2)="ENDING DATE NOT SENT!" Q
  1. S CNTR=2
  1. S BPCPAT=BPCPIEN
  1. S:BPCEDATE="" BPCEDATE="T"
  1. D DT^DILF("",BPCSDATE,.BPCSDAT)
  1. I BPCSDAT=-1 D
  1. .S BPCSDATE="1/1/1980"
  1. .D DT^DILF("",BPCSDATE,.BPCSDAT)
  1. D DT^DILF("",BPCEDATE,.BPCEDAT)
  1. I BPCEDAT=-1 D
  1. .S BPCEDATE="T"
  1. .D DT^DILF("",BPCEDATE,.BPCEDAT)
  1. I '$D(^DPT(BPCPAT,"S")) S ^TMP($J,1)=1,^TMP($J,2)="No Appointment Data Available" Q
  1. D:$O(^DPT(BPCPAT,"S",DT)) PEND
  1. D:$O(^DPT(BPCPAT,"S",0)) PAST
  1. I CNTR=2 S ^TMP($J,1)=1,^TMP($J,2)="No Data Available" Q
  1. S ^TMP($J,1)=CNTR-2
  1. Q
  1. ;
  1. PAST ;
  1. S BPCN=0 F S BPCN=$O(^DPT(BPCPAT,"S",BPCN)) Q:'BPCN D
  1. .Q:BPCN<BPCSDAT
  1. .Q:BPCN>(DT-.01)
  1. .Q:BPCN>(BPCEDAT+.24)
  1. .S BPC(9999999-BPCN)=""
  1. S BPCIDT=0,BPCIDT=$O(BPC(BPCIDT)) I BPCIDT S ^TMP($J,CNTR)="Past:",CNTR=CNTR+1
  1. S BPCIDT=0 F S BPCIDT=$O(BPC(BPCIDT)) Q:'BPCIDT D
  1. .S BPCVDT=9999999-BPCIDT
  1. .S BPCN=^DPT(BPCPAT,"S",BPCVDT,0)
  1. .S Y=BPCVDT\1 X BPCCVD S BPCDAT=Y
  1. .S BPCVT=$E($P(BPCVDT,".",2)_"000",1,4) S:BPCVT>1300 BPCVT=BPCVT-1200 S:$L(BPCVT)=3 BPCVT=" "_BPCVT S:$E(BPCVT)="0" BPCVT=" "_$E(BPCVT,2,4) S BPCVT=$E(BPCVT,1,2)_":"_$E(BPCVT,3,4)
  1. .S BPCTST="" F BPCI=3,4,5 S BPCJ=$P(BPCN,U,BPCI) I BPCJ S:BPCTST]"" BPCTST=BPCTST_"," S BPCTST=BPCTST_$P("^^LAB^XRAY^EKG^",U,BPCI)
  1. .S BPCCP=+BPCN,BPCCN=$P($G(^SC(BPCCP,0)),U,1)
  1. .S BPCTST="",BPCVNT=""
  1. .S BPCVN=0 F BPCQ=0:0 S BPCVN=$O(^SC(BPCCP,"S",BPCVDT,1,BPCVN)) Q:'BPCVN I +^(BPCVN,0)=BPCPAT S BPCTST=$P(^(0),U,2),BPCVNT=$P(^(0),U,4) S:BPCTST BPCTST=BPCTST_" min."
  1. .F BPCI=3,4,5 S BPCJ=$P(BPCN,U,BPCI) I BPCJ S:BPCTST]"" BPCTST=BPCTST_"," S BPCTST=BPCTST_$P("^^LAB^XRAY^EKG^",U,BPCI)
  1. .S ^TMP($J,CNTR)=BPCDAT_"^"_BPCVT_"^"_BPCCN S:BPCTST]"" BPCTST="<"_BPCTST_">" S ^TMP($J,CNTR)=^TMP($J,CNTR)_"^"_BPCTST
  1. .S ^TMP($J,CNTR)=^TMP($J,CNTR)_"^"_BPCVNT
  1. .S CNTR=CNTR+1
  1. Q
  1. ;
  1. PEND ;
  1. S CNTR=CNTR+1,^TMP($J,CNTR)="Pending:",CNTR=CNTR+1
  1. S BPCDAT=0,BPCVDT=DT-.01 F BPCQ=0:0 S BPCVDT=$O(^DPT(BPCPAT,"S",BPCVDT)) Q:'BPCVDT D
  1. .S BPCN=^DPT(BPCPAT,"S",BPCVDT,0)
  1. .S Y=BPCVDT\1 X BPCCVD S BPCDAT=Y
  1. .S BPCVT=$E($P(BPCVDT,".",2)_"000",1,4) S:BPCVT>1300 BPCVT=BPCVT-1200 S:$L(BPCVT)=3 BPCVT=" "_BPCVT S:$E(BPCVT)="0" BPCVT=" "_$E(BPCVT,2,4) S BPCVT=$E(BPCVT,1,2)_":"_$E(BPCVT,3,4)
  1. .S BPCTST="" F BPCI=3,4,5 S BPCJ=$P(BPCN,U,BPCI) I BPCJ S:BPCTST]"" BPCTST=BPCTST_"," S BPCTST=BPCTST_$P("^^LAB^XRAY^EKG^",U,BPCI)
  1. .S BPCCP=+BPCN,BPCCN=$P($G(^SC(BPCCP,0)),U,1)
  1. .S BPCTST="",BPCVNT=""
  1. .S BPCVN=0 F BPCQ=0:0 S BPCVN=$O(^SC(BPCCP,"S",BPCVDT,1,BPCVN)) Q:'BPCVN I +^(BPCVN,0)=BPCPAT S BPCTST=$P(^(0),U,2),BPCVNT=$P(^(0),U,4) S:BPCTST BPCTST=BPCTST_" min."
  1. .F BPCI=3,4,5 S BPCJ=$P(BPCN,U,BPCI) I BPCJ S:BPCTST]"" BPCTST=BPCTST_"," S BPCTST=BPCTST_$P("^^LAB^XRAY^EKG^",U,BPCI)
  1. .S ^TMP($J,CNTR)=BPCDAT_"^"_BPCVT_"^"_BPCCN S:BPCTST]"" BPCTST="<"_BPCTST_">" S ^TMP($J,CNTR)=^TMP($J,CNTR)_"^"_BPCTST
  1. .S ^TMP($J,CNTR)=^TMP($J,CNTR)_"^"_BPCVNT
  1. .S CNTR=CNTR+1
  1. Q
  1. KILL ;
  1. K BPC,BPCCN,BPCCP,BPCCVD,BPCDAT,BPCEDATE,BPCGUI,BPCIDT,BPCJ,BPCN,BPCPAT,BPCSDATE,BPCTST,BPCVDT,BPCVN,BPCVNT,BPCVT,CNTR,X,Y
  1. Q