source: FOIAVistA/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGQEHL74.m@ 1705

Last change on this file since 1705 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1DGQEHL74 ;ALB/JFP - VIC Utilities for ADT/TRANSMISSION FILE #39.4; 09/01/96
2 ;;V5.3;REGISTRATION;**73**;DEC 11,1996
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5FILE(MID,PAT,CLERK,OPT,SAPPL) ; Entry Point
6 ;Creates entry in ADT/HL7 TRANSMISSION file
7 ;Input(s):
8 ; MID - control ID of MSH segment
9 ; PAT - DFN of patient
10 ; CLERK - transmitted by clerk
11 ; OPT - DHCP option
12 ; SAPPL - sending application
13 ;
14 ;Output:
15 ; 0 - OK
16 ; -1^error text
17 ;
18 ; -- check input
19 Q:'$D(MID) "-1^ message ID required for filer function"
20 Q:'$D(PAT) "-1^ patient's DFN required for filer function"
21 Q:'$D(CLERK) "-1^ clerk required for filer function"
22 Q:'$D(OPT) "-1^ option required for filer function"
23 Q:'$D(SAPPL) "-1^ sending application required for filer function"
24 ;
25 ; -- Create entry in ADT/HL7 TRANSMISSION file (#39.4)
26 N X,DIC,DA,Y
27 ;
28 S X=MID
29 S DIC="^VAT(39.4,",DIC(0)="L",DLAYGO=39.4
30 D ^DIC K DIC,X,DLAYG0
31 Q:Y<0 "-1^Error filing entry in ^VAT(39.4 - "_X
32 S DA=+Y
33 ;
34 ; -- update ADT/HL7 TRANSMISSION file (39.4) with remaining fields
35 N DIE,DR
36 ;
37 S DIE="^VAT(39.4,"
38 S DR=".02///"_DT_";.03////"_PAT_";.04///"_CLERK_";.05///"_OPT_";.06///"_SAPPL_";.07///0"
39 D ^DIE K DIE,DR
40 QUIT 0
41 ;
42REJ(MID,STATUS,REASON) ; Entry Point
43 ; Updates entry in (#39.4) with rejected acknowledgement
44 ; Input(s):
45 ; MID - control ID of MSH segment
46 ; STATUS - status of transmission
47 ; REASON - reason releated to status of transmission
48 ;
49 ; Output:
50 ; 0 - OK
51 ; -1^error text
52 ;
53 ; -- check input
54 Q:'$D(MID) "-1^ message ID required for update function"
55 Q:'$D(STATUS) "-1^ status required for update function"
56 Q:'$D(REASON) "-1^ reason required for update function"
57 Q:STATUS'=1 "-1^ status needs to be one"
58 ; -- update ADT/HL7 TRANSMISSION file (39.4) with remaining fields
59 N DIE,DR,DA
60 ;
61 S DIE="^VAT(39.4,"
62 S DA=$O(^VAT(39.4,"B",MID,0))
63 Q:DA="" "-1^Message ID not found in file"
64 S DR=".07///"_STATUS_";.08///"_REASON
65 D ^DIE K DIE,DR
66 QUIT 0
67 Q
68 ;
69DEL(MID) ; Entry Point
70 ; Deletes entry from ADT/HL7 Transmission file (#39.4)
71 ; Input:
72 ; MID - control ID of MSH segment
73 ; Output:
74 ; 0 - OK
75 ; -1^error text
76 ;
77 ; -- Check input
78 Q:'$D(MID) "-1^message control ID required for delete function"
79 ; -- Delete entry in ADT/HL7 TRANSMISSION file
80 N DIK,DA
81 ;
82 S DIK="^VAT(39.4,"
83 S DA=$O(^VAT(39.4,"B",MID,0))
84 Q:DA="" "-1^Message ID not found in file"
85 D ^DIK
86 ; -- Make sure entry deleted
87 Q:('$D(^VAT(39.4,DA,0))) 0
88 Q "-1^Message ID "_DA_" not deleted from 39.4"
89 ;
90END ;END OF CODE
91 QUIT
92 ;
Note: See TracBrowser for help on using the repository browser.