Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BADE10P3

BADE10P3.m

Go to the documentation of this file.
BADE10P3 ;IHS/GDIT/DMB - Dentrix HL7 interface ;20-Feb-2013
 ;;1.0;DENTAL/EDR INTERFACE;**3**;FEB 20, 2013;Build 4
 ;
 Q
POST ; Post Install Entry Point
 D BMES^XPDUTL("Starting Post-Install")
 D HLO
 D CNT
 D BMES^XPDUTL("Post-Install is complete")
 Q
 ;
HLO ;
 N QUEUE,HL778IEN,MSG,CNT,CNT2
 D BMES^XPDUTL("  Clearing Invalid Entries on the HLO queue")
 S QUEUE="",CNT=0,CNT2=0
 F  S QUEUE=$O(^HLB("QUEUE","OUT",QUEUE)) Q:QUEUE=""  D
 . S HL778IEN=""
 . F  S HL778IEN=$O(^HLB("QUEUE","OUT",QUEUE,"DENT ADT",HL778IEN)) Q:'HL778IEN  D
 .. S CNT=CNT+1
 .. I CNT#1000=1 W "."
 .. S MSG=$G(^HLB(HL778IEN,0))
 .. I MSG="" K ^HLB("QUEUE","OUT",QUEUE,"DENT ADT",HL778IEN) S CNT2=CNT2+1 Q
 .. I MSG'["DENT ADT" K ^HLB("QUEUE","OUT",QUEUE,"DENT ADT",HL778IEN) S CNT2=CNT2+1 Q
 .. I $P(MSG,U,9),$P(MSG,U,20)="SU" K ^HLB("QUEUE","OUT",QUEUE,"DENT ADT",HL778IEN) S CNT2=CNT2+1 Q
 D BMES^XPDUTL("    "_CNT2_" entries corrected")
 Q
CNT ; Find latest message number that was used in each category and reset the message IEN counters.
 N INTCP,INNOTCP,OUTTCP,OUTNOTCP,OUT
 D BMES^XPDUTL("  Checking/resetting HLO message counters")
 ; Global ^HLA; File 777
 ;^HLC("FILE777","OUT") 0 thru 99999999999
 S OUT=$O(^HLA(100000000000),-1)
 S ^HLC("FILE777","OUT")=OUT
 ;^HLC("FILE777","IN","TCP") 100000000000 thru 199999999999
 S INTCP=$O(^HLA(200000000000),-1)
 I INTCP<100000000000 S INTCP=0
 E  S INTCP=INTCP#100000000000
 S ^HLC("FILE777","IN","TCP")=INTCP
 ;^HLC("FILE777","IN","NOT TCP") 200000000000 thru 299999999999
 S INNOTCP=$O(^HLA(300000000000),-1)
 I INNOTCP<200000000000 S INNOTCP=0
 E  S INNOTCP=INNOTCP#200000000000
 S ^HLC("FILE777","IN","NOT TCP")=INNOTCP
 ; Global HLB; File 778
 ;^HLC("FILE778","OUT","TCP") 0 thru 99999999999
 S OUTTCP=$O(^HLB(100000000000),-1)
 S ^HLC("FILE778","OUT","TCP")=OUTTCP
 ;^HLC("FILE778","OUT","NOT TCP") 100000000000 thru 199999999999
 S OUTNOTCP=$O(^HLB(200000000000),-1)
 I OUTNOTCP<100000000000 S OUTNOTCP=0
 E  S OUTTCP=OUTTCP#100000000000
 S ^HLC("FILE778","OUT","NOT TCP")=OUTNOTCP
 ;^HLC("FILE778","IN","TCP") 200000000000 thru 299999999999
 S INTCP=$O(^HLB(300000000000),-1)
 I INTCP<200000000000 S INTCP=0
 E  S INTCP=INTCP#200000000000
 S ^HLC("FILE778","IN","TCP")=INTCP
 ;^HLC("FILE778","IN","NOT TCP") 300000000000 thru 399999999999
 S INNOTCP=$O(^HLB(400000000000),-1)
 I INNOTCP<300000000000 S INNOTCP=0
 E  S INNOTCP=INNOTCP#300000000000
 S ^HLC("FILE778","IN","NOT TCP")=INNOTCP
 Q