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

HLUPDATE.m

Go to the documentation of this file.
  1. HLUPDATE ; IHS/TUC/DLR - UPDATE HL FILE ENTRIES ; [ 04/02/2003 8:36 AM ]
  1. ;;1.6;HEALTH LEVEL SEVEN;**1004**;APR 1, 2003
  1. ;
  1. ; This routine updates the HL package file entries
  1. ; to support the current version of the HL7 standard.
  1. ; It is run from the M prompt, after HLINIT. It takes
  1. ; no input variables and produces no output variables.
  1. ;
  1. N %,DA,DIC,GBL,I,V,VER,VSET,X,Y
  1. D ^XBKVAR
  1. ;
  1. W !,"Creating New HL7 Message Definitions.",!
  1. ;
  1. S X="VXU",DIC="^HL(771.2,",DIC(0)="L",DLAYGO=771.2
  1. S DIC("DR")="2///Unsolicited Vaccination Record Update"
  1. D DEFINE I Y<0 D ABTMSG Q
  1. ;
  1. S X="V04",DIC="^HL(779.001,",DIC(0)="L",DLAYGO=779.001
  1. S DIC("DR")="2///Unsolicited Vaccination Record Update"
  1. D DEFINE I Y<0 D ABTMSG Q
  1. ;
  1. S VSET=""
  1. F I=2.1,2.2,2.3 S VER(I)="",VSET=VSET_$TR(I,".")_":"_I_";"
  1. ;
  1. ; update data dictionary for file 869.2
  1. ;
  1. I $P(^DD(869.2,200.08,0),U,3)'["2.3" S $P(^(0),U,3)=VSET,^("DT")="2970416"
  1. ;
  1. ; update entries in file 771.5
  1. ;
  1. S DIC="^HL(771.5,"
  1. S DIC(0)="L"
  1. S DLAYGO=771.5
  1. S DIC("DR")="2///HEALTH LEVEL SEVEN"
  1. S V=0
  1. F S V=$O(VER(V)) Q:'V S X=V D DEFINE I Y<0 D ABTMSG Q
  1. Q:(Y<0)
  1. K DR,DLAYGO,DIC
  1. ;
  1. W !,"Adding New HL7 Versions to All Message and Event Types.",!
  1. ;
  1. S V=0
  1. F S V=$O(VER(V)) Q:'V S VER(V)=$O(^HL(771.5,"B",V,0)) I 'VER(V) D ABTMSG Q
  1. Q:V
  1. ;
  1. D ADD(771.2,3,"V") Q:(Y<0)
  1. D ADD(779.001,100,1) Q:(Y<0)
  1. ;
  1. W !,"HL File Update is Complete.",!
  1. Q
  1. ;
  1. ADD(FILE,FIELD,SUB) ; Add new versions to one file
  1. ;
  1. S DIC(0)="L"
  1. S DIC("P")=$P(^DD(FILE,FIELD,0),U,2)
  1. S I=0
  1. F S I=$O(^HL(FILE,I)) Q:'I S DA(1)=I,DIC="^HL(FILE,"_DA(1)_","""_SUB_"""," D ADDVER I Y<0 D ABTMSG Q
  1. Q
  1. ;
  1. ADDVER ; Add new HL versions to one message or event type
  1. ;
  1. S V=0
  1. F S V=$O(VER(V)) Q:'V S X=VER(V) D DEFINE Q:(Y<0)
  1. Q
  1. ;
  1. DEFINE ; define one file entry (if it doesn't already exist)
  1. ;
  1. S GBL=DIC_"""B"","""_X_""")"
  1. I $D(@GBL) S Y=0 Q
  1. K DD,DO,Y D FILE^DICN
  1. Q
  1. ;
  1. ABTMSG ; write abort message
  1. ;
  1. W !,*7,"*** Aborting due to Fileman error ***"
  1. W !,"*** Update is not complete. ***"
  1. Q