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

ABMUCUT2.m

Go to the documentation of this file.
ABMUCUT2 ; IHS/SD/SDR - 3PB/UFMS Cashiering Utilities - Part 2
 ;;2.6;IHS Third Party Billing;**14,21**;NOV 12, 2009;Build 379
 ; New routine - abm*2.6*14
 ; Cashiering Utilities
 ;IHS/SD/SDR - 2.6*21 - HEAT121470 - Updated to use a new x-ref for session status.  Taking
 ;    too long to look through all sessions and causing <STORE>FINDACLS+22^ABMUCUTL 
 ;
FINDAOPN ;EP - look for all open sessions
 ; 0 returned means no open sessions found
 ; anything else is list of open sessions (ABMO(SESSION#,DUZ,SDT)
 ;
 K ABMO
 S ABMLOC=$$FINDLOC^ABMUCUTL  ;what location to look under
 S ABMFD=0
 ;user entries
 ;S ABMUSER=0  ;abm*2.6*14 HEAT121470
 S ABMUSER=1  ;start at 1 to skip POS sess;  ;abm*2.6*21 IHS/SD/SDR HEAT121470
 ;F  S ABMUSER=$O(^ABMUCASH(ABMLOC,10,ABMUSER)) Q:+ABMUSER=0  D  ;abm*2.6*21 IHS/SD/SDR HEAT121470
 F  S ABMUSER=$O(^ABMUCASH(ABMLOC,"AC","O",ABMUSER)) Q:+ABMUSER=0  D  ;abm*2.6*21 IHS/SD/SDR HEAT121470
 .S ABMSDT=0
 .;F  S ABMSDT=$O(^ABMUCASH(ABMLOC,10,ABMUSER,20,ABMSDT)) Q:+ABMSDT=0  D  Q:ABMFD'=0  ;abm*2.6*21 IHS/SD/SDR HEAT121470
 .F  S ABMSDT=$O(^ABMUCASH(ABMLOC,"AC","O",ABMUSER,ABMSDT)) Q:+ABMSDT=0  D  Q:ABMFD'=0  ;abm*2.6*21 IHS/SD/SDR HEAT121470
 ..I $P($G(^ABMUCASH(ABMLOC,10,ABMUSER,20,ABMSDT,0)),U,3)'="" Q
 ..S ABMO(ABMSDT,ABMUSER,ABMSDT)=""
 ..S ABMAFLG=$$ACTIVCK^ABMUUTL(ABMLOC,ABMSDT,ABMUSER)  ;check for activity in session
 ..I +$G(ABMAFLG)'=0 S $P(ABMO(ABMSDT,ABMUSER,ABMSDT),U,3)=1
 ;look for POS entries
 ;start old abm*2.6*21 IHS/SD/SDR HEAT121470
 ;S ABMUSER=0
 ;F  S ABMUSER=$O(^ABMUCASH(ABMLOC,20,ABMUSER)) Q:+ABMUSER=0  D
 ;.S ABMSDT=0
 ;.F  S ABMSDT=$O(^ABMUCASH(ABMLOC,20,ABMUSER,20,ABMSDT)) Q:+ABMSDT=0  D  Q:ABMFD'=0
 ;..I $P($G(^ABMUCASH(ABMLOC,20,ABMUSER,20,ABMSDT,0)),U,3)'="" Q
 ;..S ABMO(ABMSDT,"POS",ABMSDT)=""
 ;end old start new abm*2.6*21 IHS/SD/SDR HEAT121470
 S ABMSDT=0,ABMUSER=1
 F  S ABMSDT=$O(^ABMUCASH(ABMLOC,"AC","O",1,ABMSDT)) Q:+ABMSDT=0  D  Q:ABMFD'=0
 .I $P($G(^ABMUCASH(ABMLOC,20,ABMUSER,20,ABMSDT,0)),U,3)'="" Q
 .S ABMO(ABMSDT,"POS",ABMSDT)=""
 ;end new abm*2.6*21 IHS/SD/SDR HEAT121470
 Q
FINDACLS ;EP - look for all closed sessions
 ; 0 returned means no closed sessions found
 ; anything else is list of closed sessions (ABMO(SESSION#,DUZ,SDT)
 ;
 K ABMO
 S ABMLOC=$$FINDLOC^ABMUCUTL  ;what location to look under
 S ABMFD=0
 ;start old abm*2.6*21 IHS/SD/SDR HEAT121470
 ;S ABMDUZ=0
 ;F  S ABMDUZ=$O(^ABMUCASH(ABMLOC,10,ABMDUZ)) Q:+ABMDUZ=0  D
 ;.S ABMSDT=0
 ;.F  S ABMSDT=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT)) Q:+ABMSDT=0  D  Q:ABMFD'=0
 ;..I $P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT,0)),U,3)="" Q
 ;..I $G(ABMFLG)="CLOSED",($P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT,0)),U,4))'="C" Q
 ;..S ABMO(ABMSDT,ABMDUZ,ABMSDT)=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT,0)),U,4)_"^"_$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT,0)),U,3)
 ;..S ABMAFLG=$$ACTIVCK^ABMUUTL(ABMLOC,ABMSDT,ABMDUZ)  ;check for activity in session
 ;..I +$G(ABMAFLG)'=0 S $P(ABMO(ABMSDT,ABMDUZ,ABMSDT),U,3)=1
 ;;POS entries
 ;S ABMSDT=0
 ;F  S ABMSDT=$O(^ABMUCASH(ABMLOC,20,1,20,ABMSDT)) Q:+ABMSDT=0  D  Q:ABMFD'=0
 ;.I $P($G(^ABMUCASH(ABMLOC,20,1,20,ABMSDT,0)),U,3)="" Q
 ;.I $G(ABMFLG)="CLOSED",($P($G(^ABMUCASH(ABMLOC,20,1,20,ABMSDT,0)),U,4))'="C" Q
 ;.S ABMO(ABMSDT,"POS",ABMSDT)=$P($G(^ABMUCASH(ABMLOC,20,1,20,ABMSDT,0)),U,4)_"^"_$P($G(^ABMUCASH(ABMLOC,20,1,20,ABMSDT,0)),U,3)
 ;end old start new abm*2.6*21 IHS/SD/SDR HEAT121470
 S X1=DT
 S X2="-"_$P($G(^ABMDPARM(DUZ(2),1,4)),U,16)  ;display number of days limit
 D C^%DTC
 S ABMDLIMT=X
 S ABMDUZ=1
 F ABMSTAT="C","T","R" D
 .F  S ABMDUZ=$O(^ABMUCASH(ABMLOC,"AC",ABMSTAT,ABMDUZ)) Q:+ABMDUZ=0  D
 ..S ABMSDT=0
 ..F  S ABMSDT=$O(^ABMUCASH(ABMLOC,"AC",ABMSTAT,ABMDUZ,ABMSDT)) Q:+ABMSDT=0  D  Q:ABMFD'=0
 ...I $G(ABMSESSL)'="C" Q:ABMSDT<ABMDLIMT
 ...I $P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT,0)),U,3)="" Q
 ...I $G(ABMFLG)="CLOSED",($P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT,0)),U,4))'="C" Q
 ...S ABMO(ABMSDT,ABMDUZ,ABMSDT)=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT,0)),U,4)_"^"_$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMSDT,0)),U,3)
 ...S ABMAFLG=$$ACTIVCK^ABMUUTL(ABMLOC,ABMSDT,ABMDUZ)  ;check for activity in session
 ...I +$G(ABMAFLG)'=0 S $P(ABMO(ABMSDT,ABMDUZ,ABMSDT),U,3)=1
 ;POS entries
 F ABMSTAT="C","T","R" D
 .S ABMSDT=0
 .F  S ABMSDT=$O(^ABMUCASH(ABMLOC,"AC",ABMSTAT,1,ABMSDT)) Q:+ABMSDT=0  D  Q:ABMFD'=0
 ..I $G(ABMSESSL)'="C" Q:ABMSDT<ABMDLIMT
 ..I $P($G(^ABMUCASH(ABMLOC,20,1,20,ABMSDT,0)),U,3)="" Q
 ..I $G(ABMFLG)="CLOSED",($P($G(^ABMUCASH(ABMLOC,20,1,20,ABMSDT,0)),U,4))'="C" Q
 ..S ABMO(ABMSDT,"POS",ABMSDT)=$P($G(^ABMUCASH(ABMLOC,20,1,20,ABMSDT,0)),U,4)_"^"_$P($G(^ABMUCASH(ABMLOC,20,1,20,ABMSDT,0)),U,3)
 ;end new abm*2.6*21 IHS/SD/SDR HEAT121470
 Q