source: FOIAVistA/trunk/r/GEN_MED_OTHER-GMV/GMVGGR1.m@ 642

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1GMVGGR1 ;HOIFO/YH,FT-VITAL SIGNS RECORD SF 511 ;6/12/02 11:58
2 ;;5.0;GEN. MED. REC. - VITALS;**3**;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #3214 - ^GMRYAPI calls (private)
6 ; #10040 - FILE 44 references (supported)
7 ; #10061 - ^VADPT calls (supported)
8 ; #10096 - ^%ZOSF calls (supported)
9 ;
10 ; This routine supports the following IAs:
11 ; #4654 - GMV V/M ALLDATA RPC is called at VMDATA (private)
12 ;
13VMDATA(RESULT,GMVDATA) ;GMV V/M ALLDATA [RPC entry point]
14 ;ENTRY POINT FROM GMRV SF511 GUI TO EXTRACT ALL DATA
15 ; GMVDATA: piece 1 = DFN
16 ; 2 = start date
17 ; 3 = end date
18 ; 4 = 0
19 ;
20 N DFN,GQT,X,Y
21 K ^TMP($J)
22 S (GMROUT,GN,GQT)=0,DFN=+$P(GMVDATA,"^"),GMRSTRT=$P(GMVDATA,"^",2),GMRFIN=$P(GMVDATA,"^",3),GMR=+$P(GMVDATA,"^",4)
23 S GSEL=0,GMR=0
24 S Y=GMRSTRT X ^DD("DD") S GSTRFIN=Y S Y=GMRFIN X ^DD("DD") S GSTRFIN=GSTRFIN_" - "_Y
25 S GMRHT=0
26 K ^TMP($J,"GMR"),^TMP($J,"GMRK"),^TMP($J,"GDT"),^TMP($J,"GMRVG"),^TMP($J,"GTNM")
27 S GSTART1=(9999999-GMRFIN)-.0001,GEND1=9999999-GMRSTRT
28 F GTYPE="B","H","P","R","T","W","PO2","CVP","CG","PN" D SETT
29 S GRPT=5 D:GMR'=1 SETIO D ^GMVGGR2
30Q1 K GMR,GSOL,GIVDT,GMRHLOC,GMRVJ,GDATA,GDT,GEN,GEND1,GI,GJ,GK,GMRVX,GSTART1,GTNM,GTYP,GTYPE,GX,I D KVAR^VADPT K VA,VAROOT
31 D QIO^GMVGR5
32 K GRPT,GMROUT,GMRRMBD,GAGE,GCNT,GDOB,GCNTB,GCNTD,GCNTP,GCNTR,GCNTT,GCNTT1,GCNTI,GCNTO,GDT1,GCNTPD,GCNTTD,GCNTW,GPG,GPGS,GHT,GTYPE1,GCNTB3,GDTA,XDT,XIO,XX,^TMP($J,"GMRK"),^TMP($J,"GMR"),^TMP($J,"GDT"),^TMP($J,"GMRVG")
33 K GLINE,GMRQUAL,^TMP($J,"GTNM"),G,GDA,GDIP,GDOP,GINF,GMIN,GMRFIN,GMRHT,GMRSITE,GMRSTRT,GMRVARY,GMRVHLOC,GMRWARD,GN,GNDATE,GNSHFT,GRNDIP,GRNDOP,GRNGIP,GSIP,GSOP,GSTAR,GSTRFIN,GSUB
34 Q
35SETT ;SET GMRT
36 S GTYP(1)=$S(GTYPE="B":"BLOOD PRESSURE",GTYPE="P":"PULSE",GTYPE="R":"RESPIRATION",GTYPE="T":"TEMPERATURE",GTYPE="H":"HEIGHT",GTYPE="W":"WEIGHT",GTYPE="CG":"CIRCUMFERENCE/GIRTH",GTYPE="PO2":"PULSE OXIMETRY",1:"")
37 I GTYP(1)="" S GTYP(1)=$S(GTYPE="CVP":"CENTRAL VENOUS PRESSURE",GTYPE="PN":"PAIN",1:"")
38 Q:GTYP(1)=""
39 S GTYP=$O(^GMRD(120.51,"B",GTYP(1),""))
40 I GTYP>0 F GX=GSTART1:0 S GX=$O(^GMR(120.5,"AA",DFN,GTYP,GX)) Q:GX>GEND1!(GX'>0) F GEN=0:0 S GEN=$O(^GMR(120.5,"AA",DFN,GTYP,GX,GEN)) Q:GEN'>0 I '$D(^GMR(120.5,GEN,2)) D BLDARR
41 Q
42BLDARR ;
43 N GMVLOC,GMVUSER
44 S GDATA=$S($D(^GMR(120.5,GEN,0)):^(0),1:"")
45 Q:GDATA=""
46 S GMVLOC=+$P(GDATA,U,5) ;hospital location ien
47 S GMVLOC=$P($G(^SC(GMVLOC,0)),U,1)
48 S GMVUSER=+$P(GDATA,U,6) ;user duz
49 S GMVUSER=$$PERSON^GMVUTL1(GMVUSER)
50 S GMRVX=GTYPE,GMRVX(0)=$P(GDATA,"^",8),GMRVX(1)=0 D:GMRVX(0)>0!(GMRVX(0)<0)!($E(GMRVX(0))="0") EN1^GMVSAS0
51 K GMRVARY S GMRVARY="" I $P($G(^GMR(120.5,GEN,5,0)),"^",4)>0 D CHAR^GMVCHAR(GEN,.GMRVARY,GTYP)
52 K GG S GG="" I $O(GMRVARY(0)) D
53 . S GG(1)=0 F S GG(1)=$O(GMRVARY(GG(1))) Q:GG(1)'>0 S GG(2)=0 F S GG(2)=$O(GMRVARY(GG(1),GG(2))) Q:GG(2)'>0 S GG(3)="" F S GG(3)=$O(GMRVARY(GG(1),GG(2),GG(3))) Q:GG(3)="" S GG=GG_$S(GG="":"",1:";")_GG(3)
54 I $P(GDATA,"^",8)="" Q
55 S ^TMP($J,"GMRVG",9999999-GX,GTYPE,$P(GDATA,"^",8))=GG_"^"_$S($G(GMRVX(1))>0:1,1:"")_"^^"_$P(GDATA,"^",10)_U_GMVLOC_U_GMVUSER
56 S:$D(^TMP($J,"GMRVG",9999999-GX,"H",$P(GDATA,"^",8))) GHT=$P(GDATA,"^",8)
57 ;I GTYPE="B",$P(GDATA,"^",8)'>0 S ^TMP($J,"GMRVG",9999999-GX,"B",$P(GDATA,"^",8))="^^"
58 K GG
59 Q
60SETIO ;
61 S X="GMRYRP0" X ^%ZOSF("TEST") Q:'$T
62 D IO^GMVGR5
63 D SETIOAR
64 Q
65SETIOAR F GTYPE1="XI"_($$INPUT^GMRYAPI()+4),"XO"_($$OUTPUT^GMRYAPI()+1) F GDT=0:0 S GDT=$O(^TMP($J,"GMR",GTYPE1,GDT)) Q:GDT'>0 F GDTA=0:0 S GDTA=$O(^TMP($J,"GMR",GTYPE1,GDT,GDTA)) Q:GDTA="" D SETIOAR1
66 Q
67SETIOAR1 S:GTYPE1["XI" ^TMP($J,"GMRVG",GDT,"I",GDTA)="^" S:GTYPE1["XO" ^TMP($J,"GMRVG",GDT,"O",GDTA)="^"
68 Q
Note: See TracBrowser for help on using the repository browser.