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

BDMVRL.m

Go to the documentation of this file.
BDMVRL ; IHS/CMI/LAB - VIEW PT RECORD LT ; 29 Sep 2014  11:55 AM
 ;;2.0;DIABETES MANAGEMENT SYSTEM;**2,3,4,5,6,7,8,9,10,11,12**;JUN 14, 2007;Build 51
 ;
 ;This routine calls a list template to view a patient's record.
 ;The first screen displayed is the patient's health summary.
 ;
 ;cmi/anch/maw 3/8/2007 changed visit display to be browser based
 ;
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 I '$$PKGCK^BDMVU("APCHS","PCC HEALTH SUMMARY") D  D EXIT Q
 . D MSG^BDMVU("**HEALTH SUMMARY SOFTWARE NOT INSTALLED**",2,1,1)
 ;
 K DFN,BDMQUIT,BMOUT
 K ^TMP("BDMVR",$J)
 F  D GETPAT^BDMVRL5 Q:$D(BDMQUIT)!$D(BDMOUT)  D
 .Q:'$G(BDMRDA)!'$G(BDMRPDA)
 .D REGDAT
 .D FULL^VALM1
 .D EXIT
 K BDMQUIT,BDMOUT
 Q
 ;
HAVEPAT ;EP; -- entry point when patient already known
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 N APCHSPAT,APCHSTYP,APCHSTAT,APCHSMTY,AMCHDAYS,AMCHDOB,BDMVSAV
 D GETHSTYP^BDMVRL5
 I '$G(APCHSTYP) D EXIT Q
 S APCHSPAT=DFN,BDMVSAV=DFN
 D EN,FULL^VALM1,EXIT
 Q
 ;
EN ;EP; -- main entry point for list template BDMV HS VIEW
 D CLEAR^VALM1
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 N APCHSPAT,APCHSTYP,APCHSTAT,APCHSMTY,AMCHDAYS,AMCHDOB,BDMVSAV
 D GETHSTYP^BDMVRL5
 I '$G(APCHSTYP) D EXIT Q
 S APCHSPAT=DFN,BDMVSAV=DFN
 S BDMVALM="BDMV HS VIEW"
 D VALM(BDMVALM)
 Q
VALM(BDMVALM) ;EP; -- main entry point for list templates
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S VALMCC=1 ;1=screen mode, 0=scrolling mode
 D TERM^VALM0
 D CLEAR^VALM1
 D EN^VALM(BDMVALM)
 D CLEAR^VALM1
 Q
 ;
HDR ;EP; -- header code
 S VALMSG=$$VALMSG^BDMVU
 Q
 ;
INIT ;EP; -- init variables and list array
 D GUIR^XBLM("EN^APCHS","^TMP(""BDMVR"",$J,")
 S X=0
 F  S X=$O(^TMP("BDMVR",$J,X)) Q:'X  D
 . S VALMCNT=X
 . S ^TMP("BDMVR",$J,X,0)=$G(^TMP("BDMVR",$J,X))
 S VALMSG=$$VALMSG^BDMVU
 Q
 ;
HELP ;EP; -- help code
 S X="?" D DISP^XQORM1 W !!
 Q
 ;
EXIT ;EP; -- exit code
 K ^TMP("BDMVR",$J)
 K BDM
 Q
 ;
EXPND ;EP; -- expand code
 Q
 ;
PAUSE ; -- end of action pause
 D RETURN^BDMVU
 Q
 ;
