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

ACHSTX6.m

Go to the documentation of this file.
ACHSTX6 ; IHS/ITSC/PMF - EXPORT DATA (7/9) - RECORD 6(PAY FOR AO) ;    [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;
 I $$PARM^ACHS(2,12)'="Y" G END
 W !!?10,"BUILDING ",$$REC^ACHSACO1(6)," : ",!?9
 S R=0
A1 ;
 S R=$O(^ACHSTXPD(R))
 G END:'R
 S ACHSDOCR=$G(^ACHSF(DUZ(2),"D",R,0)),ACHSRR=0
A2 ;
 S ACHSRR=$O(^ACHSTXPD(R,ACHSRR))
 G A1:'ACHSRR
 S ACHSTRAN=$G(^ACHSF(DUZ(2),"D",R,"T",ACHSRR,0))
 I $P(ACHSTRAN,U,2)'="P" G A2
 S ACHSDOCN=$P(ACHSDOCR,U,14)_ACHSFC_$E($P(ACHSDOCR,U)+100000,2,6)
 D TOS^ACHSTX8
 S ACHSFAC=ACHSAFAC,(X,X1)=$P(ACHSDOCR,U,8),ACHSEIN=$P($G(^AUTTVNDR(X,11)),U)_$P($G(^(11)),U,2),ACHSEIN=$E(ACHSEIN_$J("",12),1,12),ACHSFED=$S($P($G(^AUTTVNDR(X1,11)),U,10)=2:2,1:1)
 S ACHSPTYP="  ",X=$P($G(^AUTTVNDR($P(ACHSDOCR,U,8),11)),U,3)
 I +X,$D(^AUTTVTYP(X,0)) S ACHSPTYP=$P(^(0),U)
 S ACHSHRN=$P(ACHSDOCR,U,21)
 I ACHSHRN<1,$P(ACHSTRAN,U,3) S ACHSHRN=$$HRN^ACHS($P(ACHSTRAN,U,3),DUZ(2))
 S ACHSHRN=$E(ACHSHRN+1000000,2,7),ACHSCN=$E($P(ACHSDOCR,U,5)_$J("",10),1,10)
 D CANOBJ^ACHSTX8
 S ACHSDCR=$E($P(ACHSDOCR,U,19)+100,2,3),ACHSRCT=ACHSRCT+1,ACHSRTYP(6)=ACHSRTYP(6)+1
 S ^ACHSDATA(ACHSRCT)="6A"_ACHSDOCN_ACHSTOS2_$P(ACHSDOCR,U,2)_"6"_ACHSFAC_ACHSHRN_ACHSEIN_ACHSPTYP_ACHSFED_ACHSCN_ACHSCAN_ACHSOBJC_ACHSDCR_$J("",10)
 ;
 S X=$P(ACHSDOCR,U,9),X=$P(X,".",1)_$E($P(X,".",2)_"00",1,2),ACHSOAMT=$E(X+100000000,2,9)
 D IPA^ACHSTX8
 S ACHSIPA=$E(ACHSIPA,5,12),ACHSFULP=$S($P(ACHSTRAN,U,5)="P":2,1:1),X=$P(ACHSTRAN,U,3)
 G A3:+X<1,A4:$D(^DPT(X))
A3 ;
 S ACHSLNAM=$J("",20),ACHSFNAM=$J("",10)
 G A5
 ;
A4 ;
 S ACHSLNAM=$E($P($P($G(^DPT(X,0)),U),",")_$J("",20),1,20),ACHSFNAM=$E($P($P($G(^DPT(X,0)),U),",",2)_$J("",10),1,10)
A5 ;
 S ACHSWKLD=$E(+$P(ACHSTRAN,U,9)+1000,2,4),ACHSDOS=$P(ACHSTRAN,U,10) S:ACHSDOS="" ACHSDOS="       "
 S X=$P(ACHSTRAN,U,8),X=$P(X,".",1)_$E($P(X,".",2)_"00",1,2),ACHSTHRD=$E(X+100000000,2,9)
 S ACHSRCT=ACHSRCT+1
 S ^ACHSDATA(ACHSRCT)="6B"_ACHSOAMT_ACHSIPA_ACHSFULP_ACHSLNAM_ACHSFNAM_ACHSDOS_ACHSWKLD_ACHSTHRD_$J("",14)
 ;
 S ACHSRTYP(6)=ACHSRTYP(6)+1
 I ACHSRTYP(6)#10=0 W $J(ACHSRTYP(6),8)
 G A2
 ;
END ;
 K ACHSCN,ACHSDCR,ACHSDOCN,ACHSDOS,ACHSFNAM,ACHSFULP,ACHSHRN,ACHSIPA,ACHSLNAM,ACHSOAMT,ACHSSCC,ACHSTRAN,ACHSWKLD,ACHSTOS,ACHSPTYP
 S ACHSROUT=ACHSRCT
 G ^ACHSTX7
 ;