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

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

initial load of WorldVistAEHR

File size: 3.0 KB
RevLine 
[613]1DGPTAEE ;ALB/MTC - Austin Edit Checks Error Driver ; 23 NOV 92
2 ;;5.3;Registration;**64,338,678**;Aug 13, 1993
3 ;
4EN ;-- entry point for list manager
5 D BUILD
6 Q
7 ;
8HDR ;-- header function for Editing List.
9 S VALMHDR(1)="Patient : "_$P($G(^DPT(DFN,0)),U)
10 S VALMHDR(2)="Admission Date : "_$$FTIME^VALM1($P(^DGPT(PTF,0),U,2))
11 S VALMHDR(3)="Discharge Date : "_$$FTIME^VALM1($P(^DGPT(PTF,70),U))
12 Q
13 ;
14BUILD ;-- this fuction will build the display array - similar to Austin's EAL
15 ;
16 Q:'$D(^TMP("AERROR",$J))!'($D(^TMP("AEDIT",$J)))
17 K ^TMP("AD",$J)
18 N NODE,SEQ,DGER,ERSTR,SP,ROU,REC
19 S (VALMCNT,SEQ)=0,NODE="",SP=" "
20 F S SEQ=$O(^TMP("AERROR",$J,SEQ)) Q:SEQ="" S NODE=$O(^(SEQ,0)) I NODE="N101"!(NODE="N401")!(NODE="N501")!(NODE="N601")!(NODE="N701")!(NODE="N702") D
21 . S ERSTR=$P($T(@("ER"_$E(NODE,2,4))+1),";;",2) D LOADER
22 . S REC=^TMP("AEDIT",$J,NODE,SEQ)
23 . S ROU="H"_$E(NODE,2,4)_"^"_$S(NODE="N101"!(NODE="N401")!(NODE="N501"):"DGPTAEE1",1:"DGPTAEE2")_"(REC)" D @ROU
24 Q
25 ;
26EXIT ;-- exit point for list manager
27 K ^TMP("AD",$J)
28 D CLEAR^VALM1
29 Q
30 ;
31LOADER ;-- This function will load the array DGER
32 ;
33 N Y,J,X1,X2
34 K DGER
35 S DGER=""
36 S Y="",J=0 F S J=$O(^TMP("AERROR",$J,SEQ,NODE,J)) Q:'J S X2=$G(^(J)) D
37 . S X1=$O(^DGP(45.64,"B",X2,0)),Y=$G(^DGP(45.64,X1,0))
38 . S DGER(J)=Y,DGER=DGER_$P(ERSTR,U,$P(Y,U,3))_","
39 S DGER=$E(DGER,1,$L(DGER)-1)
40 Q
41 ;
42WRER ;-- This function will write errors in DGER into ^TMP
43 ;
44 N I
45 S VALMCNT=VALMCNT+1,^TMP("AD",$J,VALMCNT,0)="Error Code(s) : "
46 S I="" F S I=$O(DGER(I)) Q:'I D
47 . S VALMCNT=VALMCNT+1,^TMP("AD",$J,VALMCNT,0)=$P(DGER(I),U)_" - "_$P(DGER(I),U,2)
48 D TRTCHK
49 I '$G(DGPTERR) S VALMCNT=VALMCNT+1,$P(^TMP("AD",$J,VALMCNT,0),"=",80)=""
50 K DGPTERR
51 Q
52 ;
53 ;-- This data is used to determine where in the output string a '#'
54 ; should be printed. The format of the each datum is:
55 ; <position in transmission string>:<position in display string>
56 ;
57ER101 ;-- 101 error position string
58 ;;1:1^2:8^3:18^4:32^5:47^6:52^7:55^8:62^9:66^10:70^11:73^12:1^13:15^14:20^15:24^16:27^17:34^18:41^19:44^20:52^^^^24:71
59 ;
60ER501 ;-- 501 error position string
61 ;;1:1^2:8^3:18^4:32^5:47^6:56^7:60^8:64^9:69^10:1^11:9^12:17^13:25^14:33^15:1^16:14^17:23^18:27^19:31^20:34^21:37^22:42^23:45:^24:50^
62 ;
63ER401 ;-- 401 error position string
64 ;;1:1^2:8^3:18^4:32^5:48^6:53^7:59^8:64^9:1^10:9^11:17^12:25^13:33^14:42^15:52^
65 ;
66ER601 ;-- 601 error position string
67 ;;1:1^2:10^3:18^4:32^5:47^6:52^7:57^8:1^9:9^10:17^11:25^12:33^
68 ;
69ER701 ;-- 701 error position string
70 ;;1:1^2:8^3:18^4:32^5:46^6:51^7:56^8:62^9:69^10:75^11:1^12:8^13:12^14:16^15:23^16:28^17:39^18:48^19:52^20:55^21:58^22:63^23:66^
71 ;
72ER702 ;-- 702 error position string
73 ;;1:1^2:8^3:18^4:32^5:1^6:9^7:17^8:25^9:33^10:41^11:49^12:57^13:65^
74 ;
75TRTCHK ;-- Check for treating spec error flag and print error message if flag
76 ;-- exists.
77 N I,X
78 S I=0,I=$O(DGPTSER(I)) G:'I TRTCHKQ
79 I $G(DGPTSER(+I))=1 D
80 . S X="*** Bed section code is not active for the date/time period listed. ***"
81 . S VALMCNT=VALMCNT+1,^TMP("AD",$J,VALMCNT,0)=X,DGPTERR=1
82TRTCHKQ K DGPTSER(+I)
83 Q
Note: See TracBrowser for help on using the repository browser.