source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSMHPE.m@ 1800

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1GMTSMHPE ; SLC/JER,KER - Mental Health Physical Exam Component ; 02/27/2002
2 ;;2.7;Health Summary;**49**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 1280 ^MR( (file #90)
6 ; DBIA 10015 EN^DIQ1 (file #90)
7 ;
8MAIN ; Main control
9 N GMCKC,GMDATA,GMDATE,GMEND,GMTSE,GMTSB,GMFLD,GMI,GMIL,GMTIMES,GMX,MAX Q:'$G(DFN) Q:'$D(^MR(+DFN,"PE"))
10 S GMTSB=$G(GMTS1) S:GMTSB'?7N GMTSB=6666666 S GMTSE=$G(GMTS2) S:GMTSE'?7N GMTSE=9999999
11 S MAX=$S(+($G(GMTSNDM))>0:+($G(GMTSNDM)),1:99999)
12 S GMTIMES=0
13PHYEXAM ; Check for existence of PHYSICAL EXAM data
14 S GMEND=GMTSE S GMDATE=GMTSB-.1
15 F S GMDATE=$O(^MR(+DFN,"PE",GMDATE)) Q:GMDATE']""!(GMDATE>GMEND) D Q:$D(GMTSQIT)!(MAX'>GMTIMES)
16 . N DIC,DIQ,DA,DR
17 . K ^UTILITY("DIQ1",$J)
18 . S DIC="^MR(",DA=+DFN,DR=100,DIQ(0)="EN"
19 . S DR(90.01)=".01:34",DA(90.01)=+GMDATE,DR(90.02)=.01,DA(90.02)=0
20 . S DR(90.03)=.01,DA(90.03)=0
21 . D EN^DIQ1
22 . Q:'$D(^UTILITY("DIQ1",$J))
23 . S GMTIMES=GMTIMES+1
24 . D VS(+DFN,+GMDATE) Q:$D(GMTSQIT)
25 . D OMITABN
26 . D SHOWOMIT Q:$D(GMTSQIT)
27 . D SHOWABN Q:$D(GMTSQIT)
28 . W !
29 K ^UTILITY("DIQ1",$J)
30 Q
31 ;
32VS(DFN,GMDATE) ; Show vital signs
33 N GMI,GMTXT D CKP^GMTSUP Q:$D(GMTSQIT)
34 W "VITAL SIGNS DATE: ",$S($G(^UTILITY("DIQ1",$J,90.01,+GMDATE,.01,"E"))]"":^("E"),1:"Unknown")
35 W ?40,"Examiner: ",$S($G(^UTILITY("DIQ1",$J,90.01,+GMDATE,29,"E"))]"":^("E"),1:"Unknown")
36 D CKP^GMTSUP Q:$D(GMTSQIT)
37 W !,"Temp: ",$S($G(^UTILITY("DIQ1",$J,90.01,+GMDATE,.04,"E")):^("E")_"F",$G(^UTILITY("DIQ1",$J,90.01,+GMDATE,34,"E")):^("E")_"C",1:"")
38 W ?14,"Pulse: ",$G(^UTILITY("DIQ1",$J,90.01,+GMDATE,.05,"E"))
39 W ?28,"Resp: ",$G(^UTILITY("DIQ1",$J,90.01,+GMDATE,.07,"E"))
40 W ?42,"BP: ",$G(^UTILITY("DIQ1",$J,90.01,+GMDATE,.06,"E"))
41 W ?56,"Ht: ",$S($G(^UTILITY("DIQ1",$J,90.01,+GMDATE,.02,"E")):^("E")_"in",$G(^UTILITY("DIQ1",$J,90.01,+GMDATE,32,"E")):^("E")_"cm",1:"")
42 W ?70,"Wt: ",$S($G(^UTILITY("DIQ1",$J,90.01,+GMDATE,.03,"E")):^("E")_"lb",$G(^UTILITY("DIQ1",$J,90.01,+GMDATE,33,"E")):^("E")_"kg",1:""),!!
43 I +$O(^MR(+DFN,"PE",+GMDATE,19,0)) D Q:$D(GMTSQIT) W !
44 . W "Comments:",!
45 . S GMI=0 F S GMI=$O(^MR(+DFN,"PE",+GMDATE,19,GMI)) Q:GMI'>0 D Q:$D(GMTSQIT)
46 . . D CKP^GMTSUP Q:$D(GMTSQIT) W ?4,$G(^MR(+DFN,"PE",+GMDATE,19,GMI,0)),!
47 I +$O(^MR(+DFN,"PE",+GMDATE,20,0)) D Q:$D(GMTSQIT) W !
48 . W "Initial Impression:",! S GMI=0
49 . F S GMI=$O(^MR(+DFN,"PE",+GMDATE,20,GMI)) Q:GMI'>0 D Q:$D(GMTSQIT)
50 . . D CKP^GMTSUP Q:$D(GMTSQIT) W ?4,$G(^MR(+DFN,"PE",+GMDATE,20,GMI,0)),!
51 S GMTXT=$G(^UTILITY("DIQ1",$J,90.01,+GMDATE,.9,"E")) Q:GMTXT']""
52 D CKP^GMTSUP Q:$D(GMTSQIT) W "General Appearance: "
53 I $L(GMTXT)>59 S GMTXT=$$WRAP^GMTSORC(GMTXT,60)
54 F GMI=1:1:$L(GMTXT,"|") D CKP^GMTSUP Q:$D(GMTSQIT) W:$P(GMTXT,"|",GMI)]"" ?20,$P(GMTXT,"|",GMI),!
55 W !
56 Q
57OMITABN ; Get PHYSICAL EXAM 'Omits' and 'Abnormals'
58 N GMFLD,GMX K GMDATA F GMFLD=2:1:19 D
59 . S GMX=$E($G(^UTILITY("DIQ1",$J,90.01,+GMDATE,+GMFLD,"E")))
60 . Q:GMX'?1U I GMX="O" S GMDATA("OM",+GMFLD)=$$SYS(+GMFLD)
61 . I GMX="A" S GMDATA("AB",+GMFLD)=$$SYS(+GMFLD)_"^"_$G(^UTILITY("DIQ1",$J,90.01,+GMDATE,+GMFLD_.9,"E"))
62 Q
63 ;
64SHOWOMIT ; Show 'Omits'
65 N GMYST,GMPHY D CKP^GMTSUP Q:$D(GMTSQIT) W "Omissions: "
66 I '$D(GMDATA("OM")) W " None",!! Q
67 S GMYST=0 F S GMYST=$O(GMDATA("OM",GMYST)) Q:GMYST'>0 D Q:$D(GMTSQIT)
68 . S GMPHY=GMDATA("OM",GMYST) I (($L(GMPHY)+$X)>(IOM-2)) D CKP^GMTSUP Q:$D(GMTSQIT) W !?11
69 . W GMPHY W:+$O(GMDATA("OM",GMYST)) ", "
70 D CKP^GMTSUP Q:$D(GMTSQIT) W !!
71 Q
72 ;
73SHOWABN ; Show 'Abnormals'
74 N GMI,GMTXT,GMYST,GMPHY D CKP^GMTSUP Q:$D(GMTSQIT) W "Abnormal Findings: "
75 I '$D(GMDATA("AB")) W " None",!! Q
76 W ! S GMYST=0 F S GMYST=$O(GMDATA("AB",GMYST)) Q:GMYST'>0 D Q:$D(GMTSQIT)
77 . S GMPHY=$P(GMDATA("AB",GMYST),"^",1) Q:GMPHY']""
78 . D CKP^GMTSUP Q:$D(GMTSQIT) W:GMTSNPG " Abnormal Findings (cont'd):",! W ?(17-$L(GMPHY)),GMPHY,":"
79 . S GMTXT=$P(GMDATA("AB",GMYST),"^",2) Q:GMTXT']""
80 . I $L(GMTXT)>60 S GMTXT=$$WRAP^GMTSORC(GMTXT,60)
81 . F GMI=1:1:$L(GMTXT,"|") D CKP^GMTSUP Q:$D(GMTSQIT) W:$P(GMTXT,"|",GMI)]"" ?19,$P(GMTXT,"|",GMI),!
82 W !
83 Q
84 ;
85SYS(GMHSYST) ; Physical System
86 S GMHSYST=$P("^Head^Eyes^Ears^Nose^Mouth^Neck^Chest&Breasts^Lungs^Heart^Abdomen^Genitalia^Pelvic^Rectum^Back^Extremities^Neurological^Skin^Lymph",U,GMHSYST)
87 Q GMHSYST
Note: See TracBrowser for help on using the repository browser.