source: WorldVistAEHR/trunk/r/GEN_MED_REC_GENERATOR-GMRG/GMRGED0.m@ 1154

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

initial load of WorldVistAEHR

File size: 3.4 KB
RevLine 
[613]1GMRGED0 ;HIRMFO/RM,RTK-TEXT GENERATOR PATIENT DATA EDIT ;9/11/95
2 ;;3.0;Text Generator;;Jan 24, 1996
3EN1 ; ENTRY TO GMR TEXT GENERATOR IF PRIME DOCUMENT IS KNOWN
4 ; GMRGRT=PTR TO 124.2 FOR PD^PD TEXT
5 Q:'$D(GMRGRT) Q:$P(GMRGRT,"^")'>0!($P(GMRGRT,"^",2)="")
6 S (GMRGUP,GMRGOUT)=0,DIC="^DPT(",DIC(0)="AEQM",DIC("A")="Select Patient: " W ! D ^DIC K DIC S:$D(DTOUT)!$D(DUOUT) GMRGOUT=1 S:+Y'>0 GMRGUP=1 G Q1:GMRGOUT!GMRGUP S DFN=+Y
7 D EN4 G Q1:GMRGOUT!GMRGUP,EN1
8Q1 K DFN,DIC,DTOUT,DUOUT,GMRGUP
9 Q
10EN4 ; ENTRY IF PATIENT, PRIME DOCUMENT KNOWN
11 Q:'$D(GMRGRT)!'$D(DFN)
12 S GMRGXPRT="0^1^1" D EN1^GMRGRUT3 G:GMRGOUT!(GMRGPDA'>0) Q4
13 D EN3 G Q4:GMRGOUT!GMRGUP,EN4
14Q4 S GMRGUP=0 K GMRGPDA
15 Q
16EN3 ; ENTRY IF PATIENT, PRIME DOCUMENT AND GMR TEXT 124.3 FILE ENTRY KNOWN.
17 ; DFN=PTR TO PATIENT, GMRGPDA=PTR TO 124.3 FILE, GMRGRT= PDOC PTR^TEXT
18 Q:'$D(DFN)!'$D(GMRGPDA)!'$D(GMRGRT) Q:DFN'>0!(GMRGPDA'>0)!($P(GMRGRT,"^")'>0)!($P(GMRGRT,"^",2)="") K GMRGTPLT
19 S GMRGOUT=0 L +^GMR(124.3,GMRGPDA,0):1 I '$T W !,$C(7),"ANOTHER TERMINAL IS EDITING THIS ENTRY!!" L -^GMR(124.3,GMRGPDA,0) Q
20 D BEGADD^GMRGED7
21 D DEM^VADPT,INP^VADPT
22 S GMRGVNAM=VADM(1),GMRGVSSN=$P(VADM(2),U,2),GMRGVDOB=$P(VADM(3),U,2),GMRGVAGE=VADM(4),GMRGVAMV=VAIN(1),GMRGVPRV=$P(VAIN(2),U,2),GMRGVWRD=$P(VAIN(4),U,2),GMRGVRBD=VAIN(5),GMRGVADT=$P(VAIN(7),U,2),GMRGVDX=VAIN(9) D KVAR^VADPT K VA
23 K ^TMP($J) S GMRGTOP(0)=+GMRGRT,(GMRGNORD,GMRGUP)=0,(GMRGTOP,GMRGLVL)=1,GMRGLVL(1)=1,GMRGLVL(1,1)=1,GMRGTERM=GMRGRT,GMRGTERM(0)=$S($D(^GMRD(124.2,+GMRGRT,0)):^(0),1:""),GMRGSCRP=0
24 S GMRGSITE=$S($P(GMRGTERM(0),"^",3)="":"",1:$O(^GMRD(124.1,1,1,"B",$P(GMRGTERM(0),"^",3),0))),GMRGSITE("P")=$S($D(^GMRD(124.1,1,1,+GMRGSITE,"P")):^("P"),1:""),GMRGSITE(0)=$S($D(^GMRD(124.1,1,1,+GMRGSITE,0)):^(0),1:"")
25 S GMRGPRC=$P(GMRGRT,"^")_"^^0",GMRGPRC(0)=$P(GMRGRT,"^",2),^TMP($J,"GMRGLVL",1,1,1)=$P(GMRGRT,"^")_"^^0",^TMP($J,"GMRGLVL",1,1,1,0)=$P(GMRGRT,"^",2)
26 S IOP="HOME" D ^%ZIS S X="IORVON;IORVOFF" D ENDR^%ZISS S GMRGIO("RVOF")=IORVOFF,GMRGIO("RVON")=IORVON,GMRGIO("S")=$L(GMRGIO("RVOF"))&$L(GMRGIO("RVON")) K IORVOFF,IORVON
27 S (GMRGLIN("-"),GMRGLIN("*"))="",$P(GMRGLIN("-"),"-",IOM+1)="",$P(GMRGLIN("*"),"*",IOM+1)="" ;D:$D(XRTL) T0^%ZOSV ; START RT
28 D EN1^GMRGED1 D QP^GMRGED2 S:'GMRGUP GMRGUP=GMRGNORD#2
29 I GMRGUP,'GMRGOUT D G Q3:GMRGOUT!GMRGUP,EN3
30 . W ! S DIR("A")="Would you like to print a copy of this "_$P(GMRGRT,"^",2)_"? ",DIR(0)="YA",DIR("B")="YES" D ^DIR S:"^^"[Y GMRGOUT=1 Q:Y=0!GMRGOUT
31 . D NOW^%DTC S GMRGPDT=%,GMRGPROU="D "_$S(GMRGSITE("P")'="":GMRGSITE("P"),1:"EN1^GMRGPUTL") X GMRGPROU
32 . Q
33Q3 K ^TMP($J),D,DIK,GMRG0,GMRG00,GMRG01,GMRG02,GMRG03,GMRG1,GMRG2,GMRG10,GMRG11,GMRG12,GMRG13,GMRG14,GMRG3,GMRG4,GMRG5,GMRG6,GMRG7,GMRG8,GMRGART,GMRGCNT,GMRGDLT,GMRGDN,GMRGHOW,GMRGIO,GMRGJUMP
34 K GMRGKU,GMRGL,GMRGLEN,GMRGLIN,GMRGLIST,GMRGLVL,GMRGOOD,GMRGMAX,GMRGMIN,GMRGMSR,GMRGND,GMRGNORD,GMRGPAT,GMRGPATH,GMRGPDT,GMRGPLN,GMRGPRC,GMRGPROU,GMRGPRT,GMRGPSEL,GMRGQ,GMRGQUSL,GMRGRDIS,GMRGREP
35 K GMRGS,GMRGSCRP,GMRGSEL,GMRGSELC,GMRGSELP,GMRGSITE,GMRGSLVL,GMRGSLY,GMRGST,GMRGSTAR,GMRGTCHK,GMRGTDL,GMRGTERM,GMRGTLC,GMRGTLVL,GMRGTOP,GMRGTPLT,GMRGTX,GMRGUSL,GMRGXDF,GMRGY,Y,Z D KVAR^VADPT K VA L -^GMR(124.3,GMRGPDA,0)
36 Q
37EN2 ; ENTRY TO GMR TEXT GENERATOR IF UNKNOWN PRIME DOCUMENT
38 W !
39 S DIC="^GMRD(124.2,",DIC(0)="AEQ",DIC("A")="Select Document for which patient data will be added: ",DIC("S")="S GMRG=$O(^GMRD(124.25,""B"",""PRIME DOCUMENT"",0)) I $P(^GMRD(124.2,+Y,0),U,4)=GMRG",DIC("W")="" D ^DIC K DIC G Q2:+Y'>0
40 S GMRGRT=Y D EN1 G Q2:GMRGOUT,EN2
41Q2 K GMRGOUT,GMRGRT,DIC,GMRG
42 Q
Note: See TracBrowser for help on using the repository browser.