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

APCDRPOV.m

Go to the documentation of this file.
  1. APCDRPOV ; IHS/CMI/LAB - DISPLAY VISIT ;
  1. ;;2.0;IHS PCC SUITE;**2,10,11,20**;MAY 14, 2009;Build 25
  1. ;
  1. W !!,"This option is used to resequence the purpose of visit (diagnoses)"
  1. W !,"on a visit. This allows you to determine which will be the first diagnosis"
  1. W !,"listed which will become the primary diagnosis.",!!
  1. W !,"It is recommended that you query the provider before resequencing POVs.",!!
  1. D GETPAT
  1. I APCDPAT="" W !!,"No PATIENT selected!" D EOJ Q
  1. D GETVISIT
  1. I APCDVSIT="" W !!,"No VISIT selected!" D EOJ Q
  1. D DSPLY
  1. D EOJ
  1. Q
  1. ;
  1. GETPAT ;EP GET- PATIENT
  1. W !
  1. S AUPNLK("INAC")=""
  1. S APCDPAT=""
  1. S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC
  1. Q:Y<0
  1. S APCDPAT=+Y
  1. Q
  1. ;
  1. GETVISIT ;EP - this entry point called by the BVP package (View patient record)
  1. S APCDLOOK="",APCDVSIT=""
  1. K APCDVLK
  1. D ^APCDVLK
  1. K APCDLOOK
  1. Q
  1. EN(APCDVSIT) ;EP -pass in visit
  1. ;
  1. DSPLY ;
  1. W !!,"Visit Information",!
  1. S APCDVR0=^AUPNVSIT(APCDVSIT,0)
  1. S DFN=$P(APCDVR0,U,5)
  1. S Y=DFN D ^AUPNPAT
  1. ;W !,"Patient Name: ",$$VAL^XBDIQ1(2,DFN,.01),?50,"HRN: ",$$HRN^AUPNPAT(DFN,DUZ(2))
  1. I '$G(APCDNVDS) S DA=APCDVSIT,DIC="^AUPNVSIT(" D EN^DIQ
  1. D POVDISP
  1. Q
  1. ENDE(VIEN) ;EP CALLED FROM DATA ENTRY TEMPLATE
  1. S APCDNVDS=1
  1. D EN^XBNEW("EN^APCDRPOV(VIEN)","APCDNVDS;VIEN")
  1. K APCDNVDS
  1. Q
  1. ;
  1. EOJ ; EP - EOJ HOUSE KEEPING - this ep called by the BVP package (View patient record)
  1. K AUPNLK("INAC")
  1. K %,%DT,%X,%Y,C,DIYS,X,Y
  1. K APCDCLN,APCDCAT,APCDDATE,APCDLOC,APCDPAT,APCDVSIT,APCDLOOK,APCDTYPE
  1. D KILL^AUPNPAT
  1. Q
  1. POVDISP ;
  1. ;display current V POV information
  1. S APCDPSN=""
  1. W !?3,"Current Sequence of POV's",!
  1. S APCDX=0,APCDC=0 K APCDPOV F S APCDX=$O(^AUPNVPOV("AD",APCDVSIT,APCDX)) Q:APCDX'=+APCDX D
  1. .S APCDC=APCDC+1,APCDPOV(APCDC)=APCDX
  1. .W !?5,APCDC,")",?10,$$VAL^XBDIQ1(9000010.07,APCDX,.01),?20,$$VAL^XBDIQ1(9000010.07,APCDX,.04)
  1. .I $$GET1^DIQ(9000010.07,APCDX,1103)]"" S APCDPSN=1
  1. .Q
  1. W ! K DIR S DIR(0)="Y",DIR("A")="Do you want to resequence these POV's",DIR("B")="N" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) D EOJ Q
  1. I 'Y D EOJ Q
  1. ;store all V POV info
  1. W !!,"Please jot down the order using the numbers above that you wish the POV's"
  1. W !,"to be in. For example, if there are 3 POV's and you want #3 first, #1 second"
  1. W !,"and #2 third, you would enter 3,1,2.",!
  1. K APCDORD
  1. K DIR S DIR(0)="L^1:"_APCDC,DIR("A")="In what order do you want the POV's resequenced" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G DSPLY
  1. I X="" G DSPLY
  1. S APCDJ=Y
  1. I APCDC'=($L(APCDJ,",")-1) W !!,"You did not select all ",APCDC," POV's. Please sequence all of them.",! D PAUSE^APCDALV1 G POVDISP
  1. K APCDNEWO
  1. S APCDC=0
  1. W !!,"The POV's will be resequenced to the following order:"
  1. F X=1:1 S J=$P(APCDJ,",",X) Q:J="" W !?5,X,")" S APCDX=APCDPOV(J) W ?10,$$VAL^XBDIQ1(9000010.07,APCDX,.01),?20,$$VAL^XBDIQ1(9000010.07,APCDX,.04) S APCDC=APCDC+1,APCDNEWO(APCDC)=APCDX
  1. W ! K DIR S DIR(0)="Y",DIR("A")="Do you want to continue to resequence these POV's",DIR("B")="N" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G DSPLY
  1. I 'Y G DSPLY
  1. ;now take povs and re-enter them, then delete the old ones
  1. S APCDC=0 F S APCDC=$O(APCDNEWO(APCDC)) Q:APCDC'=+APCDC S APCDX=APCDNEWO(APCDC) D
  1. .;create new entry with FILE^DICN
  1. .K DD,D0,DO
  1. .S X=$P(^AUPNVPOV(APCDX,0),U),DIC="^AUPNVPOV(",DIADD=1,DLAYGO=9000010.07,DIC(0)="L"
  1. .D FILE^DICN
  1. .I Y=-1 W !!,"ERROR in creating new POV for ",APCDC Q
  1. .S APCDNEW=+Y
  1. .K DIC,DIADD,DLAYGO
  1. .M ^AUPNVPOV(APCDNEW)=^AUPNVPOV(APCDX)
  1. .S DA=APCDNEW,DIK="^AUPNVPOV(" D IX1^DIK K DA,DIK
  1. .S DA=APCDNEW,DR=".12///"_$S(APCDC=1:"P",1:"S") S:APCDPSN DR=DR_";1103///"_$S(APCDC=1:$$PRIMPOV^BCQMAPI(),1:"") S DIE="^AUPNVPOV(" D ^DIE K DA,DR,DIE
  1. .;now delete old one
  1. .S DA=APCDX,DIK="^AUPNVPOV(" D ^DIK K DA,DIK
  1. S AUPNVSIT=APCDVSIT D MOD^AUPNVSIT
  1. G DSPLY