ROUTINE VASITE
From VistApedia
PRIM^VASITE:PRIM+9 PRIM(DATE) ; -returns medical center division of primary medical center division ; - input date, if date is null then date will be today ; N PRIM S:'$D(DATE) DATE=DT S DATE=DATE+.24 S PRIM=$G(^VA(389.9,+$O(^(+$O(^VA(389.9,"AIVDT1",1,$$IVDATE(DATE))),0)),0)) Q $S($P(PRIM,"^",4)?3N:$P(PRIM,"^",3),1:-1) ;