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

DGQEHL74.m

Go to the documentation of this file.
  1. DGQEHL74 ;ALB/JFP - VIC Utilities for ADT/TRANSMISSION FILE #39.4; 09/01/96
  1. ;;5.3;Registration;**73,1015**;DEC 11,1996;Build 21
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. FILE(MID,PAT,CLERK,OPT,SAPPL) ; Entry Point
  1. ;Creates entry in ADT/HL7 TRANSMISSION file
  1. ;Input(s):
  1. ; MID - control ID of MSH segment
  1. ; PAT - DFN of patient
  1. ; CLERK - transmitted by clerk
  1. ; OPT - DHCP option
  1. ; SAPPL - sending application
  1. ;
  1. ;Output:
  1. ; 0 - OK
  1. ; -1^error text
  1. ;
  1. ; -- check input
  1. Q:'$D(MID) "-1^ message ID required for filer function"
  1. Q:'$D(PAT) "-1^ patient's DFN required for filer function"
  1. Q:'$D(CLERK) "-1^ clerk required for filer function"
  1. Q:'$D(OPT) "-1^ option required for filer function"
  1. Q:'$D(SAPPL) "-1^ sending application required for filer function"
  1. ;
  1. ; -- Create entry in ADT/HL7 TRANSMISSION file (#39.4)
  1. N X,DIC,DA,Y
  1. ;
  1. S X=MID
  1. S DIC="^VAT(39.4,",DIC(0)="L",DLAYGO=39.4
  1. D ^DIC K DIC,X,DLAYG0
  1. Q:Y<0 "-1^Error filing entry in ^VAT(39.4 - "_X
  1. S DA=+Y
  1. ;
  1. ; -- update ADT/HL7 TRANSMISSION file (39.4) with remaining fields
  1. N DIE,DR
  1. ;
  1. S DIE="^VAT(39.4,"
  1. S DR=".02///"_DT_";.03////"_PAT_";.04///"_CLERK_";.05///"_OPT_";.06///"_SAPPL_";.07///0"
  1. D ^DIE K DIE,DR
  1. QUIT 0
  1. ;
  1. REJ(MID,STATUS,REASON) ; Entry Point
  1. ; Updates entry in (#39.4) with rejected acknowledgement
  1. ; Input(s):
  1. ; MID - control ID of MSH segment
  1. ; STATUS - status of transmission
  1. ; REASON - reason releated to status of transmission
  1. ;
  1. ; Output:
  1. ; 0 - OK
  1. ; -1^error text
  1. ;
  1. ; -- check input
  1. Q:'$D(MID) "-1^ message ID required for update function"
  1. Q:'$D(STATUS) "-1^ status required for update function"
  1. Q:'$D(REASON) "-1^ reason required for update function"
  1. Q:STATUS'=1 "-1^ status needs to be one"
  1. ; -- update ADT/HL7 TRANSMISSION file (39.4) with remaining fields
  1. N DIE,DR,DA
  1. ;
  1. S DIE="^VAT(39.4,"
  1. S DA=$O(^VAT(39.4,"B",MID,0))
  1. Q:DA="" "-1^Message ID not found in file"
  1. S DR=".07///"_STATUS_";.08///"_REASON
  1. D ^DIE K DIE,DR
  1. QUIT 0
  1. Q
  1. ;
  1. DEL(MID) ; Entry Point
  1. ; Deletes entry from ADT/HL7 Transmission file (#39.4)
  1. ; Input:
  1. ; MID - control ID of MSH segment
  1. ; Output:
  1. ; 0 - OK
  1. ; -1^error text
  1. ;
  1. ; -- Check input
  1. Q:'$D(MID) "-1^message control ID required for delete function"
  1. ; -- Delete entry in ADT/HL7 TRANSMISSION file
  1. N DIK,DA
  1. ;
  1. S DIK="^VAT(39.4,"
  1. S DA=$O(^VAT(39.4,"B",MID,0))
  1. Q:DA="" "-1^Message ID not found in file"
  1. D ^DIK
  1. ; -- Make sure entry deleted
  1. Q:('$D(^VAT(39.4,DA,0))) 0
  1. Q "-1^Message ID "_DA_" not deleted from 39.4"
  1. ;
  1. END ;END OF CODE
  1. QUIT
  1. ;