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

ACHSURT.m

Go to the documentation of this file.
ACHSURT ; IHS/ITSC/TPF/PMF - SELECT/DISPLAY RATE QUOTATIONS ;  
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**15**;JUN 11, 2001
 ;ACHS*3.1*15;IHS.OIT.FCJ MODIFIED FORMAT FOR DISPLAYING RATE AND CONTRACT NUMBER NEW LENGTH
 ;
A1 ;EP
 S ACHSI=""
 S:'$D(ACHSCTNA) ACHSCTNA=0
A1A ;
 S ACHSI=$O(^AUTTVNDR(ACHSPROV,18,"AGR",ACHSI))
 Q:ACHSI=""
 S ACHSJ=""
A1C ;
 S ACHSJ=$O(^AUTTVNDR(ACHSPROV,18,"AGR",ACHSI,ACHSJ))
 G A1A:ACHSJ=""
 S X=$G(^AUTTVNDR(ACHSPROV,18,ACHSJ,0))   ;GET 'AGREEMENT/RATE/BPA NUMBER NODE
 S:'$D(ACHSRT(ACHSI)) ACHSRT(ACHSI)=0
 S ACHSRT(ACHSI)=ACHSRT(ACHSI)+1
 ;
 ;IF 'EFFECTIVE DATE' > EST. DATE OF SERVICE
 ;OR EST. DATE OF SERVICE > 'EXPIRATION DATE'
 I ($P(X,U,8)>ACHSEDOS)!(ACHSEDOS>$P(X,U,9)) G A1C
A1D ;
 S ACHSCTNA=ACHSCTNA+1
 S ACHSRT(ACHSCTNA)=X
 S:'$D(ACHSRT(ACHSI,"ACTIVE")) ACHSRT(ACHSI,"ACTIVE")=0
 S ACHSRT(ACHSI,"ACTIVE")=$G(ACHSRT(ACHSI,"ACTIVE"))+1
 S:'$D(ACHSRT(0,"ACTIVE")) ACHSRT(0,"ACTIVE")=0
 S ACHSRT(0,"ACTIVE")=ACHSRT(0,"ACTIVE")+1
 S ACHSRT(ACHSI)=$G(ACHSRT(ACHSI))+1
 S X=$P(ACHSRT(ACHSCTNA),U,6),Y=$E(X,4,5)_"-"_$E(X,6,7)_"-"_$E(X,2,3),$P(ACHSRT(ACHSCTNA),U,6)=Y
 S X=$P(ACHSRT(ACHSCTNA),U,8),Y=$E(X,4,5)_"-"_$E(X,6,7)_"-"_$E(X,2,3),$P(ACHSRT(ACHSCTNA),U,8)=Y
 S X=$P(ACHSRT(ACHSCTNA),U,9),Y=$E(X,4,5)_"-"_$E(X,6,7)_"-"_$E(X,2,3),$P(ACHSRT(ACHSCTNA),U,9)=Y
 S $P(ACHSRT(ACHSCTNA),U,11)=ACHSJ
 G A1C
 ;
A2 ;EP
 I ACHSCTNA=1 S ACHSAGRN=1,ACHSAGRP=$P(ACHSRT(ACHSCTNA),U,11) G A2A
 G A3:'ACHSAGRN
A2A ;
 W !!,"Enter Corresponding CONTRACT, AGREEMENT OR RATE QUOTE #. "
 I ACHSAGRN,$D(ACHSRT(ACHSAGRN)) S ACHSI=ACHSAGRN,ACHSJ=$P(ACHSRT(ACHSAGRN),U,10) D NODISP W Y,"// "
 D READ^ACHSFU
 G:(Y?1"?".E)!(Y="?") A3
 I Y="@" S (ACHSAGRN,ACHSAGRP)="" W "  DELETED" Q
 S Y=$E(Y)
 Q:$D(DUOUT)!$D(DTOUT)!(Y="")
 I (Y>ACHSCTNA)!(Y<1) W !!,"Please enter 1 thru "_ACHSCTNA_" " G A2A
 S ACHSAGRN=+Y,ACHSAGRP=$P(ACHSRT(+Y),U,11),ACHSCONP=""
 S:$P(ACHSRT(+Y),U,10)="CNT" ACHSCONP=ACHSAGRP,ACHSAGRP=""
 G A2A
 ;
