source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVORE2.m@ 1036

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1GMRVORE2 ;HIRMFO/RM,MD-USER PROMPT ROUTINE ;12/10/96 11:47
2 ;;4.0;Vitals/Measurements;;Apr 25, 1997
3ASK ; ASK PROMPTS FOR AN ORDER GMRVORDF=START^STOP^ADM SCH^SPEC INSTRUCT
4 ; WHERE IF THE PIECE="" THEN NO DEFAULT FOR PROMPT
5 ; THE PIECE=VALUE THEN VALUE IS DEFAULT FOR PROMPT
6 ; THE PIECE=~VALUE THEN VALUE TO BE STUFFED WITHOUT PROMPT
7 ; RETURNS GMRVORAN=START^STOP^ADM SCH^ADM TIME^FREQ^COMM WITH
8 ; THE ANSWERS, AND GMROUT.
9 ;
10 I ORACTION=1,'GMRVNEW W !!,"Editing order ",$P(GMRVORD(2),U,5)
11STDT ;
12 I GMRVSTRT?1"~".E S GMRVSTRT=$E(GMRVSTRT,2,99) G SCHED
13 I +GMRVSTRT S Y=GMRVSTRT D D^DIQ S %DT("B")=Y
14 S %DT("A")="Start DATE (TIME optional): ",Y=$S($P(GMRVORD(1),U,9)'=""&(ORACTION=2):$P(GMRVORD(1),U,9),$P(GMRVORD(2),U,6)="":"NOW",1:$P(GMRVORD(2),U,6))
15 X ^DD("DD") S:'$D(%DT("B")) %DT("B")=Y S %DT="AETX" S:$P($G(GMRVANSR),U,2)'="" %DT(0)=-$S($P(GMRVANSR,U,2)["~":$E($P(GMRVANSR,U,2),2,99),1:$P(GMRVANSR,U,2)) D ^%DT K %DT I +Y'>0 S GMROUT=1 Q
16 S GMRVSTRT=+Y
17SCHED ;
18 I GMRVAS?1"~".E D G EDCM
19 . S PSJX=$E(GMRVAS,2,99),PSJPP="GMRV",PSJNE=1 D ENSV^PSJEEU
20 . S GMRVAS=$G(PSJX)_U_PSJAT_U_PSJM
21 . K PSJX,PSJPP,PSJM,PSJAT,PSJY,PSJTS,PSJAX,PSJW,PSJNE
22 . Q
23 D:ORACTION=1!(ORACTION=0) ADS^GMRVORC0 Q:GMROUT
24EDCM ;
25 I GMRVCOM?1"~".E S GMRVCOM=$E(GMRVCOM,2,99) G STOP
26 S GMRVDF=$P(GMRVCOM,"^") W !,"Special Instructions: "_$S(GMRVDF'="":GMRVDF_"// ",1:"") R GMRVCOM:DTIME S:'$T GMRVCOM="^^" S:$T&(GMRVDF'="")&(GMRVCOM="") GMRVCOM=GMRVDF S $P(GMRVORAN,U,6)=GMRVCOM
27 I "^^"[GMRVCOM S:$L(GMRVCOM) GMROUT=1 S:GMRVCOM="^^" DIROUT=1 G:'$L(GMRVCOM) STOP Q
28DCM I GMRVCOM="@",GMRVDF'="" S %="" W !,?4,$C(7),"Are you sure you want to delete these SPECIAL INSTRUCTIONS" D YN^DICN G:%=2 EDCM W:%=0 !,?5,$C(7),"Answer YES or NO" G:%=0 DCM I %=1!(%=-1) S:%=-1 GMROUT=1 S:%=1 GMRVCOM="@" Q
29 I '($L(GMRVCOM)>2&($L(GMRVCOM)<101)&(GMRVCOM?1AN.E)) W:GMRVCOM'?1"?".E $C(7)," ??" S:GMRVCOM?2"?".E XQH="GMRV-ORD. ADDL INFO" D:GMRVCOM?2"?".E EN^XQH W:GMRVCOM?1"?".E !!,?3,"Answer must be 3-100 characters in length" S GMRVCOM="" G EDCM
30STOP ;
31 I GMRVSTOP?1"~".E S GMRVSTOP=$E(GMRVSTOP,2,99) Q
32 I +GMRVSTOP S Y=GMRVSTOP D D^DIQ S %DT("B")=Y
33 S %DT("A")="Stop DATE (TIME optional): " I $S((ORACTION=2!($P(GMRVORD(1),U,9)=""))&$D(^GMRD(120.57,1,0)):1,1:0) S X1=GMRVSTRT,X2=+$P(^GMRD(120.57,1,0),U,2) D C^%DTC
34 S Y=$S(ORACTION'=2&($P(GMRVORD(1),U,9)'=""):$P(GMRVORD(1),U,9),'$D(^GMRD(120.57,1,0)):GMRVSTRT,1:X)
35 X ^DD("DD") S:'$D(%DT("B")) %DT("B")=Y S %DT="AETX" S:$D(GMRVANSR) %DT(0)=+$S($P(GMRVANSR,U)["~":$E($P(GMRVANSR,U),2,99),1:$P(GMRVANSR,U)) D ^%DT K %DT I +Y'>0 S GMROUT=1 Q
36 I Y<GMRVSTRT W !,?3,$C(7),"THE STOP DATE CANNOT BE EARLIER THAN THE START DATE" G STOP
37 S GMRVSTOP=+Y
38 Q
Note: See TracBrowser for help on using the repository browser.