- ACHS278O ;IHS/SET/GTH - 278 OUTBOUND PROCESSING ; [ 12/06/2002 10:36 AM ]
- ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**5**;JUN 11, 2001
- ;IHS/SET/GTH ACHS*3.1*5 12/06/2002 - New routine.
- ;
- I '$L($T(278^BHLEVENT)) W !,"The '278^BHLEVENT()' entry point is not present.",$$DIR^XBDIR("E","Press RETURN") Q
- ;
- NEW ACHSDIEN,ACHSTIEN
- ;
- ; --- Select Document.
- D ^ACHSUD
- ;
- ; --- Q if no Document selected.
- Q:'$D(ACHSDIEN)
- ;
- ; --- Select Transaction.
- S ACHSTIEN=$$SELTRANS^ACHSUD(ACHSDIEN)
- ;
- ; --- Q if no Transaction selected.
- Q:'ACHSTIEN
- ; W !,ACHSDIEN,!,ACHSTIEN
- ;
- ; --- Determine if msg previously sent.
- S %=$$GET1^DIQ(9002080.02,ACHSTIEN_","_ACHSDIEN_","_DUZ(2)_",",.01)
- ; --- Get IEN in 4001, display date/time sent.
- I % S %=+$$IXDIC(4001,"","C","IHS-"_%) I % W !,"278 Outbound sent for this Transaction on ",$$GET1^DIQ(4001,%,.01),"."
- ;
- Q:'$$DIR^XBDIR("Y","Proceed with the send of the Outbound 278","Y")
- ;
- ; --- Compute the 278O fields.
- NEW ACHS
- S ACHS=""
- D GEN278^ACHS278(ACHSDIEN,ACHSTIEN,.ACHS)
- ;
- ; --- Let GIS know the destination, PROVIDER (VENDOR), external.
- S ACHS("DEST")=$$GET1^DIQ(9002080.01,ACHSDIEN_","_DUZ(2)_",",7)
- ;
- ; --- Send the message.
- S ACHSMSG=$$278^BHLEVENT(DUZ(2),ACHSDIEN,.ACHS)
- ;
- ; --- Error message?
- I 'ACHSMSG D Q
- . W !,"**-->> ",ACHSMSG
- . I $$DIR^XBDIR("E","Press RETURN")
- .Q
- ;
- ; --- If IEN returned, store in Transaction.
- NEW DA,DIE,DR
- S DA=ACHSTIEN,DA(1)=ACHSDIEN,DA(2)=DUZ(2),DIE="^ACHSF("_DUZ(2)_",""D"","_ACHSDIEN_",""T"",",DR="31///"_ACHSMSG
- D ^DIE
- ;
- ; --- Record action in Document entry.
- D ACT^ACHSACT(ACHSDIEN,$$NOW^XLFDT,"<278 Outbound Message sent for "_$$GET1^DIQ(9002080.02,ACHSTIEN_","_ACHSDIEN_","_DUZ(2)_",",1)_" Transaction>")
- ;
- Q
- ;
- IXDIC(DIC,DIC0,D,X,DLAYGO) ;
- S DIC(0)=DIC0
- KILL DIC0
- I '$G(DLAYGO) KILL DLAYGO
- D IX^DIC
- Q Y
- ;
- ACHS278O ;IHS/SET/GTH - 278 OUTBOUND PROCESSING ; [ 12/06/2002 10:36 AM ]
- +1 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**5**;JUN 11, 2001
- +2 ;IHS/SET/GTH ACHS*3.1*5 12/06/2002 - New routine.
- +3 ;
- +4 IF '$LENGTH($TEXT(278^BHLEVENT))
- WRITE !,"The '278^BHLEVENT()' entry point is not present.",$$DIR^XBDIR("E","Press RETURN")
- QUIT
- +5 ;
- +6 NEW ACHSDIEN,ACHSTIEN
- +7 ;
- +8 ; --- Select Document.
- +9 DO ^ACHSUD
- +10 ;
- +11 ; --- Q if no Document selected.
- +12 IF '$DATA(ACHSDIEN)
- QUIT
- +13 ;
- +14 ; --- Select Transaction.
- +15 SET ACHSTIEN=$$SELTRANS^ACHSUD(ACHSDIEN)
- +16 ;
- +17 ; --- Q if no Transaction selected.
- +18 IF 'ACHSTIEN
- QUIT
- +19 ; W !,ACHSDIEN,!,ACHSTIEN
- +20 ;
- +21 ; --- Determine if msg previously sent.
- +22 SET %=$$GET1^DIQ(9002080.02,ACHSTIEN_","_ACHSDIEN_","_DUZ(2)_",",.01)
- +23 ; --- Get IEN in 4001, display date/time sent.
- +24 IF %
- SET %=+$$IXDIC(4001,"","C","IHS-"_%)
- IF %
- WRITE !,"278 Outbound sent for this Transaction on ",$$GET1^DIQ(4001,%,.01),"."
- +25 ;
- +26 IF '$$DIR^XBDIR("Y","Proceed with the send of the Outbound 278","Y")
- QUIT
- +27 ;
- +28 ; --- Compute the 278O fields.
- +29 NEW ACHS
- +30 SET ACHS=""
- +31 DO GEN278^ACHS278(ACHSDIEN,ACHSTIEN,.ACHS)
- +32 ;
- +33 ; --- Let GIS know the destination, PROVIDER (VENDOR), external.
- +34 SET ACHS("DEST")=$$GET1^DIQ(9002080.01,ACHSDIEN_","_DUZ(2)_",",7)
- +35 ;
- +36 ; --- Send the message.
- +37 SET ACHSMSG=$$278^BHLEVENT(DUZ(2),ACHSDIEN,.ACHS)
- +38 ;
- +39 ; --- Error message?
- +40 IF 'ACHSMSG
- Begin DoDot:1
- +41 WRITE !,"**-->> ",ACHSMSG
- +42 IF $$DIR^XBDIR("E","Press RETURN")
- +43 QUIT
- End DoDot:1
- QUIT
- +44 ;
- +45 ; --- If IEN returned, store in Transaction.
- +46 NEW DA,DIE,DR
- +47 SET DA=ACHSTIEN
- SET DA(1)=ACHSDIEN
- SET DA(2)=DUZ(2)
- SET DIE="^ACHSF("_DUZ(2)_",""D"","_ACHSDIEN_",""T"","
- SET DR="31///"_ACHSMSG
- +48 DO ^DIE
- +49 ;
- +50 ; --- Record action in Document entry.
- +51 DO ACT^ACHSACT(ACHSDIEN,$$NOW^XLFDT,"<278 Outbound Message sent for "_$$GET1^DIQ(9002080.02,ACHSTIEN_","_ACHSDIEN_","_DUZ(2)_",",1)_" Transaction>")
- +52 ;
- +53 QUIT
- +54 ;
- IXDIC(DIC,DIC0,D,X,DLAYGO) ;
- +1 SET DIC(0)=DIC0
- +2 KILL DIC0
- +3 IF '$GET(DLAYGO)
- KILL DLAYGO
- +4 DO IX^DIC
- +5 QUIT Y
- +6 ;