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

ABMPSTRD.m

Go to the documentation of this file.
  1. ABMPSTRD ; IHS/SD/SDR - Re-Print Selected Pt statements ;
  1. ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
  1. ;
  1. START ;
  1. K ABMY,ABMP
  1. S ABMP("XMIT")=0
  1. S ABMY("TOT")="0^0^0"
  1. W !!,"Re-Print Statements for:"
  1. K DIR
  1. S DIR(0)="SO^1:SELECTIVE STATEMENT(S);2:ALL STATEMENTS WITHIN APPROVED DATE RANGE;3:APPROVING OFFICIAL"
  1. S DIR("A")="Select Desired Option"
  1. D ^DIR
  1. K DIR
  1. G XIT:$D(DIRUT)!$D(DIROUT),SEL:Y=1,DTRANGE:Y=2
  1. ;
  1. APOFF ; by approving official
  1. K DIC,X,Y
  1. S DIC="^VA(200,"
  1. S DIC(0)="AEM"
  1. S DIC("A")="Approving Official: "
  1. D ^DIC
  1. I Y>0 S ABMY("AOFF",+Y)=""
  1. I '$O(ABMY("AOFF",0)) W !!,"NO APPROVING OFFICIAL SELECTED!" G START
  1. ;
  1. DTRANGE ; by date range
  1. W !
  1. S DIR("A")="Enter STARTING APPROVAL DATE for the Report"
  1. S DIR("B")=$$SDT^ABMDUTL(DT)
  1. S DIR(0)="DO^::EP"
  1. D ^DIR
  1. G START:($D(DIRUT)!$D(DIROUT))
  1. S ABMY("DT",1)=Y
  1. W !
  1. S DIR("A")="Enter ENDING APPROVAL DATE for the Report"
  1. D ^DIR
  1. K DIR
  1. G DTRANGE:$D(DIRUT)
  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 DTRANGE
  1. G ZIS
  1. ;
  1. SEL ; by individual bill
  1. W !!
  1. K DIC
  1. S DIC="^ABMDBILL(DUZ(2),"
  1. S DIC(0)="QZEAM"
  1. S ABMY=$G(ABMY)+1
  1. S ABM("E")=$E(ABMY,$L(ABMY))
  1. S DIC("A")="Select "_ABMY_$S(ABMY>3&(ABMY<21):"th",ABM("E")=1:"st",ABM("E")=2:"nd",ABM("E")=3:"rd",1:"th")_" BILL to Re-Print: "
  1. S DIC("S")="I $P(^(0),U)'=+^(0),""BTCP""[$P(^(0),""^"",4)"
  1. D BENT^ABMDBDIC ;returns ABMP("BDFN")
  1. G XIT:$D(DUOUT)!$D(DTOUT)
  1. I '$G(ABMP("BDFN")) G ZIS:ABMY>1,XIT
  1. I '$G(ABMP("BDFN")) S ABMY=ABMY-1 G SEL
  1. S ABMP("PDFN")=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U,5)
  1. D COVRG^ABMPTSMT
  1. I $G(ABMISNB)=0 D
  1. .K DIR
  1. .S DIR("A",1)="YOU HAVE SELECTED A STATEMENT FOR AN INDIAN BENEFICIARY."
  1. .S DIR("A")="DO YOU WISH TO CONTINUE PRINTING"
  1. .S DIR("B")="N"
  1. .S DIR(0)="Y"
  1. .D ^DIR
  1. Q:Y=0 ;don't print it-they are ben
  1. ; do they want to edit message at bottom of statement?
  1. W !!
  1. K DIR,X,Y
  1. S ABMMSG=$S(+$O(ABML(0))'=0:"Your insurance has been billed",$G(ABMABEN)=1:"Summary of services rendered",1:"First notice of balance due. Please remit payment promptly")
  1. S DIR("A",1)="This message will print on bottom of statement:"
  1. S DIR("A",2)=""
  1. S DIR("A",3)=ABMMSG
  1. S DIR("A",4)=""
  1. S DIR("A")="Would you like to edit it?"
  1. S DIR("B")="N"
  1. S DIR(0)="Y"
  1. D ^DIR K DIR
  1. I +Y>0 D
  1. .K X,Y
  1. .S DIR("A")=ABMMSG
  1. .S DIR(0)="F^0:70"
  1. .D ^DIR K DIR
  1. .I '$D(DIROUT),'$D(DUOUT),'$D(DTOUT),'$D(DIRUT) S ABMMSG=$G(X)
  1. ;
  1. S ABMY(ABMP("BDFN"))=ABMMSG
  1. G SEL
  1. ;
  1. ZIS ;
  1. W !!?15,"(NOTE: "
  1. W "Plain Paper needs"
  1. W " to be loaded in the printer.)"
  1. W !!
  1. S %ZIS("A")="Output DEVICE: "
  1. S %ZIS="PQ"
  1. D ^%ZIS
  1. G XIT:POP
  1. I IO'=IO(0),IOT'="HFS" D Q
  1. .D QUE2
  1. .D HOME^%ZIS
  1. U IO(0)
  1. W:'$D(IO("S")) !!,"Printing..."
  1. U IO
  1. G ENT
  1. ;
  1. QUE2 ;
  1. I IO=IO(0) W !,"Cannot Queue to Screen or Slave Printer!",! G ZIS
  1. S ZTRTN="TSK^ABMPSTRD"
  1. S ZTDESC="3P Re-Print of Selective Bill."
  1. F ABM="ZTRTN","ZTDESC","ABMP(","ABMY(" S ZTSAVE(ABM)=""
  1. D ^%ZTLOAD
  1. I $D(ZTSK) W !,"(Job Queued, Task Number: ",ZTSK,")"
  1. G OUT
  1. ;
  1. TSK ; Taskman Entry Point
  1. S ABMP("Q")=""
  1. ;
  1. ENT ;
  1. I '$D(ABMY("DT")) D G OUT
  1. .S ABMY=0
  1. .F S ABMY=$O(ABMY(ABMY)) Q:'ABMY D
  1. ..S ABMP("BDFN")=ABMY
  1. ..D STMTS
  1. S ABMYDT=$G(ABMY("DT",1))-.5
  1. F S ABMYDT=$O(^ABMDBILL(DUZ(2),"AP",ABMYDT)) Q:'ABMYDT!(ABMYDT>ABMY("DT",2)) D
  1. .S ABMP("BDFN")=0
  1. .F S ABMP("BDFN")=$O(^ABMDBILL(DUZ(2),"AP",ABMYDT,ABMP("BDFN"))) Q:'ABMP("BDFN") D
  1. ..; Quit if bill status is Reviewed, Approved, or Cancelled
  1. ..Q:"RAX"[$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U,4)
  1. ..;if approving official selected and not a match
  1. ..I $D(ABMY("AOFF")),$O(ABMY("AOFF",0))'=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),1)),U,4) Q
  1. ..Q:$G(^ABMDCLM(DUZ(2),+$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),0),U),0))="" ;manually created bill
  1. ..S ABMP("PDFN")=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U,5)
  1. ..K ABMISNB,ABMBEN
  1. ..D COVRG^ABMPTSMT
  1. ..I $G(ABMBEN)=1 Q ;don't print statements for bens when batching
  1. ..I ABMBILLD=1 Q ;has completed insurer; don't print when batching
  1. ..I +$O(ABML(0))'=0 S ABMY(ABMP("BDFN"))="Your insurance has been billed"
  1. ..D STMTS
  1. G OUT
  1. ;
  1. STMTS ; Reprint Statements
  1. K ABMP("PAYED")
  1. D @("^ABMPTSMT")
  1. Q
  1. ;
  1. OUT ;
  1. D ^%ZISC
  1. ;
  1. XIT ;
  1. K ABMP,ABMY,DIQ
  1. Q