CSS ;EP;TO REVIEW CASE SUMMARY
 K BDMQUIT,ACMQUIT
 K ACMMHS,ACMSTYP
 D REG^BDMFUTIL
 S ACMRG=BDMRDA
 S ACMRGNA=BDMREGNM
 Q:$D(BDMQUIT)
 D ^ACMLPAT
 Q:$D(ACMQUIT)!'$G(ACMPTNO)
 S DFN=ACMPTNO
 S BDMRPDA=ACMRGDFN
 I $P(^ACM(41.1,BDMRDA,0),U,10)=1 D
 .S DIR(0)="YO",DIR("A")="Include PCC HEALTH SUMMARY",DIR("B")="NO"
 .W !
 .D ^DIR K DIR
 .I Y=1 S ACMMHS="" D SELTYP^ACMPPDTX
 S (ZTRTN,BDMRTN)="CS1^BDMVRL"
 S BDMBROWS=1
 D ^BDMFZIS
 K BDMBROWS,ACMMHS,ACMSTYP,BDMRTN
 D EN^XBVK("ACM")  ;,EN^XBVK("BDM")
 Q
CS ;EP;TO REVIEW CASE SUMMARY
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 D CLEAR^VALM1
 I $P(^ACM(41.1,BDMRDA,0),U,10)=1 D
 .S DIR(0)="YO",DIR("A")="Include PCC HEALTH SUMMARY",DIR("B")="NO"
 .W !
 .D ^DIR K DIR
 .I Y=1 S ACMMHS="" D SELTYP^ACMPPDTX
 S (ZTRTN,BDMRTN)="CS1^BDMVRL"
 D BROWSE^BDMFZIS
 Q
CS1 ;EP;
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S ACMRG=BDMRDA
 S ACMRGDFN=BDMRPDA
 S ACMPTNO=DFN
 S X=$P(^DPT(DFN,0),U)
 S ACMPATNA=X
 S ACMPTNA2=$P($P(X,",",2)," ")_" "_$P(X,",")
 D ^ACMCTRL  ;cmi/anch/maw 3/22/2007 for version 2.0
 D DQ^BDMPPDT
 Q
AS ;EP;TO REVIEW AUDIT STATUS
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 D CLEAR^VALM1
 N X,BDMY,BDMZ,BDMQUIT,BDMVRLY
 S BDMJOB=$J
 S BDMBTH=$H
 S BDMDMRG=BDMRDA
 S ^XTMP("BDMDM19",BDMJOB,BDMBTH,"PATS",DFN)=""
 S ^TMP("BDMDM19",BDMJOB,BDMBTH,"PATS",DFN)=""
 D TIME^BDMDG1
 Q:$G(BDMSTP)
 D EN^XBNEW("IAEP^BDMDG1","BDMJOB;BDMBTH;BDMDMRG;BDMADAT;BDMRED;BDMBDAT;BDMRBD")
 Q
 ;
DLP ;EP;FOR DIABETES LAB PROFILE
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 D CLEAR^VALM1
 N APCHSTYP,APCHSPAT
 I '$D(^APCHSCTL("B","DMS DIABETES LAB REPORT")) D NEWHS^BDMVRL5
 S APCHSTYP=$O(^APCHSCTL("B","DMS DIABETES LAB REPORT",0))
 Q:'APCHSTYP
 S APCHSPAT=DFN
 D EN^APCHS
 D PAUSE^BDMFMENU
 Q
APPTS ;EP;TO DISPLAY APPOINTMENTS
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S BDMVALM="BDMV APPOINTMENTS"
 D VALM(BDMVALM)
 Q
APPINIT ;EP;TO DISPLAY APPOINTMENTS
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 K ^TMP("BDMVR",$J)
 N J,X,Y,Z,BDMAPPDA,BDMPAT0
 S VALMCNT=0
 S X="     CLINIC                            TIME     DATE"
 D Z(X)
 S X="     ------------------------------    -------- ----------"
 D Z(X)
 S BDMAPPDA=DT-1
 F  S BDMAPPDA=$O(^DPT(DFN,"S",BDMAPPDA)) Q:'BDMAPPDA  D
 .S BDMPAT0=$G(^DPT(DFN,"S",BDMAPPDA,0))
 .Q:'+BDMPAT0!($P(BDMPAT0,U,2)]"")
 .S Z=$P($G(^SC(+BDMPAT0,0)),U)
 .S Y=BDMAPPDA
 .X ^DD("DD")
 .S X=""
 .S $E(X,6)=Z
 .S $E(X,36)=" at "_$P(Y,"@",2)_" on "_$P(Y,"@")
 .D Z(X)
 S:VALMCNT=2 ^TMP("BDMVR",$J,3,0)="     NO APPOINTMENTS LISTED"
 D BACK
 Q
