source: WorldVistAEHR/trunk/r/MEDICINE-MC/MCOBGA.m@ 1704

Last change on this file since 1704 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.3 KB
Line 
1MCOBGA ; GENERATED FROM 'MCARGIBRPR' PRINT TEMPLATE (#1026) ; 10/04/96 ; (FILE 699, MARGIN=80)
2 G BEGIN
3N W !
4T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^UTILITY($J,1))#2,^(1)?1U1P1E.E X ^(1)
5 S DISTP=DISTP+1,DILCT=DILCT+1 D:'(DISTP#100) CSTP^DIO2
6 Q
7DT I $G(DUZ("LANG"))>1,Y W $$OUT^DIALOGU(Y,"DD") Q
8 I Y W $P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$E(Y,4,5))_" " W:Y#100 $J(Y#100\1,2)_"," W Y\10000+1700 W:Y#1 " "_$E(Y_0,9,10)_":"_$E(Y_"000",11,12) Q
9 W Y Q
10M D @DIXX
11 Q
12BEGIN ;
13 S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
14 I $D(DXS)<9 F X=0:0 S X=$O(^DIPT(1026,"DXS",X)) Q:'X S Y=$O(^(X,"")) F X=X:0 Q:Y="" S DXS(X,Y)=^(Y),Y=$O(^(Y))
15 W ?0 W "APPT DATE/TIME: "
16 S X=$G(^MCAR(699,D0,0)) D N:$X>16 Q:'DN W ?16 S Y=$P(X,U,1) D DT
17 D N:$X>39 Q:'DN W ?39 W "MEDICAL PATIENT: "
18 S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^MCAR(690,Y,0))#2:$P(^(0),U,1),1:Y) S Y=$S(Y="":Y,$D(^DPT(Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
19 D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "INDICATED THERAPY: "
20 S I(1)=2,J(1)=699.17 F D1=0:0 Q:$O(^MCAR(699,D0,2,D1))'>0 X:$D(DSC(699.17)) DSC(699.17) S D1=$O(^(D1)) Q:D1'>0 D:$X>25 T Q:'DN D A1
21 G A1R
22A1 ;
23 S X=$G(^MCAR(699,D0,2,D1,0)) S DIWL=1,DIWR=55 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(699.6,Y,0))#2:$P(^(0),U,1),1:Y) S X=Y D ^DIWP
24 D A^DIWW
25 Q
26A1R ;
27 D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "SIGNS AND SYMPTOMS: "
28 S I(1)=3,J(1)=699.18 F D1=0:0 Q:$O(^MCAR(699,D0,3,D1))'>0 X:$D(DSC(699.18)) DSC(699.18) S D1=$O(^(D1)) Q:D1'>0 D:$X>26 T Q:'DN D B1
29 G B1R
30B1 ;
31 S X=$G(^MCAR(699,D0,3,D1,0)) S DIWL=1,DIWR=55 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(695.5,Y,0))#2:$P(^(0),U,1),1:Y) S X=Y D ^DIWP
32 D A^DIWW
33 Q
34B1R ;
35 D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "DISEASE FOLLOWUP: "
36 S I(1)=5,J(1)=699.35 F D1=0:0 Q:$O(^MCAR(699,D0,5,D1))'>0 X:$D(DSC(699.35)) DSC(699.35) S D1=$O(^(D1)) Q:D1'>0 D:$X>24 T Q:'DN D C1
37 G C1R
38C1 ;
39 S X=$G(^MCAR(699,D0,5,D1,0)) S DIWL=1,DIWR=55 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(699.84,Y,0))#2:$P(^(0),U,1),1:Y) S X=Y D ^DIWP
40 D A^DIWW
41 Q
42C1R ;
43 D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "FOLLOWUP DEVICE OR THERAPY: "
44 S I(1)=6,J(1)=699.36 F D1=0:0 Q:$O(^MCAR(699,D0,6,D1))'>0 X:$D(DSC(699.36)) DSC(699.36) S D1=$O(^(D1)) Q:D1'>0 D:$X>34 T Q:'DN D D1
45 G D1R
46D1 ;
47 S X=$G(^MCAR(699,D0,6,D1,0)) S DIWL=1,DIWR=55 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(699.85,Y,0))#2:$P(^(0),U,1),1:Y) S X=Y D ^DIWP
48 D A^DIWW
49 Q
50D1R ;
51 D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "SURVEILLANCE: "
52 S I(1)=7,J(1)=699.37 F D1=0:0 Q:$O(^MCAR(699,D0,7,D1))'>0 X:$D(DSC(699.37)) DSC(699.37) S D1=$O(^(D1)) Q:D1'>0 D:$X>20 T Q:'DN D E1
53 G E1R
54E1 ;
55 S X=$G(^MCAR(699,D0,7,D1,0)) S DIWL=1,DIWR=55 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(699.86,Y,0))#2:$P(^(0),U,1),1:Y) S X=Y D ^DIWP
56 D A^DIWW
57 Q
58E1R ;
59 D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(699,D0,31)):^(31),1:"") S X="PROTOCOL: "_$P(DIP(1),U,1) K DIP K:DN Y W X
60 D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(699,D0,31)):^(31),1:"") S X="EGD SIMPLE PRIMARY EXAM: "_$P(DIP(1),U,2) K DIP K:DN Y W X
61 D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(699,D0,31)):^(31),1:"") S X="LAB OR XRAY: "_$P(DIP(1),U,3) K DIP K:DN Y W X
62 D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(699,D0,32)):^(32),1:"") S X="OCCULT BLOOD: "_$P(DIP(1),U,1) K DIP K:DN Y W X
63 D N:$X>4 Q:'DN W ?4 S DIP(1)=$S($D(^MCAR(699,D0,32)):^(32),1:"") S X="SPECIMEN COLLECTION: "_$P(DIP(1),U,2) K DIP K:DN Y W X
64 D N:$X>2 Q:'DN W ?2 W "COMMENT: "
65 S X=$G(^MCAR(699,D0,0)) D N:$X>12 Q:'DN S DIWL=13,DIWR=80 S Y=$P(X,U,6) S X=Y D ^DIWP
66 D A^DIWW
67 D N:$X>1 Q:'DN W ?1 W "ENDOSCOPIST: "
68 S X=$G(^MCAR(699,D0,0)) D N:$X>15 Q:'DN W ?15 S Y=$P(X,U,8) S Y=$S(Y="":Y,$D(^VA(200,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,35)
69 D N:$X>44 Q:'DN W ?44 W "FELLOW: "
70 S X=$G(^MCAR(699,D0,200)) S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^VA(200,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,35)
71 W ?54 D:MCARGNAM="COL" COL^MCARGS K DIP K:DN Y
72 W ?65 D:MCARGNAM="LAP" LAP^MCARGS K DIP K:DN Y
73 D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "SUMMARY: "
74 S X=$G(^MCAR(699,D0,.2)) S Y=$P(X,U,1) W:Y]"" $S($D(DXS(7,Y)):DXS(7,Y),1:Y)
75 D T Q:'DN D N D N:$X>2 Q:'DN W ?2 W "LOCATION: "
76 S I(1)=30,J(1)=699.01 F D1=0:0 Q:$O(^MCAR(699,D0,30,D1))'>0 X:$D(DSC(699.01)) DSC(699.01) S D1=$O(^(D1)) Q:D1'>0 D:$X>14 T Q:'DN D F1
77 G F1R^MCOBGA1
78F1 ;
79 S X=$G(^MCAR(699,D0,30,D1,0)) W ?14 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^MCAR(697,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,30)
80 D N:$X>2 Q:'DN W ?2 W "DESCRIPTION: "
81 G ^MCOBGA1
Note: See TracBrowser for help on using the repository browser.