source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOCMPA.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1OCXOCMPA ;SLC/RJS,CLA - ORDER CHECK CODE COMPILER (Convert Constant Values to internal format) ;10/29/98 12:37
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5 Q
6 ;
7EXT2INT(OCXDT,OCXVAL) ;
8 ;
9 I (OCXDT="DATE/TIME") D
10 .N X,%DT
11 .I (OCXVAL="TOMORROW") S OCXVAL="T+1" Q
12 .I (OCXVAL="YESTERDAY") S OCXVAL="T-1" Q
13 .I (OCXVAL["TODAY") S OCXVAL=$P(OCXVAL,"TODAY",1)_"T"_$P(OCXVAL,"TODAY",2) Q
14 .I (OCXVAL["NOW") S OCXVAL=$P(OCXVAL,"NOW",1)_"N"_$P(OCXVAL,"NOW",2) Q
15 .Q:(OCXVAL="N") Q:(OCXVAL?1"N+".N) Q:(OCXVAL?1"N-".N)
16 .Q:(OCXVAL="T") Q:(OCXVAL?1"T+".N) Q:(OCXVAL?1"T-".N)
17 .S X=OCXVAL,%DT="T" D ^%DT S:(Y>0) OCXVAL=+Y
18 ;
19 Q $$QT(OCXVAL)
20 ;
21QT(X) ;
22 I ($E(X,1)="""") Q X
23 I (+X=X) Q X
24 S X=""""_X_""""
25 Q X
26 ;
27INT2DT(OCXDT) ; This Local Extrinsic Function converts an OCX internal format
28 ; date into an Externl Format (Human Readable) date.
29 ;
30 Q:'$L($G(OCXDT)) ""
31 N OCXYR,OCXLPYR,OCXMON,OCXDAY,OCXHR,OCXMIN,OCXSEC
32 S (OCXYR,OCXLPYR,OCXMON,OCXDAY,OCXHR,OCXMIN,OCXSEC,OCXAP)=""
33 S OCXSEC=$E(OCXDT#60+100,2,3),OCXDT=OCXDT\60
34 S OCXMIN=$E(OCXDT#60+100,2,3),OCXDT=OCXDT\60
35 S OCXHR=$E(OCXDT#24+100,2,3),OCXDT=OCXDT\24
36 S OCXYR=(OCXDT\1461)*4+1841,OCXDT=OCXDT#1461
37 S OCXLPYR=(OCXDT\365),OCXDT=OCXDT-(OCXLPYR*365),OCXYR=OCXYR+OCXLPYR
38 S OCXCNT="031^059^090^120^151^181^212^243^273^304^334^365"
39 S:(OCXLPYR=3) OCXCNT="031^060^091^121^152^182^213^244^274^305^335^366"
40 F OCXMON=1:1:12 Q:(OCXDT<$P(OCXCNT,U,OCXMON))
41 S OCXDAY=OCXDT-$P(OCXCNT,U,OCXMON-1)+1
42 S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,OCXMON)
43 S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
44 S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
45 Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
46 Q OCXMON_" "_OCXDAY_","_OCXYR
47 ;
Note: See TracBrowser for help on using the repository browser.