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

HLPAT96B.m

Go to the documentation of this file.
  1. HLPAT96B ;CIOFO-SF/RJH - HL7 PATCH 96 PRE&POST-INIT ;02/06/03 14:49
  1. ;;1.6;HEALTH LEVEL SEVEN;**96**;Oct 13, 1995
  1. ;
  1. ; Part III of Pre-install and Post-install
  1. ; Entries: EVN, MSG, SEG, DELETE, and IDOFF, are called from HLPAT96
  1. Q
  1. EVN ; find duplicate entries in file #779.001(Event Type)
  1. N HLEVN,HLIEN,SUB
  1. S HLEVN=""
  1. F S HLEVN=$O(^HL(779.001,"B",HLEVN)) Q:HLEVN="" D
  1. . S HLIEN=0,SUB=0
  1. . F S HLIEN=$O(^HL(779.001,"B",HLEVN,HLIEN)) Q:'HLIEN D
  1. .. I $D(^HL(779.001,HLIEN,0)),$P(^HL(779.001,HLIEN,0),"^")=HLEVN D
  1. ... S SUB=SUB+1
  1. ... S HLEVNARY(HLEVN,SUB)=HLIEN
  1. . I SUB=1 K HLEVNARY(HLEVN)
  1. Q
  1. MSG ; find duplicate entries in file #771.2(Message Type)
  1. N HLMSG,HLIEN,SUB
  1. S HLMSG=""
  1. F S HLMSG=$O(^HL(771.2,"B",HLMSG)) Q:HLMSG="" D
  1. . S HLIEN=0,SUB=0
  1. . F S HLIEN=$O(^HL(771.2,"B",HLMSG,HLIEN)) Q:'HLIEN D
  1. .. I $D(^HL(771.2,HLIEN,0)),$P(^HL(771.2,HLIEN,0),"^")=HLMSG D
  1. ... S SUB=SUB+1
  1. ... S HLMSGARY(HLMSG,SUB)=HLIEN
  1. . I SUB=1 K HLMSGARY(HLMSG)
  1. Q
  1. SEG ; find duplicate entries in file #771.3(Segment Type)
  1. N HLSEG,HLIEN,SUB
  1. S HLSEG=""
  1. F S HLSEG=$O(^HL(771.3,"B",HLSEG)) Q:HLSEG="" D
  1. . S HLIEN=0,SUB=0
  1. . F S HLIEN=$O(^HL(771.3,"B",HLSEG,HLIEN)) Q:'HLIEN D
  1. .. I $D(^HL(771.3,HLIEN,0)),$P(^HL(771.3,HLIEN,0),"^")=HLSEG D
  1. ... S SUB=SUB+1
  1. ... S HLSEGARY(HLSEG,SUB)=HLIEN
  1. . I SUB=1 K HLSEGARY(HLSEG)
  1. Q
  1. DELETE ; delete duplicate entries in file #779.001, #771.2 and #771.3
  1. N HLEVN,HLMSG,HLSEG,HLSUB,DIK,DA
  1. ; delete duplicate entries in file #779.001
  1. S HLEVN="",DIK="^HL(779.001,"
  1. F S HLEVN=$O(HLEVNARY(HLEVN)) Q:HLEVN="" D
  1. . S HLSUB=1
  1. . F S HLSUB=$O(HLEVNARY(HLEVN,HLSUB)) Q:'HLSUB D
  1. .. S DA=HLEVNARY(HLEVN,HLSUB)
  1. .. D ^DIK
  1. ;
  1. ; delete duplicate entries in file #771.2
  1. S HLMSG="",DIK="^HL(771.2,"
  1. F S HLMSG=$O(HLMSGARY(HLMSG)) Q:HLMSG="" D
  1. . S HLSUB=1
  1. . F S HLSUB=$O(HLMSGARY(HLMSG,HLSUB)) Q:'HLSUB D
  1. .. S DA=HLMSGARY(HLMSG,HLSUB)
  1. .. D ^DIK
  1. ;
  1. ; delete duplicate entries in file #771.3
  1. S HLSEG="",DIK="^HL(771.3,"
  1. F S HLSEG=$O(HLSEGARY(HLSEG)) Q:HLSEG="" D
  1. . S HLSUB=1
  1. . F S HLSUB=$O(HLSEGARY(HLSEG,HLSUB)) Q:'HLSUB D
  1. .. S DA=HLSEGARY(HLSEG,HLSUB)
  1. .. D ^DIK
  1. ;
  1. Q
  1. IDOFF ; disable identifier for file #779.001 and #771.2
  1. K ^DD(779.001,0,"ID")
  1. K ^DD(771.2,0,"ID")
  1. K ^DD(771.3,0,"ID")
  1. Q
  1. POST ;enable identifier for file #779.001 and #771.2
  1. S ^DD(779.001,0,"ID",2)="W "_""""_" "_""""_",$P(^(0),U,2)"
  1. S ^DD(771.2,0,"ID",2)="W "_""""_" "_""""_",$P(^(0),U,2)"
  1. S ^DD(771.3,0,"ID",2)="W "_""""_" "_""""_",$P(^(0),U,2)"
  1. Q