MAGQE1 ;WOIFO/RMP - Support for MAG Enterprise ; 02/18/2005 09:19 ;;3.0;IMAGING;**27,29,30,20**;Apr 12, 2006 ;; +---------------------------------------------------------------+ ;; | 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 ; SDATE(FDAY,ORDER) ; Find first image before/after specified date ; EdM: In a future patch, this function must be replaced by a cross-reference. N I1,I2 I $G(ORDER)'="R" Q 0 S I1=$O(^MAG(2005," "),-1)+1 S I2=$O(^MAG(2005.1," "),-1)+1 Q $S(I1>I2:I1,1:I2) ; BPV(PLACE) ; N BPWS,D0,NODE,INDEX,WS K BPWS S WS="" F S WS=$O(^MAG(2006.8,"C",PLACE,WS)) Q:WS="" D . S D0=$O(^MAG(2006.8,"C",PLACE,WS,"")) . Q:$P($G(^MAG(2006.8,D0,0)),"^",12)'="1" . S NODE=$G(^MAG(2006.8,D0,1)) . D:$P(NODE,"^",2)>0 . . S INDEX=$P(NODE,"^",2)_"^"_$P(NODE,"^",4) . . S BPWS(INDEX)=$G(BPWS(INDEX))+1 . . S $P(BPWS(INDEX),"^",2)=$P(NODE,"^",3) . . Q . Q D:$D(BPWS) LLOAD^MAGQE5(.BPWS,"BP VERS NUM DATE: ") Q ; IWSV(PLACE) ; Image workstation versions N D0,IDX,OS,RD,WSC,WSD,WSV,X S RD=$$FMADD^XLFDT($$NOW^XLFDT,-180,"","","") S D0=0 F S D0=$O(^MAG(2006.81,"C",PLACE,D0)) Q:'D0 D . S X=^MAG(2006.81,D0,0) Q:$P(X,"^",3)