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

APCDEWHA.m

Go to the documentation of this file.
  1. APCDEWHA ; IHS/CMI/LAB - DISPLAY PATIENT & VISIT INFO ;
  1. ;;2.0;IHS PCC SUITE;**22**;MAY 14, 2009;Build 6
  1. ;CALLED FROM THE TEMPLATE APCD WHAT (WHA)
  1. START ;EP
  1. K APCDVREC
  1. S:$D(APCDVDSP) APCDVREC=^AUPNVSIT(APCDVDSP,0)
  1. W !!,"You are currently processing the following Patient",$S($D(APCDVDSP):" Visit",1:""),":",!!
  1. S APCDH="Patient Name",APCDV=$E($P(^DPT(AUPNPAT,0),U),1,20) D WRITE
  1. S APCDH="Chart #",APCDV=$S($D(^AUPNPAT(AUPNPAT,41,DUZ(2),0)):$P(^(0),U,2),1:"None") D WRITE
  1. S APCDH="Date of Birth" S Y=AUPNDOB D DD^%DT S APCDV=Y D WRITE
  1. S APCDH="Sex",APCDV=AUPNSEX D WRITE
  1. G:'$D(APCDVREC) XIT
  1. S APCDH="Visit Date" S Y=$P(APCDVREC,U) D DD^%DT S APCDV=Y D WRITE
  1. S APCDH="Location",APCDV=$E($P(^DIC(4,$P(APCDVREC,U,6),0),U),1,25) D WRITE
  1. S APCDH="Type",APCDV=$P(APCDVREC,U,3) D WRITE
  1. S APCDH="Service Category",APCDV=$P(APCDVREC,U,7) D WRITE
  1. S APCDH="Clinic",APCDV=$S($P(APCDVREC,U,8)="":"None Entered",1:$P(^DIC(40.7,$P(APCDVREC,U,8),0),U)) D WRITE
  1. S APCDH="Hospital Location",APCDV=$$VAL^XBDIQ1(9000010,APCDVDSP,.22)
  1. I $P(^AUPNVSIT(APCDVDSP,0),U,34)]"" S APCDH="DRG",APCDV=$$VAL^XBDIQ1(9000010,APCDVDSP,.34) D WRITE
  1. I $P(^AUPNVSIT(APCDVDSP,0),U,35)]"" S APCDH="HCFA WT",APCDV=$$VAL^XBDIQ1(9000010,APCDVDSP,.35) D WRITE
  1. I $P($G(^AUPNVSIT(APCDVDSP,12)),U,11)]"" S APCDH="Ext Acct #",APCDV=$P($G(^AUPNVSIT(APCDVDSP,12)),U,11) D WRITE
  1. I $P($G(^AUPNVSIT(APCDVDSP,11)),U,3)]"" S APCDH="VCN",APCDV=$P($G(^AUPNVSIT(APCDVDSP,11)),U,3) D WRITE
  1. I $G(^AUPNVSIT(APCDVDSP,21))]"" S APCDV=$P(^AUPNVSIT(APCDVDSP,21),U),APCDH="Outside Location" W ! D WRITE
  1. I $P(APCDVREC,U,9) D DSPLY
  1. ;
  1. XIT ; XIT CLEANUP
  1. K APCDVDFN,APCDVDG,APCDVDSH,APCDVFLE,APCDVI,APCDVIGR,APCDVL,APCDVNM,X,Y,APCDVREC,APCDV,APCDH,APCDZ,APCDX,APCDY,APCDT
  1. Q
  1. DSPLY ;
  1. NEW DA,D0,DIC,DIQ,DR,DI
  1. S APCDVFLE=9000010 F APCDVL=0:0 S APCDVFLE=$O(^DIC(APCDVFLE)) Q:APCDVFLE>9000010.99!(APCDVFLE'=+APCDVFLE) D DSPLY2
  1. D XIT
  1. Q
  1. ;
  1. DSPLY2 ;
  1. S APCDVNM=$P(^DIC(APCDVFLE,0),U),APCDVDG=^DIC(APCDVFLE,0,"GL"),APCDVIGR=APCDVDG_"""AD"",APCDVDSP,APCDVDFN)",APCDVDFN=""
  1. F APCDVI=1:1 S APCDVDFN=$O(@APCDVIGR) Q:APCDVDFN="" D DSPLY3
  1. Q
  1. ;
  1. DSPLY3 ;
  1. I APCDVFLE=9000010.01 Q:$P($G(^AUPNVMSR(APCDVDFN,2)),U,1) ;measurements entered in error
  1. I APCDVFLE=9000010.54 Q:$P($G(^AUPNVRUP(APCDVDFN,2)),U,1) ;V updated/reviewed entered in error
  1. I APCDVFLE=9000010.62 Q:$P($G(^AUPNVAMI(APCDVDFN,5)),U,1) ;V AMI entered in error
  1. I APCDVFLE=9000010.63 Q:$P($G(^AUPNVSTR(APCDVDFN,5)),U,1) ;V STROKE entered in error
  1. I APCDVFLE=9000010.51 Q:$P($G(^AUPNVACG(APCDVDFN,1)),U,1) ;V ANTICOAG entered in error
  1. I APCDVFLE=9000010.58 Q:$P($G(^AUPNVVI(APCDVDFN,0)),U,6) ;V VISIT INSTRUCTIONS entered in error
  1. I APCDVFLE=9000010.43 Q:$P($G(^AUPNVOB(APCDVDFN,0)),U,6) ;V OB entered in error
  1. I APCDVFLE=9000010.64 Q:$P($G(^AUPNVDLV(APCDVDFN,5)),U,1) ;V DELIVERY entered in error PATCH 22
  1. I APCDVI<2 S APCDX=20-$L($P(APCDVNM,"V ",2)_"'s"),APCDY=APCDX\2,APCDZ=APCDX-APCDY W !!,"==============",$J("",APCDZ),$P(APCDVNM,"V ",2)_"'s",$J("",APCDY),"=============="
  1. I APCDVI>1 W !
  1. K ^UTILITY("DIQ1",$J)
  1. I APCDVFLE'=9000010.09 S DIC=APCDVDG,DR=".01;.04:99999",(DA,D0)=APCDVDFN D EN^DIQ1 ;IHS/CMI/LAB
  1. I APCDVFLE=9000010.09 S DIC=APCDVDG,DR=".01;.04;1202",(DA,D0)=APCDVDFN D EN^DIQ1 ;IHS/CMI/LAB
  1. D DSPLY4
  1. Q
  1. ;
  1. DSPLY4 ;
  1. W !
  1. F APCDY=0:0 S APCDY=$O(^UTILITY("DIQ1",$J,APCDVFLE,APCDVDFN,APCDY)) Q:'APCDY D
  1. .I $G(^UTILITY("DIQ1",$J,APCDVFLE,APCDVDFN,APCDY))]"" S APCDX=$P(^DD(APCDVFLE,APCDY,0),U)_": "_^UTILITY("DIQ1",$J,APCDVFLE,APCDVDFN,APCDY) D DSPLY41 Q
  1. .I $O(^UTILITY("DIQ1",$J,APCDVFLE,APCDVDFN,APCDY,0)) D
  1. ..S F=0 F S F=$O(^UTILITY("DIQ1",$J,APCDVFLE,APCDVDFN,APCDY,F)) Q:F'=+F S APCDX=^UTILITY("DIQ1",$J,APCDVFLE,APCDVDFN,APCDY,F) D DSPLY41
  1. K APCDT,APCDX,APCDY
  1. Q
  1. DSPLY41 ;
  1. W:$X>39 ! S APCDT=$S($X<2:$X,1:$X+5) W:(APCDT+$L(APCDX))>79 ! S:(APCDT+$L(APCDX))>79 APCDT=0 W ?APCDT,APCDX
  1. Q
  1. WRITE ;
  1. S APCDV=" "_APCDV_" "
  1. S APCDX=APCDH_": "_APCDV W:$X>39 ! S APCDT=$S($X>1:41,1:1) W:(APCDT+$L(APCDX))>79 ! W ?APCDT,APCDH,": ",@APCDRVON,APCDV,@APCDRVOF
  1. K APCDT,APCDX
  1. Q