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

IBTRVD1.m

Go to the documentation of this file.
  1. IBTRVD1 ;ALB/AAS - CLAIMS TRACKING REVIEW EDIT ; 06-JUL-93
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. % G ^IBTRV
  1. ;
  1. QE ; -- Review Criteria edit
  1. N IBXX,VALMY,DA,DR,DIC,DIE
  1. D QE1^IBTRV1
  1. D BLD^IBTRVD
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. NX(IBTMPNM,BLD) ; -- edit next template
  1. N IBXX,VALMY,IBTRC
  1. D EN^VALM(IBTMPNM)
  1. I '$D(IBFASTXT),'$G(BLD) D BLD^IBTRVD
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. EDIT(DR,BLD) ; -- edit entry point for claims tracking reviews
  1. ; -- Input IBTEMP = template name or dr string
  1. ; BLD = any non-zero value if calling routine is doing own
  1. ; rebuild
  1. ;
  1. N IBDIF,DA,DIC,DIE,DIR,X,Y
  1. D FULL^VALM1 W !
  1. L +^IBT(356.1,+IBTRV):5 I '$T D LOCKED^IBTRCD1 G EDITQ
  1. D SAVE
  1. S DIE="^IBT(356.1,",DA=IBTRV
  1. D ^DIE K DA,DR,DIC,DIE
  1. D COMP
  1. I '$D(IBCON) D CON K IBCON
  1. I IBDIF=1 D UPDATE,BLD^IBTRVD:'$G(BLD)
  1. L -^IBT(356.1,+IBTRN)
  1. EDITQ K ^TMP($J,"IBT")
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. SAVE ; -- Save the global before editing
  1. K ^TMP($J,"IBT")
  1. S ^TMP($J,"IBT",356.1,IBTRV,0)=$G(^IBT(356.1,IBTRV,0))
  1. S ^TMP($J,"IBT",356.1,IBTRV,1)=$G(^IBT(356.1,IBTRV,1))
  1. S ^TMP($J,"IBT",356.1,IBTRV,11,0)=$G(^IBT(356.1,IBTRV,11,0))
  1. Q
  1. ;
  1. COMP ; -- Compare before editing with globals
  1. S IBDIF=0
  1. I $G(^IBT(356.1,IBTRV,0))'=$G(^TMP($J,"IBT",356.1,IBTRV,0)) S IBDIF=1 Q
  1. I $G(^IBT(356.1,IBTRV,1))'=$G(^TMP($J,"IBT",356.1,IBTRV,1)) S IBDIF=1 Q
  1. I $G(^IBT(356.1,IBTRV,11,0))'=$G(^TMP($J,"IBT",356.1,IBTRV,11,0)) S IBDIF=1 Q
  1. Q
  1. ;
  1. UPDATE ; -- enter date and user if editing has taken place
  1. ; entry locked by edit, locks not needed here
  1. S DIE="^IBT(356.1,",DA=IBTRV
  1. S DR="1.03///NOW;1.04////"_DUZ
  1. D ^DIE K DA,DR,DIC,DIE
  1. Q
  1. ;
  1. CON ; -- consistency checker for hospital reviews
  1. N I,J,X,Y,DA,DR,DIC,DIE,IBI,IBTRTP,IBDEL
  1. S IBCON=1
  1. S IBTRTP=$P($G(^IBE(356.11,+$P($G(^IBT(356.1,IBTRV,0)),"^",22),0)),"^",2)
  1. ; -- if admission review
  1. I IBTRTP=15 D
  1. .S X=$G(^IBT(356.1,IBTRV,0))
  1. .I '$P(X,"^",4),'$P(X,"^",5),'$P(X,"^",6),'$O(^IBT(356.1,IBTRV,12,0)) W !!,*7,"Warning: Admission Criteria does NOT appear to be met but Reason for",!,"Non Acute Admission Missing." D EDIT("12",1)
  1. .I $P(X,"^",4)!($P(X,"^",5))!($P(X,"^",6)) I $O(^IBT(356.1,IBTRV,12,0)) W !!,*7,"Warning: Admission Criteria appears to be met but has Reason for ",!,"Non Acute Admission." D EDIT("12",1)
  1. .Q
  1. ; -- if cont. stay review
  1. I IBTRTP=30 D
  1. .S X=$G(^IBT(356.1,IBTRV,0))
  1. .I '$P(X,"^",4),'$P(X,"^",5),$P(X,"^",12),'$O(^IBT(356.1,IBTRV,13,0)) W !!,*7,"Warning: Acute Care Criteria does NOT appear to be met but Reason for",!,"Non Acute Days Missing." D EDIT(13,1)
  1. .I $P(X,"^",4)!($P(X,"^",5)) I $O(^IBT(356.1,IBTRV,13,0)) W !!,*7,"Warning: Acute Care Criteria appears to be met but has Reason for ",!,"Non Acute Days." D EDIT(13,1)
  1. .Q
  1. ; -- check Next Review Dates
  1. S IBI=0 F S IBI=$O(^IBT(356.1,"C",IBTRN,IBI)) Q:'IBI I IBI'=IBTRV D
  1. .I $P($G(^IBT(356.1,IBI,0)),"^",20) S IBI(IBI)=""
  1. .Q
  1. I $O(IBI(0)) D ASKDEL I IBDEL D
  1. .I $P(^IBT(356.1,IBTRV,0),U,20) D
  1. ..W !," There are other reviews for this admission with a next review date"
  1. ..W !," specified. Generally, only the last review for an admission should"
  1. ..W !," have a next review date. Please check the reviews for this case and"
  1. ..W !," delete all unnecessary 'next review dates'."
  1. ..H 3 Q
  1. .I $O(IBI(+$O(IBI(0)))) D
  1. .;S IBI=0 F S IBI=$O(IBI(IBI)) Q:'IBI S DA=IBI,DR=".2///@",DIE="^IBT(356.1," D ^DIE
  1. .;W !,"Next Review Dates have all been deleted, except for this review"
  1. .Q
  1. Q
  1. ;
  1. ASKDEL ; -- ask if okay to delete next review dates
  1. S IBDEL=1
  1. Q
  1. ;
  1. IA(IBTRV,BLD) ; -- Insurance action
  1. ; -- add/edit communications in bkgrnd for a review
  1. ; quick edit a communications entry.
  1. ;
  1. I '$G(BLD) D BLD^IBTRVD
  1. S VALMBCK="R"
  1. Q