55 lines
2.0 KiB
Mathematica
55 lines
2.0 KiB
Mathematica
WVMSTL1 ;HCIOFO/FT-List Sexual Trauma Data (cont.) ;2/16/01 16:07
|
|
;;1.0;WOMEN'S HEALTH;**11,14**;Sep 30, 1998
|
|
;
|
|
PRINT ; Print list
|
|
U IO
|
|
S WVLINE=$$REPEAT^XLFSTR("-",79),(WVPAGE,WVPOP)=0
|
|
S WVDATE=$$FMTE^XLFDT($$NOW^XLFDT(),"2")
|
|
S WVUSER=$$PERSON^WVUTL1(DUZ),WVSORT=$S(WVE=0:"ONE",1:"ALL")
|
|
S WVTITLE="* LIST SEXUAL TRAUMA DATA *"
|
|
S WVCRT=$S($E(IOST)="C":1,1:0)
|
|
S WVTAB=$L(WVTITLE),WVTAB=(80-WVTAB)\2
|
|
I '$D(^TMP($J,"WVST")) D HDR Q:WVPOP D NODATA
|
|
I $D(^TMP($J,"WVST")) D HDR Q:WVPOP D DATA
|
|
I WVCRT&('$D(IO("S"))) D:'WVPOP DIRZ^WVUTL3 W @IOF
|
|
Q
|
|
HDR ; Report header
|
|
W:$Y>0 @IOF
|
|
S WVPAGE=WVPAGE+1
|
|
W !,?WVTAB,WVTITLE
|
|
W !,"Report Run by: "_WVUSER,?50," Page: "_WVPAGE
|
|
W !,"Case Mgr Sort: "_WVSORT,?50,"Run Date: "_WVDATE
|
|
W !!,"SSN",?14,"PATIENT",?41,"MST & CST VALUES"
|
|
W !,WVLINE
|
|
I $D(ZTQUEUED) D STOPCHK^WVUTL10(1) D ;stop background task?
|
|
.S:$G(ZTSTOP)=1 WVPOP=1
|
|
.Q
|
|
Q
|
|
NODATA ; no wh patient data found
|
|
W !,"<No patient data was found.>",!
|
|
Q
|
|
DATA ; Loop through TMP global
|
|
S (WVMGRN,WVMGRO)=""
|
|
F S WVMGRN=$O(^TMP($J,"WVST",WVMGRN)) Q:WVMGRN=""!(WVPOP) S WVMGR=0 F S WVMGR=$O(^TMP($J,"WVST",WVMGRN,WVMGR)) Q:'WVMGR!(WVPOP) D
|
|
.I WVMGRN'=WVMGRO D
|
|
..W:WVMGRO="" !! ;first cm
|
|
..W:WVMGRO]"" !!! ;subsequent cms
|
|
..W "CASE MGR: "_WVMGRN
|
|
..S WVMGRO=WVMGRN ;identify cm
|
|
..Q
|
|
.S WVMSTN=0
|
|
.F S WVMSTN=$O(^TMP($J,"WVST",WVMGRN,WVMGR,WVMSTN)) Q:'WVMSTN D
|
|
..S WVNAME=""
|
|
..F S WVNAME=$O(^TMP($J,"WVST",WVMGRN,WVMGR,WVMSTN,WVNAME)) Q:WVNAME=""!(WVPOP) S WVDFN=0 F S WVDFN=$O(^TMP($J,"WVST",WVMGRN,WVMGR,WVMSTN,WVNAME,WVDFN)) Q:'WVDFN!(WVPOP) D
|
|
...I ($Y+6)>IOSL D:WVCRT DIRZ^WVUTL3 Q:WVPOP D HDR Q:WVPOP
|
|
...S WVNODE=^TMP($J,"WVST",WVMGRN,WVMGR,WVMSTN,WVNAME,WVDFN)
|
|
...S WVSSN=$P(WVNODE,U,1),WVPROV=$P(WVNODE,U,2),WVVET=$P(WVNODE,U,3)
|
|
...S WVEC=$P(WVNODE,U,4),WVCST=$P(WVNODE,U,5),WVDGMST=$P(WVNODE,U,6)
|
|
...W !!,WVSSN,?14,WVNAME,?41,"MST= "_WVDGMST
|
|
...W !,"Pr. Provider => "_WVPROV,?41,"CST= "_WVCST
|
|
...W !,"Age: "_$$AGE^WVUTL9(WVDFN)_" / Veteran: "_WVVET_" / Eligibility: "_WVEC
|
|
...Q
|
|
..Q
|
|
.Q
|
|
Q
|