source: WorldVistAEHR/trunk/r/CONSULT_REQUEST_TRACKING-GMRC-GMRS-GMRT/GMRCR.m@ 1639

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

initial load of WorldVistAEHR

File size: 3.8 KB
RevLine 
[613]1GMRCR ;SLC/DLT - Driver for reviewing patient consult/requests - Used by Medicine Package to link Consults to Medicine results ;9/18/98 16:26
2 ;;3.0;CONSULT/REQUEST TRACKING;**1,5**;DEC 27, 1997
3EN ;Entry point for medicine results entry by procedure or consult type
4 ;Required variables:
5 ; GMRCPRNM = name of procedure file with results.
6 ; DFN = patient file (2) ien
7 ;Optional variables:
8 ; GMRCSR = variable pointer for results
9 ; ORSTS = order status
10 ; GMRCI = 0 or undefined, assume interactive
11 ; 1, assume non-interactive - not operational currently
12 ;Returned variables:
13 ; ORIFN = Pointer to the consult order in file 100
14 ; GMRCO = Pointer to the Request/Consultation entry in file 123.5
15 ;
16 K DTOUT,DUOUT,ORIFN,GMRCO,GMRCX
17 I '$D(GMRCPNM) D DEM^GMRCU
18 I $D(GMRCPRNM) S GMRC=$O(^ORD(101,"B","GMRCR "_GMRCPRNM,0)),GMRCTYPE="GMRCOR REQUEST"
19 E I $D(GMRCPR) S GMRC=GMRCPR,GMRCTYPE="GMRCOR REQUEST"
20 I $D(GMRCCT) S GMRC=GMRCCT,GMRCTYPE="GMRCOR CONSULT"
21 I $D(GMRC)=1!($D(GMRC)=11),+GMRC D
22 .S GMRCVP=GMRC_";ORD(101,",GMRCNM=$S($D(^ORD(101,GMRC,0)):$P(^(0),"^",2),1:"")
23 .S GMRCSS=$P($G(^ORD(101,+GMRCVP,5)),"^"),GMRCSS=+GMRCSS
24EN1 ;Entry point for
25 Q I 'GMRCSS D ASRV^GMRCASV D Q:GMRCEND S GMRCSS=+GMRCDG I 'GMRCDG S GMRCEND=1 K GMRCSS Q
26 .I $D(DTOUT)!($D(DIROUT)) S GMRCEND=1 K DTOUT,DIROUT,DIRUT,DUOUT Q
27 .Q
28 E S GMRCDG=GMRCSS D SERV1^GMRCASV
29 I '$D(ORTKG) S ORTKG=$$PACKAGE I ORTKG="" S GMRCMSG="Missing package entry for CONSULT/REQUEST TRACKING" D EXAC^GMRCADC(GMRCMSG) K GMRCMSG S GMRCEND=1 Q
30 ;old code? D TEAM^GMRCASV
31 S GMRCSSNM=$P(^GMR(123.5,GMRCSS,0),"^",1)
32 ;old codeN GMRCQIT
33 ;old code? S ORVP=DFN_";DPT(",GMRCGRP=0
34 ;old code? K ^TMP("GMRCR",$J)
35 K GMRCOER,GMRCQUT
36 S GMRCEN=1
37 D EN^GMRCMENU ; used to be D EN^GMRCACTM
38 S GMRCOER=0
39 D AD^GMRCSLM1 ; used to be D AD^GMRCRA
40 D EN^VALM("GMRC CONSULT TRACKING")
41 D KILL
42 Q
43KILL ; Kill variables, but don't kill GMRCO and ORIFN if from MC option
44 ;K VALMCNT,VALMBCK,VALMPGE
45 ;K ^TMP("GMRCR",$J,"CS"),^TMP("GMRCS",$J)
46 K X,Y,Z,DTOUT,DUOUT,DIROUT
47 K GMRC,GMRCA,GMRCACT,GMRCACTM,GMRCAGE,GMRCCT,GMRCCTX,GMRCDG,GMRCDGT
48 K GMRCDOB,GMRCDTM,GMRCGRP,GMRCH,GMRCHDR,GMRCIFN,GMRCLFG,GMRCNM,GMRCNPG
49 K GMRCPNM,GMRCRB,GMRCWARD,GMRCSN,GMRCRPG,GMRCNPG,GMRCTITL,GMRCX,GMRCHDR,GMRCH,GMRCDTM
50 K GMRCSTS,GMRCTYPE,GMRCVP,GMRCEND,GMRCTO,GMRCURG,GMRCL,GMRCDT,GMRCDIC
51 K VA,VAIN,VAINDT,VADM,VAEL,VAPA,VAERR,VAROOT
52 K O,OREND,ORINDX,ORNS,POP,SEX,W,XQORSPEW
53 I $D(XQY0),$E(XQY0,1,2)="MC" S:'$D(GMRCO) (ORIFN,GMRCO)="" Q
54 K ORIFN,GMRCO,GMRCSR
55 Q
56RESULT ;Entry point to set up variable pointer to results and update OE/RR status
57 Q
58 Q:'$D(GMRCSR) Q:'$D(GMRCO) S (GMRCSS,GMRCSSNM,GMRCNM,GMRC,GMRCVP)=""
59 S GMRCOM=0,GMR(0)=$S($D(^GMR(123,+GMRCO,0)):^(0),1:""),GMRCSS=$P(GMR(0),"^",5) I GMRCSS,$D(^GMR(123.5,GMRCSS,0)) S GMRCSSNM=$S($L($P(^GMR(123.5,GMRCSS,0),"^",9)):$P(^(0),"^",9),1:$P(^(0),"^"))
60 S GMRCVP=$P(GMR(0),"^",8) I +GMRCVP S DIC="^"_$P(GMRCVP,";",2)_$P(GMRCVP,";")_",0)" I $L(DIC),$D(@DIC) S GMRCNM=@(DIC),GMRCNM=$P(GMRCNM,"^",2)
61 I '$D(ORSTS) S ORSTS=6 ;Assume order entry status of active
62 S GMRCA=$O(^GMR(123.1,"AC",+ORSTS,"")) I 'GMRCA S GMRCA=9
63 S DIE=123,DA=GMRCO,DR="11////^S X=GMRCSR;8////^S X=ORSTS;9////^S X=GMRCA"
64 L +^GMR(123,GMRCO) I '$T S GMRCMSG="Consult/Request Is Being Used By Another User.",GMRCMSG(1)="RESULT UPDATE WAS UNSUCCESSFUL! Try Again Later" D EXAC^GMRCADC(.GMRCMSG) K GMRCO,ORIFN,GMRCMSG D KILL Q
65 D ^DIE K DIE,DA,DR
66 L -^GMR(123,GMRCO) D AUDIT^GMRCP
67 S:'$D(ORIFN) ORIFN=$P(^GMR(123,+GMRCO,0),"^",3)
68 S GMRCORNP=$P(GMR(0),"^",14),GMRCTYPE=$P(GMR(0),"^",17)
69 I $L($P(GMR(0),"^",14)) S GMRCADUZ($P(GMR(0),"^",14))=""
70 I ORIFN D EN^GMRCHL7(DFN,GMRCO,$G(GMRCTYPE),$G(GMRCRB),"RE",GMRCORNP,$G(GMRCVSIT),.GMRCOM)
71 K GMR,GMRCSS,GMRCORVP,GMRCVP,GMRCNM,DIC,GMRCPR
72 Q
73 ;
74PACKAGE() ; Returns the package entry number for 'CONSULT/REQUEST TRACKING"
75 Q $$FIND1^DIC(9.4,,"QX","CONSULT/REQUEST TRACKING")
76 ;
Note: See TracBrowser for help on using the repository browser.