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

APCDACP.m

Go to the documentation of this file.
  1. APCDACP ; IHS/CMI/LAB - list V POV's that have Accept command ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. INFORM ;inform user what is going on
  1. W:$D(IOF) @IOF
  1. F APCDJ=1:1:5 S APCDX=$P($T(HDR+APCDJ),";;",2) W !?80-$L(APCDX)\2,APCDX
  1. F APCDJ=1:1:6 W !,$P($T(TEXT+APCDJ),";;",2)
  1. K APCDX,APCDJ
  1. ;
  1. RDPV ; Determine to run by Posting date or Visit date
  1. S APCDBEEP=$C(7)_$C(7),APCDSITE="" S:$D(DUZ(2)) APCDSITE=DUZ(2)
  1. I APCDSITE="" S APCDSITE=+^AUTTSITE(1,0)
  1. S DIR(0)="S^1:Posting Date;2:Visit Date",DIR("A")="Run Report by",DIR("B")="P" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G XIT
  1. S Y=$E(Y),APCDX=$S(Y=1:"P",Y=2:"V",1:Y)
  1. GETDATES ;
  1. BD ;get beginning date
  1. W ! S DIR(0)="D^:DT:EP",DIR("A")="Enter beginning "_$S(APCDX="P":"Posting",APCDX="V":"Visit",1:"Posting")_" Date for Search" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G XIT
  1. S APCDBD=Y
  1. ED ;get ending date
  1. W ! S DIR(0)="DA^"_APCDBD_":DT:EP",DIR("A")="Enter ending "_$S(APCDX="P":"Posting",APCDX="V":"Visit",1:"Posting")_" Date for Search: " S Y=APCDBD D DD^%DT S DIR("B")=Y,Y="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G BD
  1. S APCDED=Y
  1. S X1=APCDBD,X2=-1 D C^%DTC S APCDSD=X
  1. TYPE ;
  1. S DIR(0)="S^1:Purpose of Visit Records;2:Operations/Procedure Records;3:V Hospitalization Records;4:All of the Above",DIR("A")="List ACCEPT commands for which of the above" D ^DIR K DIR
  1. G:$D(DIRUT) BD
  1. S (APCDT,APCDACCT)=+Y
  1. DEMO ;
  1. D DEMOCHK^APCLUTL(.APCLDEMO)
  1. I APCLDEMO=-1 G TYPE
  1. ZIS ;
  1. W !! S %ZIS="PQ" D ^%ZIS
  1. I POP G XIT
  1. I $D(IO("Q")) G TSKMN
  1. DRIVER ;EP;entry point from taskman
  1. S U="^"
  1. K ^XTMP("APCDACP",$J)
  1. D @APCDX
  1. U IO
  1. S APCDDT=$$FMTE^XLFDT(DT)
  1. D ^APCDACP1
  1. I '$D(ZTQUEUED) U IO(0)
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. G XIT
  1. P ; Run by Posting date
  1. S APCDODAT=$O(^AUPNVSIT("AMRG",APCDSD)) Q:APCDODAT=""
  1. S APCDVDFN=$O(^AUPNVSIT("AMRG",APCDODAT,"")) I APCDVDFN="" W !,"An error has occurred in the AMRG cross reference. Please notify your Supervisor" Q
  1. S APCDVDFN=APCDVDFN-1
  1. F APCDL=0:0 S APCDVDFN=$O(^AUPNVSIT(APCDVDFN)) Q:APCDVDFN'=+APCDVDFN I $D(^AUPNVSIT(APCDVDFN,0)) S APCDODAT=$P(^AUPNVSIT(APCDVDFN,0),U,2) Q:(APCDODAT>APCDED) D PROC^APCDACP2
  1. Q
  1. V ; Run by visit date
  1. S APCDODAT=$O(^AUPNVSIT("B",APCDSD)) Q:APCDODAT=""
  1. S APCDODAT=APCDSD_".9999" F APCDL=0:0 S APCDODAT=$O(^AUPNVSIT("B",APCDODAT)) Q:APCDODAT=""!((APCDODAT\1)>APCDED) D V1
  1. Q
  1. V1 ;
  1. S APCDVDFN="" F APCDL=0:0 S APCDVDFN=$O(^AUPNVSIT("B",APCDODAT,APCDVDFN)) Q:APCDVDFN'=+APCDVDFN I $D(^AUPNVSIT(APCDVDFN,0)) D PROC^APCDACP2
  1. Q
  1. ERR W APCDBEEP,!,"Must be a valid date and be Today or earlier. Time not allowed!" Q
  1. TSKMN ;
  1. K ZTSAVE F %="APCDX","APCDT","APCDBD","APCDED","APCDSD","APCDBDD","APCDBEEP","APCDSITE","APCDACCT","APCDFILE","APCDG","APCDTITL" S ZTSAVE(%)=""
  1. S ZTCPU=$G(IOCPU),ZTIO=ION,ZTRTN="DRIVER^APCDACP",ZTDTH="",ZTDESC="REVIEW ACCEPT POVS - DATA ENTRY" D ^%ZTLOAD D XIT Q
  1. XIT K APCDBEEP,APCDX,APCDT,APCDBD,APCDED,APCDSD,APCDODAT,APCDVDFN,%,APCDL,X,X1,X2,IO("Q"),APCDDT,APCDSITE,APCDLC,APCDPG,APCDCAT,APCDTYPE,APCDADM,APCDPS,APCDPVP,APCDFILE,APCDOVAG,Y,POP,ZTSK,APCDJ
  1. K AUPNPAT,AUPNDAYS,AUPNDOB,AUPNSEX,AUPNDOD
  1. K APCDACCT,APCDG,APCDTITL,APCDFILE,APCDVIGR,DIRUT
  1. D ^%ZISC
  1. K ^XTMP("APCDACP",$J)
  1. Q
  1. HDR ;
  1. ;;PCC Data Entry Module
  1. ;;
  1. ;;*****************************
  1. ;;* PRINT ACCEPT Commands *
  1. ;;*****************************
  1. ;;
  1. ;
  1. TEXT ;informing paragraph
  1. ;;
  1. ;;This option will allow you to print all of the Purpose of Visit, Procedures
  1. ;;and/or Hospitalization records that have had the ACCEPT command applied.
  1. ;;The ACCEPT command is used to override an edit in the IHS Direct Inpatient
  1. ;;and/or PCIS Systems.
  1. ;;