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

ACHS278O.m

Go to the documentation of this file.
  1. ACHS278O ;IHS/SET/GTH - 278 OUTBOUND PROCESSING ; [ 12/06/2002 10:36 AM ]
  1. ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**5**;JUN 11, 2001
  1. ;IHS/SET/GTH ACHS*3.1*5 12/06/2002 - New routine.
  1. ;
  1. I '$L($T(278^BHLEVENT)) W !,"The '278^BHLEVENT()' entry point is not present.",$$DIR^XBDIR("E","Press RETURN") Q
  1. ;
  1. NEW ACHSDIEN,ACHSTIEN
  1. ;
  1. ; --- Select Document.
  1. D ^ACHSUD
  1. ;
  1. ; --- Q if no Document selected.
  1. Q:'$D(ACHSDIEN)
  1. ;
  1. ; --- Select Transaction.
  1. S ACHSTIEN=$$SELTRANS^ACHSUD(ACHSDIEN)
  1. ;
  1. ; --- Q if no Transaction selected.
  1. Q:'ACHSTIEN
  1. ; W !,ACHSDIEN,!,ACHSTIEN
  1. ;
  1. ; --- Determine if msg previously sent.
  1. S %=$$GET1^DIQ(9002080.02,ACHSTIEN_","_ACHSDIEN_","_DUZ(2)_",",.01)
  1. ; --- Get IEN in 4001, display date/time sent.
  1. I % S %=+$$IXDIC(4001,"","C","IHS-"_%) I % W !,"278 Outbound sent for this Transaction on ",$$GET1^DIQ(4001,%,.01),"."
  1. ;
  1. Q:'$$DIR^XBDIR("Y","Proceed with the send of the Outbound 278","Y")
  1. ;
  1. ; --- Compute the 278O fields.
  1. NEW ACHS
  1. S ACHS=""
  1. D GEN278^ACHS278(ACHSDIEN,ACHSTIEN,.ACHS)
  1. ;
  1. ; --- Let GIS know the destination, PROVIDER (VENDOR), external.
  1. S ACHS("DEST")=$$GET1^DIQ(9002080.01,ACHSDIEN_","_DUZ(2)_",",7)
  1. ;
  1. ; --- Send the message.
  1. S ACHSMSG=$$278^BHLEVENT(DUZ(2),ACHSDIEN,.ACHS)
  1. ;
  1. ; --- Error message?
  1. I 'ACHSMSG D Q
  1. . W !,"**-->> ",ACHSMSG
  1. . I $$DIR^XBDIR("E","Press RETURN")
  1. .Q
  1. ;
  1. ; --- If IEN returned, store in Transaction.
  1. NEW DA,DIE,DR
  1. S DA=ACHSTIEN,DA(1)=ACHSDIEN,DA(2)=DUZ(2),DIE="^ACHSF("_DUZ(2)_",""D"","_ACHSDIEN_",""T"",",DR="31///"_ACHSMSG
  1. D ^DIE
  1. ;
  1. ; --- Record action in Document entry.
  1. D ACT^ACHSACT(ACHSDIEN,$$NOW^XLFDT,"<278 Outbound Message sent for "_$$GET1^DIQ(9002080.02,ACHSTIEN_","_ACHSDIEN_","_DUZ(2)_",",1)_" Transaction>")
  1. ;
  1. Q
  1. ;
  1. IXDIC(DIC,DIC0,D,X,DLAYGO) ;
  1. S DIC(0)=DIC0
  1. KILL DIC0
  1. I '$G(DLAYGO) KILL DLAYGO
  1. D IX^DIC
  1. Q Y
  1. ;