source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQEXT03.m@ 623

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1VAQEXT03 ;ALB/JFP - PDX, PROCESS EXTERNAL (MANUAL);01MAR93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3EP ; -- Programmer entry point for manually rejecting PDX
4 ;
5 N VAQPR,VAQAUDT,VAQSENPT,VAQAUSIT,VAQDZN,VAQDZ
6 N POP,DA,PARMNODE,FACDA,DOMDA
7 ;
8 D:$D(XRTL) T0^%ZOSV
9 S VAQFLAG=1,POP=0
10 W !,"Working ..."
11 D PROCESS
12 I POP K XRT0 QUIT
13 W !!,"Manual process of entry queued "
14 D EXIT
15 S:$D(XRT0) XRTN=$T(+0) D:$D(XRT0) T1^%ZOSV
16 QUIT
17 ;
18PROCESS ; -- Finds an entry in the 'PDX TRANSACTION' file
19 S X=VAQTRNO ; -- transaction to update (set in VAQEXT01)
20 S DIC="^VAT(394.61,",DIC(0)="MZ"
21 D ^DIC K DIC,X
22 I Y<0 S POP=1 W !,"Error...Transaction record not found" QUIT
23 S (VAQPR,DA)=+Y,VAQTRN=$P(Y,U,2)
24 D LOAD,UPDATE Q:POP
25 I $D(^TMP("CMNT",$J)) D CMNT
26 S VAQTRN(VAQPR)="" ; -- Load an array of processed manual transactions
27 ; -- Updates workload file
28 S X=$$WORKDONE^VAQADS01($S(VAQST="REJ":"RJCT",VAQST="REL":"RLSE",VAQST="NFND":"UNKN",1:""),VAQPR,$G(DUZ))
29 QUIT
30 ;
31LOAD ; -- Loads the data for update
32 S %DT="ST",X="NOW" D ^%DT S VAQAUDT=Y ; -- date/time authori
33 K %DT,X,Y
34 S VAQSENPT=$$GETSEN^VAQUTL97(DFN) ; -- sensative patient
35 S:VAQSENPT<0 VAQSENPT=""
36 ;
37 S PARMNODE=$G(^VAT(394.81,1,0))
38 S FACDA=$P(PARMNODE,U,1),DOMDA=$P(PARMNODE,U,2)
39 S VAQAUSIT=$P($G(^DIC(4,FACDA,0)),U,1) ; -- authori site
40 S VAQAUADD=$P($G(^DIC(4.2,DOMDA,0)),U,1) ; -- authori addr
41 ;
42 S VAQDZN=$S($D(DUZ):$P(^VA(200,DUZ,0),U,1),1:"")
43 S VAQDZ=$S($D(DUZ):DUZ,1:"") ; -- authorizer
44 QUIT
45 ;
46UPDATE ; -- Sets DR string and non-constant variables for update
47 S DR=".05///"_$S(VAQST="REJ":"VAQ-REJ",VAQST="REL":"VAQ-RSLT",VAQST="NFND":"VAQ-NTFND",1:"")
48 I (DFN>0) S DR(1,394.61,.03)=".03////"_DFN ; -- local patient pointer
49 S DR(1,394.61,.04)=".04///"_VAQSENPT
50 ;S DR(1,394.61,.05)=".05///"_$S(VAQST="REJ":"VAQ-REJ",VAQST="REL":"VAQ-RSLT",VAQST="NFND":"VAQ-NTFND",1:"")
51 S DR(1,394.61,50)="50///"_VAQAUDT
52 S DR(1,394.61,51)="51///"_VAQDZN
53 ;S DR(1,394.61,60)="60///"_VAQAUSIT
54 ;S DR(1,394.61,61)="61///"_VAQAUADD
55 ;
56 S DIE="^VAT(394.61,"
57 L +(@(DIE_DA_")")):60
58 I ('$T) S POP=1 W !,"Could not edit entry... locked by other user)" QUIT
59 D ^DIE
60 L -(@(DIE_DA_")"))
61 K DIE,DR
62 QUIT
63 ;
64CMNT ; -- Loads comment for manual process reject or release (WORD PROCESSOR FIELD)
65 S %X="^TMP(""CMNT"",$J,"
66 S %Y="^VAT(394.61,"_DA_",""CMNT"","
67 D %XY^%RCR
68 K %X,%Y,^TMP("CMNT",$J)
69 QUIT
70 ;
71EXIT ; -- Cleans up local variables
72 K VAQPR,VAQAUDT,VAQSENPT,VAQAUSIT,VAQDZN,VAQDZ
73 K POP,DA,PARMNODE,FACDA,DOMDA
74 QUIT
75 ;
76END ; -- End of code
77 QUIT
Note: See TracBrowser for help on using the repository browser.