source: FOIAVistA/trunk/r/GEN_MED_OTHER-GMV/GMVCAQU.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1GMVCAQU ;HOIFO/YH,FT-DISPLAY CATEGORY/QUALIFIER/SYNONYM TABLE FOR VITAL TYPE ;10/25/02 10:04
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10103 - ^XLFDT calls (supported)
6 ; #10104 - ^XLFSTR calls (supported)
7 ;
8EN1(RESULTS,GMVDATA) ; GMV QUALIFIER TABLE [RPC entry point]
9 ; Display Vitals Category/Qualifier/Synonym Table
10 ; GMVDEV - device name (File 3.5)
11 ; GMVIEN - device internal entry number
12 ; GMVPDT - date/time to print report
13 ;
14 N GMVDEV,GMVIEN,GMVPDT
15 S RESULTS=$NA(^TMP($J)) K @RESULTS
16 S GMVDEV=$P(GMVDATA,U,5),GMVIEN=+$P(GMVDATA,U,6),GMVPDT=$P(GMVDATA,U,7)
17 S ZTIO=GMVDEV ;device
18 S ZTDTH=$S($G(GMVPDT)>0:GMVPDT,1:$$NOW^XLFDT()) ;date/time to print
19 S ZTDESC="Vitals Category/Qualifier/Synonym Table"
20 S ZTRTN="START^GMVCAQU"
21 D ^%ZTLOAD
22 I $G(ZTSK)>0 S @RESULTS@(0)="1^Report Queued. Task #:"_ZTSK
23 E S @RESULTS@(0)="-1^Unable to queue report."
24 K ZTSK,ZTIO,ZTDTH,ZTSAVE,ZTDESC,ZTRTN
25 Q
26START ; Start the report
27 U IO
28 S:$D(ZTQUEUED) ZTREQ="@"
29 S (GMROUT,GMRPG)=0
30 S GMVNOW=$$NOW^XLFDT() ;get current date/time
31 S GMVNOW=$$FMTE^XLFDT(GMVNOW) ;format current date/time
32 D HDR
33 F GMRVIT(1)="BLOOD PRESSURE","PULSE","RESPIRATION","TEMPERATURE","WEIGHT","CIRCUMFERENCE/GIRTH","HEIGHT","PULSE OXIMETRY" Q:GMROUT D
34 .S GMRVIT=$O(^GMRD(120.51,"B",GMRVIT(1),0)) Q:GMRVIT'>0!GMROUT D
35 ..S GMRVITY=$P(^GMRD(120.51,GMRVIT,0),"^",2) Q:GMRVITY=""!GMROUT S GLVL=8 D LISTQ^GMVQUAL Q:GMROUT D OTHERQ D CLEAR
36 ..Q
37 .Q
38Q1 ; Kill variables and quit
39 K GMRVIT,GMRVITY,GLVL,GMROUT,GMRPG,GSYNO,I,J,POP
40 D CLEAR
41 D ^%ZISC
42 Q
43HDR ; Header
44 W:$Y>0 @IOF
45 S GMRPG=GMRPG+1
46 W !,"Vitals/Measurements Category/Qualifier/Synonym Table",?65,"Page ",GMRPG
47 W !,"Run Date: ",GMVNOW
48 W !,$$RJ^XLFSTR(" ",75,"-")
49 W:GMRPG>1 !,GLABEL,!,GLABEL(1)
50 Q
51CLEAR ; Clean up variables
52 K GCHART,GCHART1,GQUAL,GMRVDFLT,GORDER,GLABEL,GFLAG,GMAX,GMIN,GMRLAST,GMRINF,GCAT,GCHA,GCOL,GDA,GENTR,GTXT,GBLNK,GCOUNT,GLN,GMRENTR,GMRVODR,GSIDE,GTYPE,GDASH
53 Q
54OTHERQ ;
55 Q:'$D(GCHART)&('$D(GCHART1))
56 S GCOL=1,GFLAG=0,$P(GLABEL," ",80)="",$P(GBLNK," ",80)="",$P(GLABEL(1)," ",80)="",$P(GDASH,"-",20)=""
57 S (GMAX,GMAX(1))=0
58 F S GMAX(1)=$O(GCOUNT(GMAX(1))) Q:GMAX(1)'>0 S GMAX(2)="" F S GMAX(2)=$O(GCOUNT(GMAX(1),GMAX(2))) Q:GMAX(2)="" I GCOUNT(GMAX(1),GMAX(2))>GMAX S GMAX=GCOUNT(GMAX(1),GMAX(2))
59 Q:+$G(GMAX)=0
60 F I=1:1:GMAX S $P(GTXT(I)," ",80)=""
61 S GMRVODR=0
62 F S GMRVODR=$O(GCOUNT(GMRVODR)) Q:GMRVODR'>0 S GCAT=$O(GCOUNT(GMRVODR,"")) Q:GCAT="" D
63 . S GCOL=$S(GMRVODR=1:1,GMRVODR=2:18,GMRVODR=3:39,GMRVODR=4:58,1:70)
64 . I GMRVODR=2,GMRVIT(1)="PULSE" S GCOL=28
65 . I GMRVODR=2,GMRVIT(1)="RESPIRATION" S GCOL=32
66 . S GLABEL=$S(GMRVODR=1:$E(GCAT_GBLNK,1,80),1:$E($E(GLABEL,1,GCOL)_GCAT_GBLNK,1,80))
67 . S GCAT(1)=$E(GDASH,1,$L(GCAT))
68 . S GLABEL(1)=$S(GMRVODR=1:$E(GCAT(1)_GBLNK,1,80),1:$E($E(GLABEL(1),1,GCOL)_GCAT(1)_GBLNK,1,80))
69 . S I=0,GCHA="" F S GCHA=$O(GQUAL(GMRVODR,GCHA)) Q:GCHA="" D
70 . . S GSYNO(1)=$O(^GMRD(120.52,"B",GCHA,0)) Q:GSYNO(1)'>0 S GSYNO=$P($G(^GMRD(120.52,GSYNO(1),0)),"^",2)
71 . . S I=I+1,GTXT(I)=$S(GMRVODR=1:$E(GCHA_": "_GSYNO_GBLNK,1,80),1:$E($E(GTXT(I),1,GCOL)_GCHA_": "_GSYNO_GBLNK,1,80))
72 . . Q
73 . Q
74 W !!,"Qualifiers for "_GMRVIT(1)_": ",!!,GLABEL,!,GLABEL(1)
75 F I=1:1:GMAX D:IOSL<($Y+6) HDR Q:GMROUT W !,GTXT(I)
76 Q
Note: See TracBrowser for help on using the repository browser.