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

ACHSOCSC.m

Go to the documentation of this file.
ACHSOCSC ; IHS/ITSC/PMF - COMPILE CHS SERVICE CLASS CODES SUMMARY ;   [ 10/14/2004  10:04 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**6,7,11**;JUNE 11,2001
 ;IHS/SET/JVK ACHS*3.1*6 7/1/03 NEW CODE TO BAL REGISTERS
 ;ITSC/SET/JVK ACHS*3.1*7 10-29-03 - ADD COUNT OF BLANKETS,PAID DOCS 
 ;ITSC/SET/JVK ACHS*3.1*11 ADD SORT BY FY & PAY END DATE
 ;
 K ^TMP("ACHSOCSQ",$J)
 ;IHS/SET/JVK ACHS*3.1*6 NEW CODE
 S ACHSOBX=0
 S ACHSZAT=0
 ;IHS/SET/JVK ACHS*3.1*6 END CODE
 S ACHSPSCC=0
 ;
 I ACHSBDT S ACHSBDTC=ACHSBDT-1 G BYDATES
 S ACHSFY1="1"_$E(ACHSFY,4)_"00000"
PONUM ;
 S ACHSFY1=$O(^ACHSF(ACHSFAC,"D","B",ACHSFY1))
 G:ACHSFY1="" ^ACHSOCSP
 I $E(ACHSFY1,2)'=$E(ACHSFY,4) G PONUM
 S ACHSDIEN=""
GETDEN ;
 S ACHSDIEN=$O(^ACHSF(ACHSFAC,"D","B",ACHSFY1,ACHSDIEN))
 G:ACHSDIEN="" PONUM
 D DOCUMENT
 G GETDEN
 ;
BYDATES ; 
A ;
 S ACHSBDTC=$O(^ACHSF(ACHSFAC,"TB",ACHSBDTC))
 G:+ACHSBDTC=0!(+ACHSBDTC>ACHSEDT) ^ACHSOCSP
B ;
 S ACHSDIEN=0
C ;
 S ACHSDIEN=$O(^ACHSF(ACHSFAC,"TB",ACHSBDTC,"I",ACHSDIEN))
 G A:+ACHSDIEN=0
 D DOCUMENT
 G C
 ;
DOCUMENT ;
 I '$D(^ACHSF(ACHSFAC,"D",ACHSDIEN,0)) Q
 I $P(^ACHSF(ACHSFAC,"D",ACHSDIEN,0),U,9)'>0 Q
 ;ITSC/SET/JVK ACHS*3.1*11 LINE BELOW
 I ACHSRTY=3,$P($G(^ACHSF(ACHSFAC,"D",ACHSDIEN,"PA")),U,3)>ACHSEDT Q
 ;
 D GETINFO
 Q
 ;
GETINFO ; Count docs, retrieve obligated and paid amounts.
 S ACHSOC=$P(^ACHSF(ACHSFAC,"D",ACHSDIEN,0),U,7)
 I '$D(^ACHS(3,ACHSFAC,1,ACHSOC,0)) Q
 S ACHSOC=$P(^ACHS(3,ACHSFAC,1,ACHSOC,0),U)_" -"_$P(^ACHS(3,ACHSFAC,1,ACHSOC,0),U,2)
 I '$D(^TMP("ACHSOCSQ",$J,ACHSFAC,ACHSOC)) S ^TMP("ACHSOCSQ",$J,ACHSFAC,ACHSOC)=""
 S ACHSPMT=$S($D(^ACHSF(ACHSFAC,"D",ACHSDIEN,"PA")):$P(^("PA"),U,1),1:0)
 ;IHS/SET/JVK ACHS*3.1*6 BEG NEW CODE
 ;I $D(^ACHSF(ACHSFAC,"D",ACHSDIEN,"PA")) S ACHSOB1=$S(+$P(^ACHSF(ACHSFAC,"D",ACHSDIEN,"PA"),U,2):$P(^("PA"),U,2),1:0) S ACHSOBX=ACHSOB1+ACHSOBX
 ;ITSC/SET/JVK ADD COUNT OF DOC'S PAID
 I $D(^ACHSF(ACHSFAC,"D",ACHSDIEN,"PA")) S ACHSOB1=$S(+$P(^ACHSF(ACHSFAC,"D",ACHSDIEN,"PA"),U,2):$P(^("PA"),U,2),1:0) S ACHSOBX=ACHSOB1+ACHSOBX,ACHSPSCC=ACHSPSCC+1
 ;I $D(^ACHSF(ACHSFAC,"D",ACHSDIEN,"ZA")) S ACHSADJ=$S($P(^ACHSF(ACHSFAC,"D",ACHSDIEN,"ZA"),U,2):$P(^("ZA"),U,2),1:0) S ACHSPMT=ACHSPMT+ACHSADJ
 I $D(^ACHSF(ACHSFAC,"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