MAGQLOG ;WOIFO/RED/SRR/RMP - Log image electronic Sig access ; [ 06/20/2001 08:57 ]
;;3.0;IMAGING;;Mar 01, 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. |
;; +---------------------------------------------------------------+
;;
; CALL WITH:
; MAGIMT = TYPE OF ACCESS
; DUZ = USER NO.
; MAGO = IMAGE SUBSCRIPT NO.
; MAGDFN = PATIENT NO.
; MAGCT =
; MAGES = ELECTRONIC SIGNATURE
ENTRY(RESULT,MAGIMT,MAGDUZ,MAGO,MAGDFN,MAGCT,MAGES) ;
N MAGC,MAG1
I '$D(DUZ) S RESULT="0^INVALID user number" Q
S MAGDUZ=DUZ
I '$D(^MAG(2006.95,0)) S RESULT="0^No Log File" Q
D ESIG(.RESULT,MAGES)
D:+RESULT ENTRY^MAGLOG($E("ES"_$G(MAGIMT)_"COPY",1,10),MAGDUZ,MAGO,"Copy-WIN",MAGDFN,MAGCT)
Q
ESIG(RESULT,SIG) ;-- Verify electronic signature
S X=$$DECRYP^ROUTINE(SIG)
D HASH^ROUTINE
I '$D(DUZ) S RESULT="0^INVALID user number" Q
S X1=$$GET1^DIQ(200,DUZ,20.4,"I")
I X1="" S RESULT="0^Missing signature parameters" Q
I X1'=X S RESULT="0^Invalid signature" Q
S RESULT="1^Signature verified"
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGQLOG 1901 printed Nov 22, 2024@17:18:14 Page 2
MAGQLOG ;WOIFO/RED/SRR/RMP - Log image electronic Sig access ; [ 06/20/2001 08:57 ]
+1 ;;3.0;IMAGING;;Mar 01, 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 ; CALL WITH:
+18 ; MAGIMT = TYPE OF ACCESS
+19 ; DUZ = USER NO.
+20 ; MAGO = IMAGE SUBSCRIPT NO.
+21 ; MAGDFN = PATIENT NO.
+22 ; MAGCT =
+23 ; MAGES = ELECTRONIC SIGNATURE
ENTRY(RESULT,MAGIMT,MAGDUZ,MAGO,MAGDFN,MAGCT,MAGES) ;
+1 NEW MAGC,MAG1
+2 IF '$DATA(DUZ)
SET RESULT="0^INVALID user number"
QUIT
+3 SET MAGDUZ=DUZ
+4 IF '$DATA(^MAG(2006.95,0))
SET RESULT="0^No Log File"
QUIT
+5 DO ESIG(.RESULT,MAGES)
+6 if +RESULT
DO ENTRY^MAGLOG($EXTRACT("ES"_$GET(MAGIMT)_"COPY",1,10),MAGDUZ,MAGO,"Copy-WIN",MAGDFN,MAGCT)
+7 QUIT
ESIG(RESULT,SIG) ;-- Verify electronic signature
+1 SET X=$$DECRYP^ROUTINE(SIG)
+2 DO HASH^ROUTINE
+3 IF '$DATA(DUZ)
SET RESULT="0^INVALID user number"
QUIT
+4 SET X1=$$GET1^DIQ(200,DUZ,20.4,"I")
+5 IF X1=""
SET RESULT="0^Missing signature parameters"
QUIT
+6 IF X1'=X
SET RESULT="0^Invalid signature"
QUIT
+7 SET RESULT="1^Signature verified"
+8 QUIT
+9 ;