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

BWPCC2.m

Go to the documentation of this file.
BWPCC2 ;IHS/ANMC/MWR - WOMEN'S HEALTH PCC LINK;15-Feb-2003 22:07;PLS
 ;;2.0;WOMEN'S HEALTH;**8,13**;APR 19, 1996;Build 9
 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
 ;;  SELECT AND PRINT THE POINTERS OF WOMEN'S HEALTH PROCEDURES TO
 ;;  TABLE FILES: ICD OP/PROC, LAB TEST, EXAM, RADIOLOGY PROCEDURES.
 ;
EDIT ;EP
 ;---> EDIT PROCEDURE PCC .01 POINTERS.
 D SETVARS^BWUTL5
 N A,DR,Y
 F  D  Q:$G(Y)<0
 .D TITLE^BWUTL5("EDIT WOMEN'S HEALTH PROCEDURE POINTERS")
 .S A="   Select WOMEN'S HEALTH PROCEDURE: "
 .D DIC^BWFMAN(9002086.2,"QEMAZ",.Y,A)
 .Q:Y<0
 .S BWVFIL=$P(Y(0),U,12)
 .I 'BWVFIL D  Q
 ..W !!?5,"This procedure is not set up for export to PCC."
 ..D DIRZ^BWUTL3 K Y
 .D
 ..I BWVFIL=9000010.08 S DR=".14" Q
 ..I BWVFIL=9000010.09 S DR=".15" Q
 ..I BWVFIL=9000010.13 S DR=".16" Q
 ..I BWVFIL=9000010.22 S DR=".17" Q
 ..I BWVFIL=9000010.18 S DR=".08" Q
 .D DIE^BWFMAN(9002086.2,DR,+Y,.BWPOP)
 .D DIRZ^BWUTL3
 D EXIT
 Q
 ;
 ;
PRINT ;EP
 ;---> DISPLAY PROCEDURE PCC .01 POINTERS.
 D SETUP
 D TITLE^BWUTL5("PROCEDURE TYPES AND THEIR PCC .01 VALUES")
 D DEVICE Q:BWPOP
 D DATA
 D DISPLAY
 D EXIT
 Q
 ;
SETUP ;EP
 D SETVARS^BWUTL5 S BWPOP=0
 S BWLINE="-" F I=1:1:79 S BWLINE=BWLINE_"-"
 Q
 ;
DEVICE ;EP
 ;---> GET DEVICE AND POSSIBLY QUEUE TO TASKMAN.
 S ZTRTN="DEQUEUE^BWPCC2"
 D ZIS^BWUTL2(.BWPOP,1)
 Q
 ;
 ;
