source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGENUPL5.m@ 1396

Last change on this file since 1396 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1DGENUPL5 ;ALB/KCL/GSN - PROCESS INCOMING (Z11 EVENT TYPE) HL7 MESSAGES ; 5/6/03 2:45pm
2 ;;5.3;Registration;**222,504**;08/13/93
3 ;
4 ;DG*5.3*504 - Now, only updates the DG SECURITY LOG file #38.1 Zero
5 ; node, when SECURITY LEVEL [#2] goes from a Non-sensitive
6 ; value to a Sensitive value, i.e. (null or 0) to 1.
7GETLOCKS(DFN) ;
8 ; Description - Locks first the patient enrollment history, then the patient record. Used to sychronize the upload with registration and load/edit.
9 ;
10 ;Input: DFN - ien of patient record.
11 ;Output: none
12 ;
13 N COUNT
14 F COUNT=1:1:500 Q:$$BEGUPLD^DGENUPL3(DFN)
15 F COUNT=1:1:500 Q:$$LOCK^DGENA1(DFN)
16 F COUNT=1:1:500 Q:$$LOCK^DGENPTA1(DFN)
17 Q
18 ;
19 ;
20UNLOCK(DFN) ;
21 ; Description: releases the locks obtained by GETLOCKS()
22 ;
23 ;Input: DFN - ien of patient record
24 ;Output: none
25 ;
26 D ENDUPLD^DGENUPL3(DFN)
27 D UNLOCK^DGENA1(DFN)
28 D UNLOCK^DGENPTA1(DFN)
29 Q
30 ;
31 ;
32SECUPLD(DFN,DGSEC,OLDSEC) ;
33 ; Description: Upload a patient security record receieved from the
34 ; HEC. The consistency checks on the record are assumed
35 ; to have been completed.
36 ;
37 ; Input:
38 ; DFN - PATIENT ien
39 ; DGSEC - as array containing the patient security record, pass
40 ; by reference
41 ;
42 ; Output:
43 ; OLDSEC - as array containing the patient security record, prior
44 ; to upload of security data from HEC, pass by reference
45 ;
46 ;
47 N SECIEN
48 ;
49 ; is there a local security log record for the patient?
50 S SECIEN=$$FINDSEC^DGENSEC(DFN)
51 ;
52 ; if local security record, obtain record prior to upload
53 I $$GET^DGENSEC(SECIEN,.OLDSEC)
54 ;
55 ; if no local security log record for the patient, create a new
56 ; security log entry with HEC security
57 I 'SECIEN D
58 .I $$STORE^DGENSEC(.DGSEC)
59 E D
60 .; otherwise update the existing security log entry with HEC security
61 .; if new level = Yes and old level Not = Yes (DG*5.3*504)
62 .I $G(DGSEC("LEVEL"))=1,$G(OLDSEC("LEVEL"))'=1 D
63 ..I $$UPDATE^DGENSEC(DFN,.DGSEC)
64 .E D
65 ..; since no update occurring, then set arrays the same to prevent an
66 ..; Audit record from being created later.
67 ..M DGSEC=OLDSEC
68 ;
69 Q
Note: See TracBrowser for help on using the repository browser.