source: WorldVistAEHR/trunk/r/VOLUNTARY_TIMEKEEPING-ABSV/ABSVU1.m@ 1133

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

initial load of WorldVistAEHR

File size: 937 bytes
RevLine 
[613]1ABSVU1 ;VAMC ALTOONA/CTB - MISC UTILITY PROGRAMS ;2/10/00 2:31 PM
2V ;;4.0;VOLUNTARY TIMEKEEPING;**7,10,15,18**;JULY 6, 1994
3GET(A,B,C,D) ;function to insert variables C and D into phrase A in language B.
4 N X,ONE,TWO
5 S B=$S($G(B)>0:B,1:1),ONE="|1|",TWO="|2|"
6 S X=$$PHRASE(A,B)
7 I $D(C),X[ONE S X=$P(X,ONE,1)_C_$P(X,ONE,2,99)
8 I $D(D),X[TWO S X=$P(X,TWO,1)_D_$P(X,TWO,2,99)
9 QUIT X
10PHRASE(F,G) ;
11 N H
12 I F Q $G(^ABS(503339,F,G))
13 S H=$O(^ABS(503339,"C",$E(F,1,30),0)) I 'H Q "INVALID PHRASE - CONTACT PROGRAMMER - "_F
14 Q $G(^ABS(503339,H,G))
15BDATE(AA) ;FUNCTION TO DETERMINE IF DATE IS LESS THAN 5 YEARS IN THE PAST
16 ;RETURNS 0 IF < 5 YEARS OR 1 IF GREATER
17 ;REQUIRES DT
18 N X,Y,Z,%,ABSVXA,ABSVXB
19 Q:'$D(ABSV("SITE")) 1
20 S X=DT-50000
21 Q:(AA<X) 1
22 W ! S ABSVXA="Are you sure about this date",ABSVXB="",%=2 D ^ABSVYN
23 Q:(%=1) 1
24 Q 0
25STRIP(X) ;FUNCTION TO STRIP LEADING BLANKS FROM STRING
26 F S:$E(X)=" " X=$E(X,2,$L(X)) Q:$E(X)'=" "
27 Q X
Note: See TracBrowser for help on using the repository browser.