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

BCHULV.m

Go to the documentation of this file.
BCHULV ; IHS/CMI/LAB - PTS LAST CHR VISIT ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;
 ;
START ;EP display patients last visit
 D GETPAT
 I 'BCHPAT,'BCHNRPAT D XIT Q
 D GETREC
 I 'BCHR D XIT Q
 D FORMAT
 Q:BCHTYPE=""
ZIS ;
 S XBRC="COMP^BCHULV",XBRP=$S(BCHTYPE="C":"PRINT1^BCHUFPP",1:"^BCHUDSP"),XBNS="BCH",XBRX="XIT^BCHULV"
 D ^XBDBQUE
 D XIT
 Q
XIT ;
 D KILL^AUPNPAT
 K BCHVDFN,BCHVDG,BCHVDSH,BCHVFU,BCHVI,BCHVIGR,BCHVL,BCHVNM,BCHX,BCHBRK,BCHTYPE,BCHDLAST,BCHR11,BCHR12,BCHRNODE,BCHRPRNM
 K ZTSK,Y,BCHBD,BCHED,IO("Q"),BCH80D,BCHBTH,BCHHRCN,BCHJOB,BCHUNG,BCHPCNT,BCHPG,BCHPROV,BCHX,DFN,DIC,DIR,DIRUT,DTOUT,DUOUT,XBNS,XBRC,XBRP,XBTX,D,BCHC
 K BCHPRNM,BCHPRNT,BCHPROB,BCHPRV,BCHR,BCHRCNT,BCHRLOC,BCHSD,BCHTOT,BCHBDD,BCHBT,BCHEDD,BCHEDO,BCHBDO,BCHBT,BCHFOUND,BCHHIT,BCHID,BCHLINE,BCHP,BCHHRN,BCHODAT,BCHQUIT,BCHR0,BCHTICL,BCHTNRQ,BCHTQ,BCHTTXT
 K BCHPAT
 Q
GETPAT ;EP - GET PATIENT
 S BCHPAT="",BCHNRPAT=""
 W !!,"Please enter the Patient.  You may enter a Registered Patient or",!,"a Non Registered Patient.",!
 S DIR(0)="90002,8901",DIR("A")="Enter Patient Name" KILL DA D ^DIR KILL DIR
 ;S DIC("A")="Enter PATIENT (if known): ",DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC
 Q:Y<0
 I Y["BCHRPAT" S BCHNRPAT=+Y Q
 S BCHPAT=+Y
 Q
 ;
GETREC ;
 S BCHR=""
 I BCHPAT D  Q
 .I '$D(^BCHR("AE",BCHPAT)) W !!,"No records on file for this patient.",! Q
 .S BCHDLAST=$O(^BCHR("AE",BCHPAT,"")),BCHR=$O(^BCHR("AE",BCHPAT,BCHDLAST,""))
 I BCHNRPAT D  Q
 .I '$D(^BCHR("ANRE",BCHNRPAT)) W !!,"No records on file for this patient.",! Q
 .S BCHDLAST=$O(^BCHR("ANRE",BCHNRPAT,"")),BCHR=$O(^BCHR("ANRE",BCHNRPAT,BCHDLAST,""))
 Q
FORMAT ;
 S BCHTYPE=""
 S DIR(0)="S^C:CHR PCC Form Format;S:Standard Display",DIR("A")="Select Print Format",DIR("B")="C" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q:$D(DIRUT)
 S BCHTYPE=Y
 Q
COMP ;
 Q