source: WorldVistAEHR/trunk/r/PHARMACY_PRESCRIPTION_PRACTICE-PPP/PPPCNV1.m@ 823

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

initial load of WorldVistAEHR

File size: 1.2 KB
RevLine 
[613]1PPPCNV1 ;ALB/DMB - PRESC. PRACT. CONVERSION ROUTINES ;1/24/92
2 ;;V1.0;PHARMACY PRESCRIPTION PRACTICE;;APR 7,1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5I2EDT(FMDT) ; Convert FileMan date to external format
6 ;
7 N Y
8 ;
9 S Y=FMDT X ^DD("DD") Q Y
10 ;
11E2IDT(EXTDT) ; Convert External Date To FileMan Format.
12 ;
13 N X,Y,DTOUT
14 ;
15 S X=EXTDT,%DT="" D ^%DT
16 Q Y
17 ;
18DIFFDT(FMD1,FMD2) ;Return the difference between two fileman dates
19 ;
20 N X1,X2,X,%Y
21 ;
22 I +FMD2=0 Q FMD1
23 S X1=FMD1,X2=FMD2
24 D ^%DTC
25 Q:'%Y -1
26 Q:%Y X
27 ;
28DIFFTM(FMD1,FMD2) ;Return the time difference between two fileman dates
29 ;
30 N S1,S2,T1,T2,X1,X2,X,%Y,TIMEDIFF
31 ;
32 ; Get the difference in days
33 ;
34 S X1=$P(FMD1,"."),X2=$P(FMD2,".")
35 D ^%DTC
36 Q:'%Y -1
37 S TIMEDIFF=X*24*60*60
38 ;
39 ; Now get the difference in times
40 ;
41 S T1=$P(FMD1,".",2)_"000000"
42 S S1=($E(T1,1,2)*3600)+($E(T1,3,4)*60)+$E(T1,5,6)
43 S T2=$P(FMD2,".",2)_"000000"
44 S S2=($E(T2,1,2)*3600)+($E(T2,3,4)*60)+$E(T2,5,6)
45 S TIMEDIFF=TIMEDIFF+(S1-S2)
46 Q TIMEDIFF
47 ;
48SLASHDT(FMDT) ; Convert Fileman date to MM/DD/YYYY
49 ;
50 N YR,MO,DY
51 ;
52 S YR=1700+$E(FMDT,1,3) Q:YR<1701 -1
53 S MO=$E(FMDT,4,5) Q:MO<1 -1
54 S DY=$E(FMDT,6,7) Q:DY<1 -1
55 Q MO_"/"_DY_"/"_YR
56 ;
57NOW() ; Get the current date/time
58 ;
59 N %,%H,%I,X
60 ;
61 D NOW^%DTC
62 Q %
Note: See TracBrowser for help on using the repository browser.