source: WorldVistAEHR/trunk/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGP52PST.m@ 717

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1RGP52PST ;BIR/PTD-POST-INIT TO RETIRE EXCEPTIONS #215, 216, and 217 ;05/20/08
2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**52**;30 Apr 99;Build 2
3 ;
4 ;Loop through the CIRN HL7 EXCEPTION LOG (#991.1) file.
5 ;Find exceptions with EXCEPTION STATUS of NOT PROCESSED ("0").
6 ;Get the TYPE which is a pointer to the CIRN HL7 EXCEPTION
7 ;TYPE (#991.11) file. If the TYPE is 215, 216, or 217,
8 ;mark the EXCEPTION STATUS to PROCESSED ("1"). These exception
9 ;types will not be generated in the future.
10 ;
11EXLOG ;
12 ;If patch RG*1.0*52 has previously been installed, quit post-init.
13 I $$PATCH^XPDUTL("RG*1.0*52") D BMES^XPDUTL(" Post-install previously ran; no need to reprocess file 991.1.") Q
14 ;Else continue with post-init.
15 ;
16 D BMES^XPDUTL(" The post-init routine will retire selected exceptions in")
17 D MES^XPDUTL(" the CIRN HL7 EXCEPTION LOG (#991.1) file.")
18 ;
19 N COUNT,DA,DIC,DIE,DR,EXNUM,EXCTYP,LOGIEN,X,Y,ZNODE
20 S (LOGIEN,COUNT)=0
21 F S LOGIEN=$O(^RGHL7(991.1,LOGIEN)) Q:'LOGIEN D
22 .S EXNUM=0
23 .F S EXNUM=$O(^RGHL7(991.1,LOGIEN,1,EXNUM)) Q:'EXNUM S ZNODE=$G(^(EXNUM,0)) I $P(ZNODE,"^",5)'=1 D ;Quit if EXCEPTION STATUS (#6) equals 1 for PROCESSED
24 ..S EXCTYP=$P(ZNODE,"^",3) ;Quit if TYPE is NOT one of these 3:
25 ..;215 - Death Entry on MPI not VISTA
26 ..;216 - Death Entry on Vista not MPI
27 ..;217 - Death Entries on MPI and Vista DON'T MATCH
28 ..I $S(EXCTYP=215:0,EXCTYP=216:0,EXCTYP=217:0,1:1) Q ;TYPE is one of the three we want to mark as PROCESSED
29 ..;
30DIE ..;Update the EXCEPTION STATUS (#6) field to '1'.
31 ..S DA(1)=LOGIEN,DA=EXNUM,DR="6///"_1
32 ..S DIE="^RGHL7(991.1,"_DA(1)_",1,"
33 ..L +^RGHL7(991.1,LOGIEN):10
34 ..D ^DIE K DA,DIE,DR
35 ..L -^RGHL7(991.1,LOGIEN)
36 ..S COUNT=COUNT+1
37 ;
38 D BMES^XPDUTL(" A total of "_COUNT_" exceptions were retired.")
39 D MES^XPDUTL(" Post-install routine for RG*1*52 completed successfully.")
40 Q
Note: See TracBrowser for help on using the repository browser.