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

ACHSCPTX.m

Go to the documentation of this file.
ACHSCPTX ;IHS/ITSC/PMF - FIX CPT DANGLING X-REF;JUL 10, 2008
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**5,14**;JUN 11,2001
 ;IHS/SET/GTH ACHS*3.1*5 12/06/2002 - Non-supported Kernel node.
 ;3.1*14 12.4.2007 IHS/OIT/FCJ ADDED CSV CHANGES
 ;FOLLOWING CODE FROM DENNIS AT BILLINGS
AZBADCPT ; ;[ 02/07/2001  11:31 AM ]
 ;Loop through the CPT file to look for non-DINUM'ed entries.
 D ^%ZIS
 U IO
 W !,$P($G(^DIC(4,DUZ(2),0)),U),!!
 S ICPTNODE=0
 F  S ICPTNODE=$O(^ICPT(ICPTNODE)) Q:'ICPTNODE  D
 .I ICPTNODE<100000 D
 ..;3.1*14 12.4.2007 IHS/OIT/FCJ ADDED CSV CHANGES NXT 2 LINES
 ..;S X=$P($G(^ICPT(ICPTNODE,0)),U)
 ..S X=$P($$CPT^ICPTCOD(ICPTNODE),U,2)
 ..S Y=ICPTNODE
 ..I $L(Y)=1 S Y="0000"_Y
 ..I $L(Y)=2 S Y="000"_Y
 ..I $L(Y)=3 S Y="00"_Y
 ..I $L(Y)=4 S Y="0"_Y
 ..;3.1*14 12.19.2007 IHS/OIT/FCJ ADDED CSV CHANGES NXT 2 LINES
 ..;I X'=Y W !,"Node is: ",ICPTNODE,"    Code should be: ",Y,!,^ICPT(ICPTNODE,0),! S ^ACHSCPTX(ICPTNODE)="",ACHSCPTX("GOOD CODE?",ICPTNODE,Y)=""
 ..I X'=Y W !,"Node is: ",ICPTNODE,"    Code should be: ",Y,!,$P($$CPT^ICPTCOD(ICPTNODE),U,2),! S ^ACHSCPTX(ICPTNODE)="",ACHSCPTX("GOOD CODE?",ICPTNODE,Y)=""
 .I ICPTNODE>100000 D
 ..;3.1*14 12.4.2007 IHS/OIT/FCJ ADDED CSV CHANGES NXT 2 LINES
 ..;S X=$P($G(^ICPT(ICPTNODE,0)),U)
 ..S X=$P($$CPT^ICPTCOD(ICPTNODE),U,2)
 ..S X=$A($E(X,1))_$E(X,2,99)
 ..I X'=ICPTNODE D
 ...W !,"Node is: ",ICPTNODE
 ...;3.1*14 12.4.2007 IHS/OIT/FCJ ADDED CSV CHANGES NXT 6 LINES
 ...;I $E(ICPTNODE,1,2)<43 W "    No Code should be here",!,$G(^ICPT(ICPTNODE,0)),! S ^ACHSCPTX(ICPTNODE)="" Q
 ...I $E(ICPTNODE,1,2)<43 W "    No Code should be here",!,$P($$CPT^ICPTCOD(ICPTNODE),U,2),! S ^ACHSCPTX(ICPTNODE)="" Q
 ...;I $E(ICPTNODE,1,2)>96 W "    No Code should be here",!,$G(^ICPT(ICPTNODE,0)),! S ^ACHSCPTX(ICPTNODE)="" Q
 ...I $E(ICPTNODE,1,2)>96 W "    No Code should be here",!,$P($$CPT^ICPTCOD(ICPTNODE),U,2),! S ^ACHSCPTX(ICPTNODE)="" Q
 ...;W "    Code should be ",$C($E(ICPTNODE,1,2))_$E(ICPTNODE,3,6),!,$G(^ICPT(ICPTNODE,0)),! S ^ACHSCPTX("GOOD CODE?",ICPTNODE,$C($E(ICPTNODE,1,2))_$E(ICPTNODE,3,6))=""
 ...W "    Code should be ",$C($E(ICPTNODE,1,2))_$E(ICPTNODE,3,6),!,$P($$CPT^ICPTCOD(ICPTNODE),U,2),! S ^ACHSCPTX("GOOD CODE?",ICPTNODE,$C($E(ICPTNODE,1,2))_$E(ICPTNODE,3,6))=""
 ;X ^%ZIS("C");IHS/SET/GTH ACHS*3.1*5 12/06/2002
 D ^%ZISC ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 ;D CHSFAC
 Q
 ;
 ;
 ;GO THROUGH 'CHS FACILITY' FILE AND PULL CPT POINTERS
CHSFAC ;
 S U="^"
 S (MAYBECNT,BADCNT,NPTFOUND,FOUND,CPTCNT,UNKNOWN)=0
 S FACILITY=0
 F  S FACILITY=$O(^ACHSF(FACILITY)) Q:+FACILITY=0  D
 .;
 .S DOCUMENT=0
 .F DOCCNT=1:1 S DOCUMENT=$O(^ACHSF(FACILITY,"D",DOCUMENT)) Q:+DOCUMENT=0  D
 ..;W !,DOCUMENT
 ..S CPTMULT=0
 ..F  S CPTMULT=$O(^ACHSF(FACILITY,"D",DOCUMENT,11,CPTMULT)) Q:+CPTMULT=0  D
 ...S CPTINFO=$G(^ACHSF(FACILITY,"D",DOCUMENT,11,CPTMULT,0))
 ...W !,CPTINFO
 ...Q:CPTINFO=""!(CPTINFO'[("ICPT"))
 ...S CODE=$P($P(CPTINFO,";"),U)
 ...S CPTCNT=CPTCNT+1   ;NUMBER OF CPT ENTRIES IN THE CHS GLOBAL
 ...;
 ...;I $D(^ACHSCPTX(CODE)) S BADCNT=BADCNT+1 W !,"IN BAD CODE FILE ",CODE
 ...;I $D(^ACHSCPTX("GOOD CODE?",CODE)) W !,"POSSIBLE GOOD ENTRY TO BE FOUND ",CODE S MAYBECNT=MAYBECNT+1
 ...;I $L(CODE)=1 S Y="0000"_CODE
 ...;I $L(CODE)=2 S Y="000"_CODE
 ...;I $L(CODE)=3 S Y="00"_CODE
 ...;I $L(CODE)=4 S Y="0"_CODE
 ...;I $D(^ACHSCPTX(CODE)) S BADCNT=BADCNT+1 W !,"IN BAD FILE ",CODE
 ...;I $D(^ACHSCPTX("GOOD CODE?",CODE)) W !,"POSSIBLE GOOD ENTRY TO BE FOUND ",CODE S MAYBECNT=MAYBECNT+1
 ...;S ROOT=U_$P($P(CPTINFO,";",2),U)
 ...;S GLOBAL=ROOT_CODE_",0)"
 ...;
 ;
 ;
 Q