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

BARRASMA.m

Go to the documentation of this file.
  1. BARRASMA ; IHS/SD/LSL - Age Summary Report Questions ;
  1. ;;1.8;IHS ACCOUNTS RECEIVABLE;**6,23***;OCT 26, 2005
  1. ;
  1. ; IHS/ASDS/LSL - 02/27/02 - Routine created
  1. ; Called from BARRASM
  1. ; ASK^BARRASMA - Ask all questions and define header array.
  1. ; PRINT^BARRASMA - Print report
  1. ;
  1. ; IHS/SD/LSL - 02/20/03 - V1.7 Patch 1
  1. ; Added DISCHARGE SERVICE sort and report. Add time run to report
  1. ; headers.
  1. ;
  1. ; IHS/SD/LSL - 08/01/03 - V1.7 Patch 2
  1. ; Add call to ASM^BAREISS to print of summary data
  1. ;
  1. ; IHS/SD/LSL - 11/24/03 - V1.7 Patch 4
  1. ; Add Visit Location Sort level to accomodate EISS
  1. ; Move print logic to BARRASMB. Routine too large
  1. ; ; MAR 2013 P.OTTIS ADDED NEW VA billing
  1. Q
  1. ; *********************************************************************
  1. ;
  1. ASK ; EP
  1. S BARA("LOC")=0
  1. S BARA("SORT")=0
  1. D MSG^BARRSEL ; Message about BILL/VIS loc
  1. D LOC^BARRSL1 ; Ask loc - return BARY("LOC")
  1. Q:$D(DTOUT)!($D(DUOUT)) ; Q if time or "^" out
  1. W:'$D(BARY("LOC")) "ALL"
  1. F D SORT Q:BARA("SORT") ; Ask sort criteria-required
  1. Q:'+$G(BARY("STCR")) ; No sort criteria specified - Q
  1. I BARY("STCR")=1 D Q
  1. . W !
  1. . D ARACCT^BARRSL2 ; Ask A/R Account-return BARY(
  1. I BARY("STCR")=2 D Q
  1. . W !
  1. . D CLIN^BARRSEL ; Ask clinic-return BARY("CLIN")
  1. I BARY("STCR")=3 D Q
  1. . W !
  1. . D VTYP^BARRSEL ; Ask Vis type-return BARY("VTYP")
  1. I BARY("STCR")=4 D Q
  1. . W !
  1. . D DSCHSVC^BARRSL2 ; Ask Discharge Svc-return BARY("DSCH")
  1. I BARY("STCR")=5 D
  1. . D ALL^BARRSL1 ; Ask allow cat-return BARY("ALL")
  1. . Q:$D(DTOUT)!($D(DUOUT))
  1. . W:'$D(BARY("ALL")) "ALL" ; If not select category, then ALL
  1. I BARY("STCR")=6 D
  1. . D TYP^BARRSL1 ; Ask billing entity
  1. . Q:$D(DTOUT)!($D(DUOUT))
  1. . W:('$D(BARY("TYP"))&'$D(BARY("ACCT"))&'$D(BARY("PAT"))) "ALL"
  1. I BARY("STCR")=7 D
  1. . D ITYP^BARRSL1 ; Ask ins type-return BARY("ITYP")
  1. . Q:$D(DTOUT)!($D(DUOUT))
  1. . W:'$D(BARY("ITYP")) "ALL" ; If not select ins type,ALL
  1. ; Ask rpt type (only if sort by allow cat/bill ent-return BARY("RTYP")
  1. Q:$D(DTOUT)!($D(DUOUT))
  1. D RTYP ; Ask report type
  1. ;I $D(BARY("ALL")) S BARY("ALL")=$S(BARY("ALL")=1:"R",BARY("ALL")=2:"D",BARY("ALL")=3:"P",BARY("ALL")=4:"K",1:"O")
  1. I $D(BARY("ALL")) S BARY("ALL")=$S(BARY("ALL")=1:"R",BARY("ALL")=2:"D",BARY("ALL")=3:"P",BARY("ALL")=4:"V",1:"O") ;P.OTT
  1. Q
  1. ; *********************************************************************
  1. ;
  1. SORT ;
  1. ; Ask how report should be sorted; clinic, visit, allowance category,
  1. ; or billing entity
  1. K DIR,BARY("STCR")
  1. S DIR(0)="S^1:A/R ACCOUNT"
  1. S DIR(0)=DIR(0)_";2:CLINIC TYPE"
  1. S DIR(0)=DIR(0)_";3:VISIT TYPE"
  1. S DIR(0)=DIR(0)_";4:DISCHARGE SERVICE"
  1. S DIR(0)=DIR(0)_";5:ALLOWANCE CATEGORY"
  1. S DIR(0)=DIR(0)_";6:BILLING ENTITY"
  1. S DIR(0)=DIR(0)_";7:INSURER TYPE"
  1. S DIR("A")="Select criteria for sorting"
  1. S DIR("?")="This is a required response. Enter ^ to exit"
  1. D ^DIR
  1. K DIR
  1. S:($D(DTOUT)!$D(DUOUT)) BARA("SORT")=1
  1. Q:Y<1
  1. S BARA("SORT")=1 ; The question was answered
  1. S BARY("STCR")=+Y
  1. S BARY("STCR","NM")=Y(0)
  1. ; Following lines needed for BARRCHK to work
  1. S:BARY("STCR")=2 BARY("SORT")="C"
  1. S:BARY("STCR")=3 BARY("SORT")="V"
  1. Q
  1. ; *********************************************************************
  1. ;
  1. RTYP ;
  1. ; Ask report type if user choose to sort by billing entity or
  1. ; allowance category
  1. S DIR(0)="S^1:Summarize by ALLOW CAT/BILL ENTITY/INS TYPE"
  1. S DIR(0)=DIR(0)_";2:Summarize by PAYER w/in ALLOW CAT/BILL ENTITY/INS TYPE"
  1. S DIR(0)=DIR(0)_";3:Summarize by BILL w/in PAYER w/in ALLOW CAT/BILL ENTITY/INS TYPE"
  1. S DIR("A")="Select REPORT TYPE"
  1. S DIR("B")=1
  1. S DIR("?",1)="Enter the selection that best describes the summary information desired"
  1. S DIR("?")="Enter ^ to exit"
  1. D ^DIR
  1. K DIR
  1. Q:Y<1
  1. S BARY("RTYP")=+Y
  1. S BARY("RTYP","NM")=Y(0)
  1. Q