1 | YSHX1R ;SLC/DKG,SLC/TGA-HISTORY OF PRESENT ILLNESS REPORT ;11/19/90 16:30 ;08/12/93 17:25
|
---|
2 | ;;5.01;MENTAL HEALTH;;Dec 30, 1994
|
---|
3 | ;
|
---|
4 | ; Called by routine YSHX1
|
---|
5 | S YSIDT=9999999-YSDT,%ZIS="Q" K IOP D ^%ZIS G:POP END^YSHX1
|
---|
6 | I $D(IO("Q")) S ZTRTN="ENPRINT^YSHX1R",ZTSAVE("YS*")="",ZTDESC="YS HX1 PRINT" D ^%ZTLOAD G END^YSHX1
|
---|
7 | ENPRINT ;
|
---|
8 | S YSP0=$S(IOST?1"P".E:1,1:0),YSPF=$S(YSP0:8,1:3),YSFHDR="History of Present Illness",YSFTR="SF 504",YSCON=0,YSLFT=0 U IO D ENHD^YSFORM
|
---|
9 | K YSUSN S YSPT=1 D FU S YSUS=0
|
---|
10 | CP1 ;
|
---|
11 | S YSUS=$O(YSUSN(YSUS)) G:'YSUS HP S YSUSER=$P(YSUSN(YSUS),U)
|
---|
12 | S DIC="^PTX(YSDFN,YSHX,YSIDT,1,YSUSER,YSPT,1,1,"
|
---|
13 | S DIWL=1,DIWR=80,DIWF="W",DWI="F D=1:1:DW2 S X="_DIC_"D,0) D:$Y+YSPF>IOSL CK Q:YSLFT D ^DIWP"
|
---|
14 | U IO D DT G:YSLFT END^YSHX1 W ?32,"CHIEF COMPLAINT:" D DIWP G:YSLFT END^YSHX1 D UNM G:YSLFT END^YSHX1 D:$Y+YSPF>IOSL CK G:YSLFT END^YSHX1 W ! G CP1
|
---|
15 | HP ;
|
---|
16 | K YSUSN S YSPT=2 D FU S YSUS=0
|
---|
17 | HP1 ;
|
---|
18 | S YSUS=$O(YSUSN(YSUS)) G:YSUS="" CM S YSUSER=$P(YSUSN(YSUS),U)
|
---|
19 | S DIC="^PTX(YSDFN,YSHX,YSIDT,1,YSUSER,YSPT,1,1,"
|
---|
20 | S DIWL=1,DIWR=80,DIWF="W",DWI="F D=1:1:DW2 S X="_DIC_"D,0) D:$Y+YSPF>IOSL CK Q:YSLFT D ^DIWP"
|
---|
21 | D DT G:YSLFT END^YSHX1 W ?27,"HISTORY OF PRESENT ILLNESS:" D DIWP G:YSLFT END^YSHX1 D UNM G:YSLFT END^YSHX1 D:$Y+YSPF>IOSL CK G:YSLFT END^YSHX1 W ! G HP1
|
---|
22 | CM ;
|
---|
23 | K YSUSN S YSPT=3 D FU S YSUS=0
|
---|
24 | CM1 ;
|
---|
25 | S YSUS=$O(YSUSN(YSUS)) G:'YSUS END S YSUSER=$P(YSUSN(YSUS),U)
|
---|
26 | S DIC="^PTX(YSDFN,YSHX,YSIDT,1,YSUSER,YSPT,1,1,"
|
---|
27 | S DIWL=1,DIWR=80,DIWF="W",DWI="F D=1:1:DW2 S X="_DIC_"D,0) D:$Y+YSPF>IOSL CK Q:YSLFT D ^DIWP"
|
---|
28 | D DT G:YSLFT END^YSHX1 W ?30,"CURRENT MEDICATIONS:" D DIWP G:YSLFT END^YSHX1 D UNM G:YSLFT END^YSHX1 W ! G CM1
|
---|
29 | END ;
|
---|
30 | D KILL^%ZTLOAD D ENFT^YSFORM:YSP0,WAIT:'YSP0 D ^%ZISC G END^YSHX1
|
---|
31 | FU ;
|
---|
32 | S YSUS=0,YSIDT=9999999-YSDT
|
---|
33 | NU ;
|
---|
34 | S YSUS=$O(^PTX(YSDFN,YSHX,YSIDT,1,YSUS)) Q:'YSUS S:$D(^(YSUS,YSPT,1,0)) YSTM=^(0),YSUSN(YSTM)=YSUS_U_YSTM G NU
|
---|
35 | S YSTM=$P(YSDC,U,2),YSUSN(YSTM)=YSUS G NU
|
---|
36 | UNM ;
|
---|
37 | D:$Y+YSPF+$S(YSP0:2,1:0)>IOSL CK Q:YSLFT S X=YSUSER D PSIG^YSUTL W ! W:YSP0 !! W Y Q
|
---|
38 | DT ;
|
---|
39 | S YSDTM=$P(YSUSN(YSUS),U,2),Y=$P(YSDTM,".") D ENDD^YSUTL S YSYD=$P(YSDTM,".",2),YSMN=$E(YSYD,3,4) S:$L(YSMN)=1 YSMN=YSMN_"0"
|
---|
40 | S YSHR=$E(YSYD,1,2),A=$S(YSHR<12:YSHR,YSHR>12:YSHR-12,YSHR=12:12,1:"00"),M=$S(YSHR<12:"A",YSHR>11:"P",1:0),YSTM=A_":"_YSMN_" "_M_"M"
|
---|
41 | D:$Y+YSPF+3>IOSL CK Q:YSLFT W !,YSDT(1)," at ",YSTM Q
|
---|
42 | DIWP ;
|
---|
43 | S YSREF=DIC_"0)" Q:'($D(@YSREF)#2) S DW2=$P(@(YSREF),U,4) F I0=1,2 D:$Y+YSPF>IOSL CK Q:YSLFT W !
|
---|
44 | X DWI Q:YSLFT D ^DIWW Q
|
---|
45 | CK S:YSP0 YSCON=1 D ENFT^YSFORM:YSP0,WAIT:'YSP0 Q:YSLFT D:YSP0 ENHD^YSFORM Q
|
---|
46 | WAIT ;
|
---|
47 | F I0=1:1:IOSL-$Y-4 W !
|
---|
48 | W:$Y+1<IOSL !
|
---|
49 | N DTOUT,DUOUT,DIRUT
|
---|
50 | S DIR(0)="E" D ^DIR K DIR S YSTOUT=$D(DTOUT),YSUOUT=$D(DUOUT),YSLFT=$D(DIRUT) W @IOF
|
---|
51 | Q
|
---|
52 | ;
|
---|
53 | KILLALL ;
|
---|
54 | K AB,YSDC,YSDFN,YSDOB,YSDT,YSDTM,YSFHDR,YSFTR,YSHD,YSHR,YSHX,YSIDT,YSLFT
|
---|
55 | K YSMN,YSNH,YSNM,YSNU,YSOUT,YSP0,YSPF,YSPT,YSPTD,YSREF,YSSEX,YSSL,YSSSN
|
---|
56 | K YSTM,YSTN,YSTOUT,YSUOUT,YSUR,YSUS,YSUSER,YSUSN,YSUTL,YSYD,Z,ZTDESC
|
---|
57 | K ZTRTN,ZTSAVE,ZTSK
|
---|