74 lines
2.0 KiB
Mathematica
74 lines
2.0 KiB
Mathematica
WVBRDUP ;HCIOFO/FT,JR IHS/ANMC/MWR - BROWSE DUPLICATE PROCEDURES;
|
|
;;1.0;WOMEN'S HEALTH;;Sep 30, 1998
|
|
;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
|
|
;; CALLED BY OPTION: "WV BROWSE PROCEDURES DUPLICATE" TO IDENTIFY,
|
|
;; LIST AND BROWSE POSSIBLE DUPLICATE PROCEDURES.
|
|
;
|
|
;---> USE ^WVBRPCD ROUTINES FOR DISPLAY (NODES 1 & 2 IN ^TMP GLOBAL).
|
|
;
|
|
D SETVARS
|
|
D TITLE^WVUTL5("BROWSE PROCEDURES FOR POSSIBLE DUPLICATES")
|
|
D DEVICE G:WVPOP EXIT
|
|
D SORT
|
|
D COPYGBL^WVBRPCD
|
|
D DISPLAY^WVBRPCD1(WVTITLE,WVHEADER,WVCODE)
|
|
;
|
|
EXIT ;EP
|
|
D KILLALL^WVUTL8
|
|
Q
|
|
;
|
|
SETVARS ;EP
|
|
;---> SET REQUIRED VARIABLES.
|
|
D SETVARS^WVUTL5 S WVPOP=0
|
|
S WVTITLE="* * * DUPLICATE PROCEDURES LISTED BY PATIENT * * *"
|
|
;---> SET CODE EXCECUTED BY DIR PROMPT.
|
|
S WVCODE="D EDIT^WVBRPCD1,SORT^WVBRDUP,COPYGBL^WVBRPCD"
|
|
;---> SET LINE LABEL IN ^WVUTL7 TO CALL AS HEADER.
|
|
S WVHEADER="HEADER6"
|
|
Q
|
|
;
|
|
SORT ;EP
|
|
;---> SORT AND STORE ARRAY IN ^TMP("WV",$J
|
|
K ^TMP("WV",$J) N WVDFN,WVIEN,WVPCD,WVPCDS,N,M,P,Y
|
|
S WVDFN=0
|
|
F S WVDFN=$O(^WV(790.1,"C",WVDFN)) Q:'WVDFN D
|
|
.;
|
|
.;---> GATHER ALL PROCEDURES FOR THIS PATIENT INTO WVPCDS ARRAY.
|
|
.S WVIEN=0 K WVPCDS
|
|
.F S WVIEN=$O(^WV(790.1,"C",WVDFN,WVIEN)) Q:'WVIEN D
|
|
..;---> SET Y=THE ZERO NODE FOR THIS PROCEDURE.
|
|
..S Y=^WV(790.1,WVIEN,0)
|
|
..;---> QUIT IF THIS PROCEDURE HAS A RESULT OF "ERROR/DISREGARD".
|
|
..Q:$P(Y,U,5)=8
|
|
..;---> GET DATE.
|
|
..S WVPCD=$P(Y,U,4),WVDATE=$P($P(Y,U,12),".")
|
|
..S WVPCDS(WVDFN,WVDATE,WVPCD,WVIEN)=""
|
|
.;
|
|
.;---> NOW CHECK WVPCDS ARRAY FOR DUPLICATES.
|
|
.S N=0
|
|
.F S N=$O(WVPCDS(WVDFN,N)) Q:'N D
|
|
..S M=0
|
|
..F S M=$O(WVPCDS(WVDFN,N,M)) Q:'M D
|
|
...S P=0
|
|
...F I=0:1 S P=$O(WVPCDS(WVDFN,N,M,P)) Q:'P
|
|
...Q:I'>1
|
|
...S P=0
|
|
...F S P=$O(WVPCDS(WVDFN,N,M,P)) Q:'P D
|
|
....S Y=^WV(790.1,P,0) D STORE^WVBRPCD(2,P,Y)
|
|
Q
|
|
;
|
|
DEQUEUE ;EP
|
|
;---> FOR TASKMAN QUEUE OF PRINTOUT.
|
|
D SETVARS,SORT,COPYGBL^WVBRPCD
|
|
D DISPLAY^WVBRPCD1(WVTITLE,WVHEADER,WVCODE)
|
|
D EXIT
|
|
Q
|
|
;
|
|
DEVICE ;EP
|
|
;---> GET DEVICE AND POSSIBLY QUEUE TO TASKMAN.
|
|
S ZTRTN="DEQUEUE^WVBRDUP"
|
|
F WVSV="HEADER" D
|
|
.I $D(@("WV"_WVSV)) S ZTSAVE("WV"_WVSV)=""
|
|
D ZIS^WVUTL2(.WVPOP,1,"HOME")
|
|
Q
|