A3 ;
 D HDR:'$D(ACHSAHDR)
 S ACHSI=C
 I ACHSCTNA>C S ACHSI=0
A3B ;
 S ACHSI=$O(ACHSRT(ACHSI))
 G A2A:+ACHSI=0
 S ACHSJ=$P(ACHSRT(ACHSI),U,10)
 W !,$J(ACHSI,2),?3,ACHSJ
 D NODISP                    ;BPA AGREEMENT NUMBER DISPLAY
 ;W ?9,Y
 W ?8,Y
A3C ;
 W ?27,$P(ACHSRT(ACHSI),U,8),?36,$P(ACHSRT(ACHSI),U,9)
 I ACHSJ="CNT" W ?49,$P(ACHSRT(ACHSI),U,2),! G A3B
 S X=$P(ACHSRT(ACHSI),U,4)
 I X="",($P(ACHSRT(ACHSI),U,2)="") G A3D
 S Y=$S(X="Y":"YES",X="N":" NO",1:"   ")
 I Y="   ",$P(ACHSRT(ACHSI),U,2)="" G A3D
 S Y=Y_"INP: "
 S:$P(ACHSRT(ACHSI),U,2)'="" Y=Y_$P(ACHSRT(ACHSI),U,2)
 W ?46,Y,!
A3D ;
 S X=$P(ACHSRT(ACHSI),U,5)
 I X=""&($P(ACHSRT(ACHSI),U,3)="") G A3E
 S Y=$S(X="Y":"YES",X="N":" NO",1:"   ")
 I Y="   ",$P(ACHSRT(ACHSI),U,3)="" G A3E
 S Y=Y_"  OUT: "
 S:$P(ACHSRT(ACHSI),U,3)'="" Y=Y_$P(ACHSRT(ACHSI),U,3)
 W ?46,Y,!
A3E ;
 W:$P(ACHSRT(ACHSI),U,7)'="" ?49,"PRO: ",$P(ACHSRT(ACHSI),U,7),!
 G A3B
 ;
EXIT ;
 K Y,X,ACHSCT
 Q
 ;
HDR ;
 ;W !!," #",?3,"Type",?9,"Number",?20,"Eff-Date",?30,"Exp-Date",?40,"MCR",?45,"Description",!?3,"----",?9,"---------",?20,"--------",?30,"--------",?40,"---",?45,"----------------------------"
 W !!," #",?3,"Type",?14,"Number",?27,"Eff-Date",?36,"Exp-Date",?45,"MCR",?49,"Description",!?3,"----",?8,"------------------",?27,"--------",?36,"--------",?45,"---",?49,"----------------------------"
 Q
 ;
NODISP ;DISPLAY BPA AGREEMENT STUFF
 S Y=""
 I ACHSJ="CNT" S Y=$P(ACHSRT(ACHSI),U) Q
 S Y=$E($P(ACHSRT(ACHSI),U),1,2)_$S(ACHSJ="BPA":"-A-",ACHSJ="PA":"-PA-",ACHSJ="RQ":"-R-",1:"")
 S X=$E($P(ACHSRT(ACHSI),U),3,6)
 I ACHSJ="RQ",$L($P(ACHSRT(ACHSI),U))>6 S Y=$P(ACHSRT(ACHSI),U) Q  ;ACHS*3.1*15 IHS.OIT.FCJ ADDED FOR NEW FORMAT OF RATE #
 I ACHSJ="PA" S Y=$S($L($P(ACHSRT(ACHSI),U))>6:$P(ACHSRT(ACHSI),U),1:Y_$E(X,2,4)) Q  ;ACHS*3.1*15 IHS.OIT.FCJ
 S Y=Y_$E(X,1,4)
 Q
 ;