DISPLAY ;EP
 U IO
 S BWTITLE1="*  WOMEN'S HEALTH: "
 S BWTITLE1=BWTITLE1_"PROCEDURE TYPES AND THEIR PCC .01 VALUES  *"
 D CENTERT^BWUTL5(.BWTITLE1)
 S BWCRT=$S($E(IOST)="C":1,1:0),(BWPAGE,BWPOP)=0
 S BWSUB="W !?3,""WH PROCEDURE"",?29,""PCC .01 VALUE"""
 S BWSUB=BWSUB_",?64,""PCC TABLE FILE"""
 ;
 S (BWPOP,N,Z)=0
 W:BWCRT @IOF D HEADER
 F  S N=$O(^TMP("BW",$J,N)) Q:'N!(BWPOP)  D
 .I $Y+8>IOSL D:BWCRT DIRZ^BWUTL3 Q:BWPOP  D HEADER
 .W !!,^TMP("BW",$J,N,0)
 I BWCRT&('BWPOP) W !! D DIRZ^BWUTL3
 W:'BWCRT @IOF
 D ^%ZISC
 K ^TMP("BW",$J)
 Q
 ;
 W:BWPAGE @IOF S BWPAGE=BWPAGE+1
 W !,BWTITLE1,?71,"PAGE ",BWPAGE
 W !,BWLINE X BWSUB W !,BWLINE
 Q
 ;
DEQUEUE ;EP
 ;---> CALLED BY TASKMAN
 D SETUP,DATA,DISPLAY,EXIT
 Q
 ;
DATA ;EP
 ;---> SORT PROCEDURE TYPE FILE POINTERS.
 N BWNODE,N,P,X,Y,Z K ^TMP("BW",$J)
 ;---> LOOP THROUGH BW PROCEDURE FILE.
 S N=0
 F I=1:1 S N=$O(^BWPN("B",N)) Q:N=""  D
 .;
 .S Y=$O(^BWPN("B",N,0)),Y=^BWPN(Y,0),BWNODE=""
 .S BWNODE=$E($P(Y,U),1,24)
 .;
 .;---> X=V FILE POINTER.
 .S X=$P(Y,U,12)
 .I 'X S BWNODE=BWNODE_U_"NOT SET UP FOR PCC"
 .;
 .;---> Z=PCC TABLE FILE POINTER.
 .S Z=0
 .I X D
 ..Q:'$D(^DD(X,.01,0))
 ..S Z=+$P($P(^DD(X,.01,0),U,2),"P",2)
 .I ('Z)&(X) S BWNODE=BWNODE_U_"PROBLEM W/FILE"
 .;
 .;---> P=PCC TABLE FILE GLOBAL.
 .S:Z P=^DIC(Z,0,"GL")
 .D:(X&(Z))
 ..;---> V PROCEDURE PTR.
 ..I X=9000010.08 D  Q
 ...I '$P(Y,U,14) S BWNODE=BWNODE_U_"POINTER VALUE NOT SELECTED" Q
 ...S BWNODE=BWNODE_U_$E($P(@(P_$P(Y,U,14)_",0)"),U,4),1,24)
 ...S BWNODE=BWNODE_" ("_$P(@(P_$P(Y,U,14)_",0)"),U)_")" Q
 ..;
 ..;---> V LAB PTR.
 ..I X=9000010.09 D  Q
 ...I '$P(Y,U,15) S BWNODE=BWNODE_U_"POINTER VALUE NOT SELECTED" Q
 ...S BWNODE=BWNODE_U_$P(@(P_$P(Y,U,15)_",0)"),U) Q
 ..;
 ..;---> V EXAM PTR.
 ..I X=9000010.13 D  Q
 ...I '$P(Y,U,16) S BWNODE=BWNODE_U_"POINTER VALUE NOT SELECTED" Q
 ...S BWNODE=BWNODE_U_$P(@(P_$P(Y,U,16)_",0)"),U)
 ...S BWNODE=BWNODE_" ("_$P(@(P_$P(Y,U,16)_",0)"),U,2)_")"
 ..;
 ..;---> V RADIOLOGY PTR.
 ..I X=9000010.22 D  Q
 ...I '$P(Y,U,17) S BWNODE=BWNODE_U_"POINTER VALUE NOT SELECTED" Q
 ...S P=P_$P(Y,U,17)_",0)" I '$D(@P) D  Q
 ....S BWNODE=BWNODE_U_"POINTED TO ENTRY DOES NOT EXIST"
 ...S BWNODE=BWNODE_U_$E($P(@(P),U),1,24)
 ...S BWNODE=BWNODE_" ("_$P(@(P),U,9)_")"
 ..;---> V CPT PTR
 ..I X=9000010.18 D  Q
 ...I '$P(Y,U,8) S BWNODE=BWNODE_U_"POINTER VALUE NOT SELECTED" Q
 ...S P=P_$P(Y,U,8)_",0)" I '$D(@P) D  Q
 ....S BWNODE=BWNODE_U_"POINTED TO ENTRY DOES NOT EXIST"
 ...S BWNODE=BWNODE_U_$E($P(@(P),U,2),1,24)
 ...S BWNODE=BWNODE_" ("_$P(@(P),U)_")" Q
 ..;
 ..;---> NOTHING.
 ..S BWNODE=BWNODE_U
 .;
 .S:(X&(Z)) BWNODE=BWNODE_U_$E($P(^DIC(Z,0),U),1,15)
 .;
 .D FORMAT(.BWNODE)
 .S ^TMP("BW",$J,I,0)=BWNODE
 Q
 ;
FORMAT(Y) ;EP
 ;---> INSERT NECESSARY SPACING FOR COLUMNS.
 N A,B,C
 S A=$P(Y,U),B=$P(Y,U,2),C=$P(Y,U,3)
 S Y="   "_A_$$S(26-$L(A))_B_$$S(35-$L(B))_C
 Q
 ;
S(S) ;EP
 ;---> SPACES.
 Q $$S^BWUTL7($G(S))
 ;
EXIT ;EP
 D KILLALL^BWUTL8
 Q