source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVSR0.m@ 1147

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

initial load of WorldVistAEHR

File size: 5.2 KB
Line 
1GMVSR0 ;HOIFO/RM,YH,FT-VITAL SIGNS RECORD SF 511 ;10/25/02 10:39
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10039 - FILE 42 references (supported)
6 ; #10061 - ^VADPT calls (supported)
7 ; #10103 - ^XLFDT calls (supported)
8 ; #10104 - ^XLFSTR calls (supported)
9 ;
10EN1(RESULT,GMVDATA) ; GMV PT GRAPH [RPC entry point]
11 ; Queues a graphic report to a printer
12 ; GMVDATA=DFN^START DT^END DT^TYPE OF GRAPH^DEVICE^DEVICE IEN(#3.5)^
13 ; DATE/TIME TO PRINT REPORT^WARD IEN^LOCATION IEN^ROOM LIST
14 ;
15 ; DFN - patient internal entry number
16 ; GMRSTRT - start date/time of report range (FileMan format)
17 ; GMRFIN - end date/time of report range (FileMan format)
18 ; GRAPH - number of the graph (1-5)
19 ; GMVDEV - device name
20 ; GMVIEN - device internal entry number
21 ; GMVPDT - date/time to print the report
22 ; GMVWARD - ward internal entry number
23 ; GMVHLOC - hospital location internal entry number
24 ; GMVRMLST - list of rooms separated by a comma (e.g., 210,220,230)
25 ;
26 N DFN,G,GMROUT,GFLAG,GRAPH,GMRSTRT,GMRFIN,GMVPDT,GMVDEV,GMVIEN,GMREDB
27 N GMRLEN,GMVHLOC,GMRWARD,GMVRMLST,GSTRFIN,GMVDEVUC
28 S DFN=+$P(GMVDATA,"^"),GMRSTRT=$P(GMVDATA,"^",2),GMRFIN=$P(GMVDATA,"^",3),GRAPH=$P(GMVDATA,"^",4),GMVDEV=$P(GMVDATA,"^",5),GMVIEN=+$P(GMVDATA,"^",6),GMVPDT=$P(GMVDATA,"^",7)
29 S GMRWARD=$P(GMVDATA,"^",8),GMVHLOC=$P(GMVDATA,"^",9),GMVRMLST=$P(GMVDATA,"^",10)
30 S (GMROUT,GFLAG)=0
31 S ZTIO=GMVDEV ;device
32 S ZTDTH=$S($G(GMVPDT)>0:GMVPDT,1:$$NOW^XLFDT()) ;date/time to print
33 D:GRAPH<6 DATELN^GMVSR0
34 S GMREDB=$S(DFN>0:"P",GMVRMLST'="":"S",1:"A")
35 S GMRWARD(1)=$S(GMRWARD>0:$P($G(^DIC(42,GMRWARD,0)),U,1),1:"") ;ward name
36 I $G(GMREDB)="P" D
37 .D DEM^VADPT S GMRNAM=$P(VADM(1),"^"),SSN=$P(VADM(2),"^",2)
38 .D INP^VADPT ;get inpatient data
39 .S GMRWARD(1)=$P(VAIN(4),U,2),GMRWARD=$P(VAIN(4),U) ;inpatient location
40 .S GMRRMBD=$S(VAIN(5)'="":VAIN(5),1:" BLANK") ;roombed
41 .D KVAR^VADPT K VA
42 .Q
43DEV ;
44 S GMVDEVUC=$$UP^XLFSTR(GMVDEV) ;device name in uppercase
45 I GRAPH=5,GMVDEVUC'["KYOCERA",GMVDEVUC'["HPLASER",GMVDEVUC'["HP LASER" D Q
46 .S RESULT="Sorry, you must select a Kyocera or HP Laser printer for the Pain Chart."
47 .Q
48 S ZTRTN=$S(GMREDB="P":"EN2^GMVSR0",1:"EN3^GMVSR0")
49 S ZTDESC="V/M GRAPHIC REPORTS"
50 F G="GRAPH","GMROUT","DFN","GMREDB","GMRNAM","SSN","GMRWARD","GMRSTRT","GMRFIN","GMRWARD(","GFLAG","GSTRFIN","GMREDB","GMVRMLST" S ZTSAVE(G)=""
51 D ^%ZTLOAD
52 S RESULT=$S($G(ZTSK)>0:"Report sent to device. Task #: "_ZTSK,1:"Unable to task the report.")
53 K ZTSK,ZTIO,ZTRTN,ZTDESC,ZTSAVE,ZTDTH
54 Q
55EN2 ; Start the graphic report
56 ; Note: Graphic reports must go to a printer
57 S:$D(ZTQUEUED) ZTREQ="@"
58 N GAPICAL,GRADIAL,GBRACHI
59 S GAPICAL=$O(^GMRD(120.52,"B","APICAL",0)),GRADIAL=$O(^GMRD(120.52,"B","RADIAL",0)),GBRACHI=$O(^GMRD(120.52,"B","BRACHIAL",0))
60 I IOST["KYOCERA"!(IOST["Kyocera") S GROUTN=$S(GRAPH=1:"EN1^GMVGR0",GRAPH=2:"EN1^GMVBP0",GRAPH=3:"EN1^GMVWT0",GRAPH=4:"EN1^GMVKPO0",GRAPH=5:"^GMVKPN0",1:"") D:GROUTN'="" @GROUTN G:"Pp"[GMREDB Q1 Q
61 I $$UP^XLFSTR(IOST)["HPLASER" S GROUTN=$S(GRAPH=1:"EN1^GMVHG0",GRAPH=2:"EN1^GMVHB0",GRAPH=3:"EN1^GMVHW0",GRAPH=4:"EN1^GMVHPO0",GRAPH=5:"EN1^GMVHPN0",1:"") D:GROUTN'="" @GROUTN G:"Pp"[GMREDB Q1 Q
62 I GRAPH=2 D ^GMVLBP0 G:"Pp"[GMREDB Q1 Q
63 I GRAPH=3 D ^GMVLWT0 G:"Pp"[GMREDB Q1 Q
64 I GRAPH=4 D ^GMVLPO0 G:"Pp"[GMREDB Q1 Q
65 I GRAPH=5 S:'$G(GMRPERR) GMRPERR=1 G:"Pp"[GMREDB Q1 Q
66 S GMRS=(9999999-GMRFIN)-.0001,GMRQ=9999999-GMRSTRT
67 F GMRTY="B","P","R","T","H","W","PO2","CVP","CG","PN" D SETT^GMVSR1
68 U IO D SF511^GMVSR1
69Q1 ;
70 K J,G,GMR,GMR3,GMRDAT,GMRDT,GMREN,GMRHDR1,GMRHDR10,GMRHDR11,GMRHDR2,GMRHT,GMRI,GMRJ,GMRK,GMRLINE,GMRMSL,GMRNM,GMROLD,GMRP,GMRPDIF,GMRT,GMRX,GMRTY,GMRPG,GMRPGC,GMRPGS,GMRPHI,GMRPLO,GMRTDIF,GMRTHI,GMRTLO,GMRTNM,GMRX1,GMRX2
71 D KVAR^VADPT K VA,%T
72 K GVAR,GMRDIV,GMRHT,GMRQUAL,GMRS,GMRQ,GMRPOFF,GMRTOFF,GMRVWLOC,GMRVX,DIK,%ZIS,%DT,DIPGM,GMRLEN,GMRRMST,GMRVHLOC,GDA,GMRINF,GLINE,GMRVARY,GMRPERR,GMRVPS,GMVROOM,GMVWARD,GMVLOOP
73 W:$E(IOST)="P"!$D(IO("S"))&($$UP^XLFSTR(IOST)'["HPLASER") !
74 Q:'("Pp"[GMREDB)
75Q2 ;
76 K ^TMP($J),GMRII,GMRQUAL,GMREDB,GMROUT,GMRROOM,GMRSTRT,GMRFIN,GMRNAM,GMRRMBD,GMRSITE,GMRVHLOC,GMRWARD,POP,SSN,DFN,ZTIO,ZTSK,GDT,GDTA,GFOUND,GMRAGE,GMRBED,GMRBTH,GMRCOL,GMRHLOC,GMROP,GMRSEX,GMRVADM,GRPT,GSUB,GTYPE1
77 K GSTRFIN,GMRVFLAG,SNN,GMVRMBD,GMVWRD,GRAPH,GROUTN,GIVDT,GSTAR,GSOL,GN,GNDATE,GNSHFT,GFLAG,X,Y
78 D ^%ZISC
79 Q
80EN3 ; Entry to print report for all or selected group of patients,
81 ; for ward stored in GMRWARD
82 S GMRPERR=0
83 S GMVWARD=GMRWARD ;ward ien
84 S GMVWARD(1)=GMRWARD(1) ;ward name
85 S GMVEDB=GMREDB ;A - all patients, S - selected rooms, P - 1 patient
86 ; if selected roombeds, then set up GMVROOM array
87 I $L(GMVRMLST)>0 D
88 .F GMVLOOP=1:1 Q:$P(GMVRMLST,",",GMVLOOP)="" D
89 ..S GMVROOM($P(GMVRMLST,",",GMVLOOP))=""
90 ..Q
91 .Q
92 D WARD^GMVDS1 ;creates TMP global w/patients in ward or rooms
93 S GMRROOM=""
94 F GMRII=0:0 S GMRROOM=$O(^TMP($J,GMRROOM)) Q:GMRROOM="" S GMRNAM="" F GMRII=0:0 S GMRNAM=$O(^TMP($J,GMRROOM,GMRNAM)) Q:GMRNAM="" F DFN=0:0 S DFN=$O(^TMP($J,GMRROOM,GMRNAM,DFN)) Q:DFN'>0 D:DFN>0 PRT
95 D Q1
96 G Q2
97 ;
98PRT ;
99 D DEM^VADPT
100 S SSN=$P(VADM(2),"^",2) Q:$G(GMRPERR)&('$D(IO("Q")))
101 D EN2
102 Q
103 ;
104DATELN ;
105 S Y=GMRSTRT
106 X ^DD("DD")
107 S GSTRFIN=Y
108 S Y=GMRFIN
109 X ^DD("DD")
110 S GSTRFIN=GSTRFIN_" - "_Y
111 Q
Note: See TracBrowser for help on using the repository browser.