- MAGGSU1 ;WOIFO/GEK - Utilities for Imaging ; 01 Nov 2001 12:32 PM
- ;;3.0;IMAGING;**7**;Jul 12, 2002
- ;; +---------------------------------------------------------------+
- ;; | Property of the US Government. |
- ;; | No permission to copy or redistribute this software is given. |
- ;; | Use of unreleased versions of this software requires the user |
- ;; | to execute a written test agreement with the VistA Imaging |
- ;; | Development Office of the Department of Veterans Affairs, |
- ;; | telephone (301) 734-0100. |
- ;; | |
- ;; | The Food and Drug Administration classifies this software as |
- ;; | a medical device. As such, it may not be changed in any way. |
- ;; | Modifications to this software may result in an adulterated |
- ;; | medical device under 21CFR820, the use of which is considered |
- ;; | to be a violation of US Federal Statutes. |
- ;; +---------------------------------------------------------------+
- ;;
- Q
- IMGDTTM(X,EXT,INT) ; We call here from anywhere in Imaging, to get
- ; Internal and External dates/times. That way all imaging windows will
- ; have same date format.
- ;X IS THE INPUT. Internal or External or Partial
- ;EXT is the external form of the date. Passed by reference
- ;INT is the internal form of the date. Passed by reference
- ;Return is 1^
- ; or 0^error message (invalid format)
- ; EXTERNAL FORMAT RETURNED BY THIS CALL IS
- ; MM/DD/YYYY i.e. 01/01/2000
- N MAGY,Y
- D DT^DILF("TE",X,.MAGY)
- I $G(MAGY,-1)=-1 Q ""
- ; Standard external returned by DT^DILF is Jan 01, 2000
- ; If we wanted that as imaging format, we could stop here
- ; and Return MAGY(0) as External
- S INT=MAGY
- S EXT=$$FMTE^XLFDT(MAGY,"5Z")
- Q 1
- IMGDT(X,EXT,INT) ;Return just the date, no time
- N Y
- S Y=$$IMGDTTM(X,.EXT,.INT)
- S EXT=$P(EXT,"@")
- Q Y
- EXTDT(X) ;
- N Y,EXT
- S Y=$$IMGDTTM(X,.EXT) I 'Y Q Y
- Q $P(EXT,"@")
- EXTDTTM(X) ;
- N Y,EXT
- S Y=$$IMGDTTM(X,.EXT) I 'Y Q Y
- Q EXT
- INTDT(X) ;
- N Y,INT,EXT
- S Y=$$IMGDT(X,.EXT,.INT) I 'Y Q Y
- Q INT
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGGSU1 2188 printed Feb 18, 2025@23:29:22 Page 2
- MAGGSU1 ;WOIFO/GEK - Utilities for Imaging ; 01 Nov 2001 12:32 PM
- +1 ;;3.0;IMAGING;**7**;Jul 12, 2002
- +2 ;; +---------------------------------------------------------------+
- +3 ;; | Property of the US Government. |
- +4 ;; | No permission to copy or redistribute this software is given. |
- +5 ;; | Use of unreleased versions of this software requires the user |
- +6 ;; | to execute a written test agreement with the VistA Imaging |
- +7 ;; | Development Office of the Department of Veterans Affairs, |
- +8 ;; | telephone (301) 734-0100. |
- +9 ;; | |
- +10 ;; | The Food and Drug Administration classifies this software as |
- +11 ;; | a medical device. As such, it may not be changed in any way. |
- +12 ;; | Modifications to this software may result in an adulterated |
- +13 ;; | medical device under 21CFR820, the use of which is considered |
- +14 ;; | to be a violation of US Federal Statutes. |
- +15 ;; +---------------------------------------------------------------+
- +16 ;;
- +17 QUIT
- IMGDTTM(X,EXT,INT) ; We call here from anywhere in Imaging, to get
- +1 ; Internal and External dates/times. That way all imaging windows will
- +2 ; have same date format.
- +3 ;X IS THE INPUT. Internal or External or Partial
- +4 ;EXT is the external form of the date. Passed by reference
- +5 ;INT is the internal form of the date. Passed by reference
- +6 ;Return is 1^
- +7 ; or 0^error message (invalid format)
- +8 ; EXTERNAL FORMAT RETURNED BY THIS CALL IS
- +9 ; MM/DD/YYYY i.e. 01/01/2000
- +10 NEW MAGY,Y
- +11 DO DT^DILF("TE",X,.MAGY)
- +12 IF $GET(MAGY,-1)=-1
- QUIT ""
- +13 ; Standard external returned by DT^DILF is Jan 01, 2000
- +14 ; If we wanted that as imaging format, we could stop here
- +15 ; and Return MAGY(0) as External
- +16 SET INT=MAGY
- +17 SET EXT=$$FMTE^XLFDT(MAGY,"5Z")
- +18 QUIT 1
- IMGDT(X,EXT,INT) ;Return just the date, no time
- +1 NEW Y
- +2 SET Y=$$IMGDTTM(X,.EXT,.INT)
- +3 SET EXT=$PIECE(EXT,"@")
- +4 QUIT Y
- EXTDT(X) ;
- +1 NEW Y,EXT
- +2 SET Y=$$IMGDTTM(X,.EXT)
- IF 'Y
- QUIT Y
- +3 QUIT $PIECE(EXT,"@")
- EXTDTTM(X) ;
- +1 NEW Y,EXT
- +2 SET Y=$$IMGDTTM(X,.EXT)
- IF 'Y
- QUIT Y
- +3 QUIT EXT
- INTDT(X) ;
- +1 NEW Y,INT,EXT
- +2 SET Y=$$IMGDT(X,.EXT,.INT)
- IF 'Y
- QUIT Y
- +3 QUIT INT