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

IBERS.m

Go to the documentation of this file.
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ;patient data for a particuar appointment is printed on the top of the check-off sheet
  1. EN ;determine print option from user (print by clinic or by patient)
  1. ;***
  1. ;S XRTL=$ZU(0),XRTN="IBERS-1" D T0^%ZOSV ;start rt clock
  1. D HOME^%ZIS S IBDT=DT
  1. E1 W @IOF,!,?20,"Print Appointment Check-Off Sheets",!!
  1. S DIR("?")="Enter a code from the list or return to exit.",DIR("B")="Clinic"
  1. S DIR(0)="SO^P:Patient Name;C:Clinic",DIR("A")="Select Appointment by" D ^DIR K DIR G:$D(DIRUT) END S IBC=Y
  1. I IBC="P" S IBSRT=1 G E2
  1. S DIR(0)="SOB^C:Clinic and Patient;T:Terminal Digits",DIR("?")="Enter ""C"" for sorting by Clinic and Patient or ""T"" to sort by Terminal Digits"
  1. S DIR("A")="Sort sheets by",DIR("B")="Clinic" D ^DIR K DIR G:$D(DIRUT) END S IBSRT=$S(Y="T":2,1:1)
  1. E2 D DATE I IBDT'=-1 D @IBC
  1. END G:'$D(^TMP("IBRS",$J)) EXIT
  1. W !,"This report requires 132 columns."
  1. S %ZIS="QM",%ZIS("A")="OUTPUT DEVICE: " D ^%ZIS G:POP EXIT
  1. I $D(IO("Q")) S ZTRTN="^IBERS1",ZTDESC="IB Appointment Check-Off Sheets",ZTSAVE("^TMP(""IBRS"",$J,")="",ZTSAVE("IBSRT")="" D ^%ZTLOAD K IO("Q") D HOME^%ZIS G EXIT
  1. U IO
  1. ;***
  1. ;I $D(XRT0) S:'$D(XRTN) XRTN="IBERS" D T1^%ZOSV ;stop rt clock
  1. D ^IBERS1
  1. EXIT K ^TMP("IBRS",$J)
  1. ;***
  1. ;I $D(XRT0) S:'$D(XRTN) XRTN="IBERS" D T1^%ZOSV ;stop rt clock
  1. I $D(ZTQUEUED) S ZTREQ="@" Q
  1. K IBC,IBDT,IBSRT,DTOUT,DUOUT,DIRUT,DIROUT,X,Y D ^%ZISC
  1. Q
  1. ;
  1. P ;print by patient - get patient then appointment(s) for date
  1. S DIC="^DPT(",DIC(0)="AEQM" D ^DIC K DIC G:Y<0 ENDP S IBPFN=+Y,IBPNM=$P(Y,"^",2)
  1. S IBDFN(IBPFN)="" D SEARCH S IBNM=IBPNM D DISP
  1. G P
  1. ENDP K IBPFN,IBPNM,IBNM,DTOUT,DUOUT,X,Y
  1. Q
  1. ;
  1. C ;print all appointments for a clinic - find division then clinic, print all/some clinics for all/some divisions
  1. D DIVISION^VAUTOMA G:$D(VAUTD)<11&(VAUTD=0) ENDC
  1. S DIC("S")="I +$P(^(0),U,25),$P(^(0),U,3)=""C"",$S(VAUTD:1,$D(VAUTD(+$P(^(0),U,15))):1,'+$P(^(0),U,15)&$D(VAUTD($O(^DG(40.8,0)))):1,1:0)"
  1. S DIC="^SC(",VAUTVB="VAUTC",VAUTNI=2,VAUTSTR="clinic" D FIRST^VAUTOMA K DIC G:$D(VAUTC)<11&(VAUTC=0) ENDC
  1. I VAUTC,VAUTD S ^TMP("IBRS",$J,"D","ALL",IBDT)=""
  1. I VAUTC,'VAUTD S IBDIV="" F IBI=1:1 S IBDIV=$O(VAUTD(IBDIV)) Q:IBDIV="" S ^TMP("IBRS",$J,"D",IBDIV,IBDT)=""
  1. I 'VAUTC S IBCLN="" F IBI=1:1 S IBCLN=$O(VAUTC(IBCLN)) Q:IBCLN="" S ^TMP("IBRS",$J,"C",IBCLN,IBDT)=""
  1. ENDC K VAUTNI,VAUTD,VAUTC,VAUTVB,VAUTSTR,IBDIV,IBCLN,IBI,DIC
  1. Q
  1. ;
  1. S DFN=""
  1. S1 S DFN=$O(IBDFN(DFN)) G:DFN="" ENDS
  1. S (VASD("F"),VASD("T"))=IBDT,VASD("W")=129 D SDA^VADPT I VAERR!'($D(^UTILITY("VASD",$J))) G S1
  1. S IBX="" F IBI=1:1 S IBX=$O(^UTILITY("VASD",$J,IBX)) Q:IBX="" D
  1. . S IBLN=^UTILITY("VASD",$J,IBX,"I") Q:'$P($G(^SC(+$P(IBLN,"^",2),0)),"^",25) S IBPAT=$$PT^IBEFUNC(DFN) Q:IBPAT=""
  1. . S IBTMP($P(IBLN,"^",1))=DFN_"^"_$P(IBLN,"^",2)_"^"_$P(IBPAT,"^",1)_"^"_^UTILITY("VASD",$J,IBX,"E")_"^"_$P(IBPAT,"^",2)
  1. G S1
  1. ENDS K IBX,IBI,IBLN,DFN,IBPAT,VASD,VAERR,IBDFN
  1. Q
  1. ;
  1. DISP ;display patients/clinics appointments found and get users choice
  1. I '$D(^UTILITY("VASD",$J)) W !!,?5,"No Active Appointments for ",IBNM," on this date",! G ENDD
  1. I '$D(IBTMP) W !!,?10,"No Active Appointments in a Clinic with a Check-Off Sheet",!,?10,"for ",IBNM," on this date.",! G ENDD
  1. W !!,"Appointments for ",IBNM,!
  1. S IBX="" F IBI=1:1 S IBX=$O(IBTMP(IBX)) Q:IBX="" S IBLN=IBTMP(IBX) W !,$J(IBI,3)," ",$E($S(IBC="C":$P(IBLN,"^",3),1:$P(IBLN,"^",5)),1,20),?25," " F IBJ=4,6,7 W " ",$P(IBLN,"^",IBJ)
  1. S DIR(0)="LO^1:"_(IBI-1)_"^K:X[""."" X",DIR("A")=" Select Appointments" D ^DIR K DIR G:$D(DIRUT) ENDD
  1. S IBX="" F IBI=1:1 S IBX=$O(IBTMP(IBX)) Q:IBX="" I Y[(IBI_",") D
  1. . S IBSRT1=$S(IBSRT=2:0_$$TDG^IBEFUNC2($P(IBTMP(IBX),"^",8)),1:$P(IBTMP(IBX),"^",2))
  1. . S ^TMP("IBRS",$J,"P",IBSRT1,$P(IBTMP(IBX),"^",3),IBX)=IBTMP(IBX)_"^"_IBX
  1. ENDD K IBX,IBI,IBJ,IBLN,IBTMP,IBSRT1,DTOUT,DUOUT,DIRUT,DIROUT,X,Y,^UTILITY("VASD",$J)
  1. Q
  1. ;
  1. DATE ;get date for RS
  1. S Y=IBDT X ^DD("DD")
  1. S %DT="AEX",%DT("A")="Appointment DATE: ",%DT("B")=Y D ^%DT K %DT S IBDT=Y
  1. W !!,"Only Clinics and Patients with Appointments on this Date will be allowed."
  1. W !,"Appointments must be in Clinics that have a Check-Off Sheet, to be chosen.",!!
  1. Q