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

ABMDESL1.m

Go to the documentation of this file.
  1. ABMDESL1 ; IHS/ASDST/DMJ - Selective Looping Parameters-PART 2 ;
  1. ;;2.6;IHS 3P BILLING SYSTEM;**11,21**;NOV 12, 2009;Build 379
  1. ;
  1. ;IHS/SD/SDR - v2.5 p10 - IM13359 - Added code to select range of patients
  1. ;IHS/SD/SDR - 2.6*21 - VMBP - Updated documentation from p11 to contain Serena ref#s
  1. ;
  1. LOC ;EP for selecting location
  1. W ! K DIC,ABMY("LOC")
  1. S DIC="^BAR(90052.05,DUZ(2),"
  1. S DIC(0)="AEQM"
  1. S DIC("A")="Select LOCATION: "
  1. D ^DIC K DIC
  1. Q:+Y<1
  1. S ABMY("LOC")=+Y
  1. Q
  1. ;
  1. TYP ;EP for selecting Billing Entity
  1. K DIR,ABMY("TYP"),ABMY("INS"),ABMY("PAT")
  1. ;S DIR(0)="SO^1:MEDICARE;2:MEDICAID;3:PRIVATE INSURANCE;4:NON-BENEFICIARY PATIENTS;5:BENEFICIARY PATIENTS;6:SPECIFIC INSURER" ;abm*2.6*11 VMBP#8 RQMT_101
  1. S DIR(0)="SO^1:MEDICARE;2:MEDICAID;3:PRIVATE INSURANCE;4:NON-BENEFICIARY PATIENTS;5:BENEFICIARY PATIENTS;6:SPECIFIC INSURER;7:VETERANS MEDICAL BENEFIT PROG" ;abm*2.6*11 VMBP#8 RQMT_101
  1. ;I '$D(ABMY("RNG")) S DIR(0)=DIR(0)_";7:SPECIFIC PATIENT" ;abm*2.6*11 VMBP#8 RQM1_101
  1. I '$D(ABMY("RNG")) S DIR(0)=DIR(0)_";8:SPECIFIC PATIENT" ;abm*2.6*11 VMBP#8 RQM1_101
  1. S DIR("A")="Select TYPE of BILLING ENTITY to Display"
  1. D ^DIR K DIR Q:$D(DIRUT)!$D(DIROUT)
  1. ;start old code abm*2.6*11 VMBP#8 RQM1_101
  1. ;S ABMY("TYP")=$S(Y=1:"R",Y=2:"D",Y=3:"P",Y=4:"N",Y=5:"I",1:Y),ABMY("TYP","NM")=Y(0)
  1. ;G INS:Y=6,PAT:Y=7
  1. ;end old code start new code VMBP#8 RQM1_101
  1. S ABMY("TYP")=$S(Y=1:"R",Y=2:"D",Y=3:"P",Y=4:"N",Y=5:"I",Y=7:"V",1:Y),ABMY("TYP","NM")=Y(0)
  1. G INS:Y=6,PAT:Y=8
  1. ;end new code VMBP#8 RQM1_101
  1. Q
  1. ;
  1. INS K ABMY("TYP"),ABMY("INS") W ! S DIC="^AUTNINS(",DIC(0)="QEAM" D ^DIC
  1. Q:+Y<1 S ABMY("INS")=+Y
  1. Q
  1. ;
  1. PAT K ABMY("TYP"),ABMY("PAT")
  1. W ! S DIC="^AUPNPAT(",DIC(0)="QEAM" D ^DIC K AUPNLK("ALL")
  1. Q:+Y<1 S ABMY("PAT")=+Y
  1. Q
  1. ;
  1. DT ;EP for selecting Visit Date Range
  1. K DIR,ABMY("DT")
  1. S ABMY("DT")="V"
  1. S Y="VISIT DATE"
  1. W !!," ============ Entry of ",Y," Range ============="
  1. W ! S DIR("A")="Enter STARTING "_Y_" for the Looping",DIR(0)="DO^::E" D ^DIR
  1. I $D(DIRUT)!$D(DIROUT) K ABMY("DT"),DIR Q
  1. S ABMY("DT",1)=Y
  1. W ! S DIR("A")="Enter ENDING DATE for the Looping" D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT) K ABMY("DT") Q
  1. S ABMY("DT",2)=Y
  1. I ABMY("DT",1)>ABMY("DT",2) W !!,*7,"INPUT ERROR: Start Date is Greater than than the End Date, TRY AGAIN!",!! G DT
  1. Q
  1. ;
  1. CLN ;EP for selecting CLINIC
  1. K ABMY("CLN"),DIC W ! S DIC="^DIC(40.7,",DIC(0)="QEAM" D ^DIC
  1. S:+Y>0 ABMY("CLN")=+Y
  1. Q
  1. ;
  1. VTYP ;EP for selecting Visit Type
  1. K ABMY("VTYP"),DIC W ! S DIC="^ABMDVTYP(",DIC(0)="QEAM" D ^DIC
  1. S:+Y>0 ABMY("VTYP")=+Y
  1. Q
  1. ;
  1. PRV ;EP for selecting Provider
  1. K ABMY("PRV"),DIC W ! S DIC="^VA(200,",DIC(0)="QEAM" D ^DIC
  1. S:+Y>0 ABMY("PRV")=+Y
  1. Q
  1. ;
  1. ELIG ;EP for selecting Bene Class
  1. K DIR S DIR(0)="SO^1:INDIAN BENEFICIARY PATIENTS;2:NON-BENEFICIARY PATIENTS"
  1. S DIR("A")="Select the PATIENT ELIGIBILITY STATUS"
  1. S DIR("?")="Selection of an Eligibility Status will restrict the report to only those visits in which the patient is of the type designated."
  1. D ^DIR K DIR Q:$D(DIRUT)
  1. S ABMY("PTYP")=Y,ABMY("PTYP","NM")=Y(0)
  1. Q
  1. RANGE ;
  1. K DIR,ABMY("RNG")
  1. STARTR W !!,"Select RANGE OF PATIENTS to display:"
  1. W ! S DIR("A")="Start with Patient Name"
  1. S DIR("?")="Response must be three alpha characters"
  1. S DIR(0)="F^3:3" D ^DIR
  1. I $D(DIRUT)!$D(DIROUT) K ABMY("RNG"),DIR Q
  1. S ABMCK=$$ALPHACK(Y)
  1. I ABMCK=0 W !!?4,"Must be alpha characters only! (NO numbers, punctuation, etc)" K Y G STARTR
  1. S ABMY("RNG",1)=$$UPC^ABMERUTL(Y)
  1. ENDR W !
  1. S DIR(0)="F^3:3"
  1. S DIR("?")="Response must be three alpha characters"
  1. S DIR("B")=$G(ABMY("RNG",1))
  1. S DIR("A")="Go to Patient Name" D ^DIR K DIR
  1. I $D(DIRUT)!$D(DIROUT) K ABMY("RNG") Q
  1. S ABMCK=$$ALPHACK(Y)
  1. I ABMCK=0 W !!?4,"Must be alpha characters only! (NO numbers, punctuaton, etc)" K Y G ENDR
  1. S ABMY("RNG",2)=$$UPC^ABMERUTL(Y)
  1. D SEQCK ;check if start name before go to name
  1. I '$D(ABMY("RNG")) W !!?4,"Invalid range...please try again!" G RANGE
  1. Q
  1. ALPHACK(X) ;
  1. N ABMI,ABMTST,ABMPCE
  1. N ABMCK
  1. S ABMCK=1
  1. S ABMTST=$$UPC^ABMERUTL(X)
  1. S ABMI=""
  1. F ABMI=1:1:$L(ABMTST) D
  1. .S ABMPCE=$E(ABMTST,ABMI)
  1. .I $A(ABMPCE)<65 S ABMCK=0 ;before A
  1. .I $A(ABMPCE)>90 S ABMCK=0 ;after Z
  1. Q ABMCK
  1. SEQCK ;
  1. K ABMPCE
  1. F ABMI=1,2 D
  1. .F ABMJ=1:1:3 D
  1. ..S ABMPCE(ABMI)=$G(ABMPCE(ABMI))_$A($E(ABMY("RNG",ABMI),ABMJ))
  1. I ABMPCE(1)>ABMPCE(2) K ABMY("RNG")
  1. Q