LVD ;EP;TO DISPLAY LAST VISIT
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 N X
 S X=$O(^AUPNVSIT("AA",DFN,0))
 I 'X D  Q
 .W !,"No visits on file for this patient."
 .D PAUSE^BDMFMENU
 S X=$O(^AUPNVSIT("AA",DFN,X,0))
 S APCDLOOK=X
VISIT I APCDLOOK S APCDVSIT=APCDLOOK,APCDDATE=+^AUPNVSIT(APCDLOOK,0),APCDTYPE=$P(^AUPNVSIT(APCDLOOK,0),U,3),APCDCAT=$P(^(0),U,7),APCDLOC=$P(^(0),U,6),APCDCLN=$P(^(0),U,8)
 S APCDVDSP=APCDVSIT
 D CLEAR^VALM1
 D ^APCDVD  ;cmi/anch/maw 3/8/2007 for browser display
 ;D ^APCDVDSP  cmi/anch/maw 3/8/2007 orig line
 Q
GETVISIT ;EP;TO GET VISIT
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S APCDPAT=DFN
 W !
 D GETVISIT^APCDDISP
 I $G(APCDVSIT) S APCDLOOK=APCDVSIT D VISIT:$G(APCDVSIT)
 Q
FS ;EP;TO VIEW A FLOW SHEET
 D CLEAR^VALM1
 N APCHSTYP,APCHSPAT
 I '$D(^APCHSCTL("B","DMS DIABETIC FLOWSHEET")) D NEWHS^BDMVRL5
 ;S APCHSTYP=$O(^APCHSCTL("B","DMS DIABETIC FLOWSHEET",0))
 S DIC="^APCHSCTL("
 S DIC(0)="AEMQZ"
 S DIC("A")="Which FLOW SHEET: "
 S DIC("B")="DMS DIABETIC FLOWSHEET"
 W !
 D DIC^BDMFDIC
 I +Y<1 K BDMQUIT Q
 S APCHSTYP=+Y
 S APCHSPAT=DFN
 D EN^APCHS
 D PAUSE^BDMFMENU
 Q
HS ;EP;TO VIEW A HEALTH SUMMARY
 D EN
 Q
LP ;EP;TO DISPLAY LAB PROFILE
 D CLEAR^VALM1
 N APCHSTYP,APCHSPAT
 I '$D(^APCHSCTL("B","DMS LAB REPORT")) D NEWHS^BDMVRL5
 S APCHSTYP=$O(^APCHSCTL("B","DMS LAB REPORT",0))
 Q:'APCHSTYP
 S APCHSPAT=DFN
 D EN^APCHS
 D PAUSE^BDMFMENU
 Q
REF ;EP;TO EDIT REFERRALS
 Q
LOPT ;EP;TO EDIT LOCAL OPTION
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="1101;1102"
 W !!
 D DIE^BDMFDIC
 D DXUPD^BDMVRL5
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="11////"_DT
 D DIE^BDMFDIC
 D PP^BDMVRL5
 Q
RS ;EP;TO EDIT REGISTER STATUS
 D FULL^VALM1
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="1"
 W !!
 D DIE^BDMFDIC
 D DXUPD^BDMVRL5
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="11////"_DT
 D DIE^BDMFDIC
 D PP^BDMVRL5
 Q
WF ;EP;TO EDIT WHERE FOLLOWED
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="10"
 W !!
 D DIE^BDMFDIC
 D DXUPD^BDMVRL5
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="11////"_DT
 D DIE^BDMFDIC
 D PP^BDMVRL5
 Q
