| 328 | == How to implement == |
| 329 | To implement the changes in hashing and encryption, you need to perform conversions while users are offline from the system. The number of conversions you have to perform depends on the number of packages that use these features. In the world outside of the VA, these most likely will be the TIU and Radiology/Nuclear Medicine packages, results in two conversions in addition to that of hashing the electronic signature. |
| 330 | |
| 331 | As hashing is a lossy operation, it can only be done once from the plain text. To hash electronic signatures, you need to perform a loop on the new person file like this: |
| 332 | |
| 333 | {{{ |
| 334 | NP ; New Person File electronic signature conversion from plain text to hashed. |
| 335 | W !,"Hashing electronic signatures",! |
| 336 | N DUZ ; Needed for the hashing algorithm |
| 337 | N I S I=0 F S I=$O(^VA(200,I)) Q:'I D ; for each NP |
| 338 | . N OLDES S OLDES=$P($G(^VA(200,I,20)),U,4) ; Get old signature |
| 339 | . Q:'$L(OLDES) ; quit if it doesn't exist. |
| 340 | . W I_" " |
| 341 | . S DUZ=I ; DUZ is a hash salt |
| 342 | . N X S X=OLDES D HASH^XUSHSHP ; hash old sig |
| 343 | . S $P(^VA(200,I,20),U,4)=X ; store result |
| 344 | W ! |
| 345 | QUIT |
| 346 | }}} |
| 347 | |
| 348 | PLEASE NOTE THAT IF YOU RUN THIS MORE THAN ONCE, YOU WILL NOT BE ABLE TO RETRIEVE BACK THE USER'S ELECTRONIC SIGNATURES. |
| 349 | |
| 350 | To convert TIU notes, perform the following: |
| 351 | {{{ |
| 352 | TIU ; Encrypt Signatures for TIU documents; from plain text to encrypted. |
| 353 | W !,"Encrypting Signature Names and Titles in TIU Documents",! |
| 354 | K ^TMP($J,"UJOFDA") ; FDA Array |
| 355 | N I S I=0 F S I=$O(^TIU(8925,I)) Q:'I D ; for each document |
| 356 | . N SB S SB=$G(^(I,15)) ; Get signature block **NAKED** |
| 357 | . Q:SB="" |
| 358 | . W I_" " |
| 359 | . ; We get the following fields: |
| 360 | . ; - 1503 SIGNATURE BLOCK NAME (FOX), [15;3] |
| 361 | . ; - 1504 SIGNATURE BLOCK TITLE (FOX), [15;4] |
| 362 | . ; - 1509 COSIGNATURE BLOCK NAME (FXO), [15;9] |
| 363 | . ; - 1510 COSIGNATURE BLOCK TITLE (FXO), [15;10] |
| 364 | . N F1503,F1504,F1509,F1510 ; encrypted pieces now in plain text |
| 365 | . S F1503=$P(SB,U,3),F1504=$P(SB,U,4),F1509=$P(SB,U,9),F1510=$P(SB,U,10) ; get text values |
| 366 | . ; |
| 367 | . ; Store in FDA. |
| 368 | . S:$L(F1503) ^TMP($J,"UJOFDA",8925,I_",",1503)=F1503 |
| 369 | . S:$L(F1504) ^TMP($J,"UJOFDA",8925,I_",",1504)=F1504 |
| 370 | . S:$L(F1509) ^TMP($J,"UJOFDA",8925,I_",",1509)=F1509 |
| 371 | . S:$L(F1510) ^TMP($J,"UJOFDA",8925,I_",",1510)=F1510 |
| 372 | ; |
| 373 | D CLEAN^DILF ; clean up variables |
| 374 | D WAIT^DICD ; Please wait a while |
| 375 | D FILE^DIE("ET",$NA(^TMP($J,"UJOFDA"))) ; External Values, Transaction |
| 376 | ; ZEXCEPT: DIERR ; Fileman variable cleaned in CLEAN^DILF call |
| 377 | I $D(DIERR) W "An error occured",! S $EC=",U1," |
| 378 | W !! |
| 379 | QUIT |
| 380 | }}} |
| 381 | |