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

HLPA108A.m

Go to the documentation of this file.
  1. HLPA108A ;CIOFO-SF/RJH - HL7 PATCH 108 PRE&POST-INIT ;02/25/04 16:19
  1. ;;1.6;HEALTH LEVEL SEVEN;**108**;Oct 13, 1995
  1. ;
  1. ; Pre-install II:
  1. ; Entries: PTR771, PEVE, PMSG, and PMSG, are called from HLPAT108
  1. Q
  1. PTR771 ; resolve pointers for sub-field #771.06,.01 of field #771,6
  1. ; and #771.05,.01 of field #771,5
  1. ;
  1. ; HLMSGP: pointer to file #771.2
  1. ; HLMSGPN: redirected new pointer to file #771.2
  1. ; HLSEGP: pointer to file #771.3
  1. ; HLSEGPN: redirected new pointer to file #771.3
  1. ;
  1. N HLIEN,HLIEN2,HLMSGP,HLMSGPN,DIE,DA,DR
  1. N HLSEGP,HLSEGPN
  1. S HLIEN=0
  1. F S HLIEN=$O(^HL(771,HLIEN)) Q:'HLIEN D
  1. . I $D(^HL(771,HLIEN,"MSG")) D
  1. .. S HLIEN2=0
  1. .. F S HLIEN2=$O(^HL(771,HLIEN,"MSG",HLIEN2)) Q:'HLIEN2 D
  1. ... I $D(^HL(771,HLIEN,"MSG",HLIEN2,0)) D
  1. .... S HLMSGP=$P(^HL(771,HLIEN,"MSG",HLIEN2,0),"^")
  1. .... S HLMSGPN=0
  1. .... I HLMSGP>0 S HLMSGPN=$$PMSG^HLPA108A(HLMSGP)
  1. .... ; redirect pointer for SUB-field #771.06,.01 of field #771,6
  1. .... I HLMSGPN D
  1. ..... S DIE="^HL(771,"_HLIEN_",""MSG"","
  1. ..... S DA(1)=HLIEN
  1. ..... S DA=HLIEN2
  1. ..... S DR=".01////"_HLMSGPN
  1. ..... D ^DIE
  1. . I $D(^HL(771,HLIEN,"SEG")) D
  1. .. S HLIEN2=0
  1. .. F S HLIEN2=$O(^HL(771,HLIEN,"SEG",HLIEN2)) Q:'HLIEN2 D
  1. ... I $D(^HL(771,HLIEN,"SEG",HLIEN2,0)) D
  1. .... S HLSEGP=$P(^HL(771,HLIEN,"SEG",HLIEN2,0),"^")
  1. .... S HLSEGPN=0
  1. .... I HLSEGP>0 S HLSEGPN=$$PSEG^HLPA108A(HLSEGP)
  1. .... ; redirect pointer for SUB-field #771.05,.01 of field #771,5
  1. .... I HLSEGPN D
  1. ..... S DIE="^HL(771,"_HLIEN_",""SEG"","
  1. ..... S DA(1)=HLIEN
  1. ..... S DA=HLIEN2
  1. ..... S DR=".01////"_HLSEGPN
  1. ..... D ^DIE
  1. Q
  1. ;
  1. PEVN(HLIEN) ; resolve event pointer
  1. ;
  1. ; HLEVN: original event type name
  1. ; HLEVN2: the event type name in the duplicate event array
  1. ; HLSUB: the 2nd subscript of the duplicate event array
  1. ; HLIEN: the IEN for the original event type
  1. ; HLNIEN: the IEN for the first event type found in the file
  1. ; output: HLNIEN - return 0 if no duplicate,
  1. ; return the new pointer HLNIEN if duplicate
  1. ;
  1. N HLEVN,HLEVN2,HLSUB,HLDONE,HLNIEN
  1. Q:'$D(^HL(779.001,HLIEN,0)) 0
  1. S HLNIEN=0
  1. S HLEVN=$P(^HL(779.001,HLIEN,0),"^")
  1. I HLEVN'="" D
  1. . S HLEVN2=""
  1. . F S HLEVN2=$O(HLEVNARY(HLEVN2)) Q:(HLEVN2="") D Q:(HLEVN2=HLEVN)
  1. .. I HLEVN2=HLEVN D
  1. ... S HLSUB=0,HLDONE=0,HLNIEN=0
  1. ... F S HLSUB=$O(HLEVNARY(HLEVN,HLSUB)) Q:('HLSUB) D Q:HLDONE
  1. .... I HLEVNARY(HLEVN,HLSUB)=HLIEN S HLDONE=1 D
  1. ..... I HLSUB>1 S HLNIEN=HLEVNARY(HLEVN,1)
  1. Q HLNIEN
  1. ;
  1. PMSG(HLIEN) ; resolve message pointer
  1. ;
  1. ; HLMSG: original message type name
  1. ; HLMSG2: the message type name in the duplicate message array
  1. ; HLSUB: the 2nd subscript of the duplicate message array
  1. ; HLIEN: the IEN for the original message type
  1. ; HLNIEN: the IEN for the first message type found in the file
  1. ; output: HLNIEN - return 0 if no duplicate,
  1. ; return the new pointer HLNIEN if duplicate
  1. ;
  1. N HLMSG,HLMSG2,HLSUB,HLDONE,HLNIEN
  1. Q:'$D(^HL(771.2,HLIEN,0)) 0
  1. S HLNIEN=0
  1. S HLMSG=$P(^HL(771.2,HLIEN,0),"^")
  1. I HLMSG'="" D
  1. . S HLMSG2=""
  1. . F S HLMSG2=$O(HLMSGARY(HLMSG2)) Q:(HLMSG2="") D Q:(HLMSG2=HLMSG)
  1. .. I HLMSG2=HLMSG D
  1. ... S HLSUB=0,HLDONE=0,HLNIEN=0
  1. ... F S HLSUB=$O(HLMSGARY(HLMSG,HLSUB)) Q:('HLSUB) D Q:HLDONE
  1. .... I HLMSGARY(HLMSG,HLSUB)=HLIEN S HLDONE=1 D
  1. ..... I HLSUB>1 S HLNIEN=HLMSGARY(HLMSG,1)
  1. Q HLNIEN
  1. ;
  1. PSEG(HLIEN) ; resolve segment pointer
  1. ;
  1. ; HLSEG: original segment type name
  1. ; HLSEG2: the segment type name in the duplicate segment array
  1. ; HLSUB: the 2nd subscript of the duplicate segment array
  1. ; HLIEN: the IEN for the original segment type
  1. ; HLNIEN: the IEN for the first segment type found in the file
  1. ; output: HLNIEN - return 0 if no duplicate,
  1. ; return the new pointer HLNIEN if duplicate
  1. ;
  1. N HLSEG,HLSEG2,HLSUB,HLDONE,HLNIEN
  1. Q:'$D(^HL(771.3,HLIEN,0)) 0
  1. S HLNIEN=0
  1. S HLSEG=$P(^HL(771.3,HLIEN,0),"^")
  1. I HLSEG'="" D
  1. . S HLSEG2=""
  1. . F S HLSEG2=$O(HLSEGARY(HLSEG2)) Q:(HLSEG2="") D Q:(HLSEG2=HLSEG)
  1. .. I HLSEG2=HLSEG D
  1. ... S HLSUB=0,HLDONE=0,HLNIEN=0
  1. ... F S HLSUB=$O(HLSEGARY(HLSEG,HLSUB)) Q:('HLSUB) D Q:HLDONE
  1. .... I HLSEGARY(HLSEG,HLSUB)=HLIEN S HLDONE=1 D
  1. ..... I HLSUB>1 S HLNIEN=HLSEGARY(HLSEG,1)
  1. Q HLNIEN
  1. ;