CM ;EP;TO EDIT CASE MANAGER
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="6"
 W !!
 D DIE^BDMFDIC
 D DXUPD^BDMVRL5
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="11////"_DT
 D DIE^BDMFDIC
 D PP^BDMVRL5
 Q
CC ;EP;TO EDIT CONTACT
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="14"
 W !!
 D DIE^BDMFDIC
 D DXUPD^BDMVRL5
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="11////"_DT
 D DIE^BDMFDIC
 D PP^BDMVRL5
 Q
ERD ;EP;TO EDIT REGISTER DATA
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S DA=BDMRPDA
 S DIE=9002241
 S DR="[BDM CMS REGISTER]"
 D DDS^BDMFDIC
 D DXUPD^BDMVRL5
 S DA=BDMRPDA
 S DIE="^ACM(41,"
 S DR="11////"_DT
 D DIE^BDMFDIC
 D PP^BDMVRL5
 Q
MM ;EP;TO SEND MAIL MESSAGE
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 D CLEAR^VALM1
 W !!,"Send Mail Message"
 N XMLOAD,XMDF,XMMENU
 S XMMENU(0)="XMUSER"
 D LOCK^XM
 I Y D XMZ^XMA2  ;cmi/maw 9/7/06 new
 D UNLOCK^XM
 Q
VFS ;EP;TO VIEW PATIENT REGISTRATION FACE SHEET
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 Q:'$G(DFN)
 D CLEAR^VALM1
 W @IOF
 W !?5,"Display FACE SHEET for: ",$P(BDMPAT0,U),!!
 D VIEWR^XBLM("START^AGFACE")
 Q
DPSC ;EP;DPSC
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 Q:'$G(DFN)
 D CLEAR^VALM1
 W @IOF
 W !?5,"Display Diabetes Patient Care Summary for: ",$P(BDMPAT0,U),!!
 D VIEWR^XBLM("PRINT^BDMDMSP")
 Q
PRD ;EP;TO VIEW PATIENT REGISTRATION DATA
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 Q:'$G(DFN)
 S BDMSAV=DFN
 D CLEAR^VALM1
 D ^AGVAR
 S AGPAGE=1
 ;I '$D(^VA(200,+$G(DUZ),51,+$O(^DIC(19.1,"B","AGZMENU",0)))) D
 ;.S AGSEENLY=""
 D L2^AGSEENLY
 S DFN=BDMSAV
 Q
REGDAT ;EP;TO GATHER AND DISPLAY PATIENT REGISTER DATA
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S BDMVALM="BDMV REGISTER"
 D VALM(BDMVALM)
 Q
RDINIT ;EP;TO INITIALIZE PATIENT REGISTER DATA FOR DISPLAY
 D RDINIT^BDMVRL2
 Q
BACK S VALMBCK="R"
 Q
VSEL ;EP;TO SELECT VISIT TO DISPLAY
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 S DIR(0)="NO^1:"_BDMJ
 S DIR("A")="Which Visit"
 W !
 D DIR^BDMFDIC
 Q:Y<1!'$D(BDM(+Y))
 S APCDLOOK=+BDM(Y)
 D VISIT
 Q
PROB ;EP; called from protocol
PL ;EP; called from protocol - changed in 2015 audit to display only per MU2
 D REG^BDMFUTIL
 Q:$D(BDMQUIT)
 D CLEAR^VALM1
 D FULL^VALM1
 S APCDOVRR=""
 S APCDPAT=DFN
 D EN1^BDMPL
 S (DFN,Y)=APCDPAT
 D ^AUPNPAT
 D BACK
 Q
Z(X) ;SET TMP NODE
 S VALMCNT=VALMCNT+1
 S ^TMP("BDMVR",$J,VALMCNT,0)=X
 Q