source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLCSORAT.m@ 1195

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

initial load of WorldVistAEHR

File size: 3.1 KB
RevLine 
[613]1HLCSORAT ;ALB/MFK/jc - HEALTH LEVEL SEVEN ;07/13/99 15:20
2 ;;1.6;HEALTH LEVEL SEVEN;**57**;Oct 13, 1995
3 ;Report low level communications errors for serial links (HLLP,
4 ;X3.28) in file 870.
5START ; Main Entry point
6 N DIR,DIC,X,Y,HLZ,LINE,HLERR,HLSORT,HLAAA,HLSTAT,HLLL,HLQUEUE,POP
7 N %ZIS,DTOUT,DUOUT,HLDONE,HLTMP,SET,FOO,CODES
8 S (HLERR,HLSTAT,LINE)=""
9 D PROMPT I (Y=-1)!($D(DUOUT))!($D(DTOUT)) Q
10 D OPEN G END:POP
11 I $D(IO("Q")) D QUEUED,HOME^%ZIS G END
12 U IO
13REPORT ; Output data after gathering
14 S HLZ=0
15 ; GATHER AND SORT DATA
16 D ^HLCSORA1
17 I 'HLZ G NEXT
18 I HLDONE G END
19 F HLAAA=$Y:1:(IOSL-3) W !
20 I ($E(IOST,1,2)="C-") S DIR(0)="E" D ^DIR K DIR I Y=0!(Y="")!($D(DIRUT)) G END
21NEXT ; PRINT THE DATA
22 D ^HLCSORA2
23 I 'HLZ W !,"No data found for this request"
24END ;
25 ; Clean up. Kill the ^TMP and other assorted variables.
26 K ^TMP("HLCSORAT",$J)
27 I $D(ZTQUEUED) S ZTREQ="@" Q
28 K DIRUT,HLZ
29 D ^%ZISC
30 Q
31PROMPT ; Find out how user wants report done
32 S HLLL=""
33 S DIR(0)="FAOU"
34 S DIR("A")="Select HL7 Logical Link: "
35 S DIR("B")="All Links"
36 D ^DIR
37 Q:$D(DTOUT)!($D(DUOUT))
38 I Y="All Links" S Y=0
39 I Y'=0 D
40 .S X=Y,DIC="^HLCS(870,",DIC(0)="EMQZ" D ^DIC K DIC
41 Q:$D(DTOUT)!($D(DUOUT))
42 S HLLL=$P(Y,"^",1)
43 I Y=-1 Q
44 S DIR(0)="S^I:IN QUEUE;O:OUT QUEUE;B:BOTH"
45 S DIR("A")="Select queue for report",DIR("B")="B" D ^DIR K DIR
46 S HLQUEUE=Y
47 I '("IOB"[Y) Q
48 S HLQUEUE=$S(HLQUEUE="B":"12",HLQUEUE="I":1,HLQUEUE="O":2)
49 S SET="",CODES=$$GET1^DID(870.019,2,"","POINTER")
50 F HLTMP=1:1 S FOO=$P(CODES,";",HLTMP) Q:(FOO="") D
51 .S SET=SET_$E(FOO,1,1)
52ERR S DIR(0)="SOM^"_CODES_"ALL:ALL ERRORS;F:FINISH SELECTING ERRORS"
53 S DIR("A")="Select an error code to sort by"_$S(HLERR'="":" ("_HLERR_")",1:"")
54 S DIR("B")=$S((HLERR=""):"ALL",1:"F")
55 S DIR("?",1)="Select the list of errors that you would like to sort by. There are also"
56 S DIR("?",2)="two special selections. ALL means that you would like to sort on all the"
57 S DIR("?")="error codes. F means that you have finished selecting error codes."
58 D ^DIR K DIR
59 I ((HLERR'[Y)&(Y'="F")) S HLERR=HLERR_Y
60 I Y="ALL" S HLERR=SET
61 I (HLERR="")!($D(DUOUT))!($D(DTOUT)) S Y=-1 Q
62 I (Y'="ALL")&(Y'="F") G ERR
63 S SET="",CODES=$$GET1^DID(870.019,1,"","POINTER")
64 F HLTMP=1:1 S FOO=$P(CODES,";",HLTMP) Q:(FOO="") D
65 .S SET=SET_$E(FOO,1,1)
66STAT S DIR(0)="SOM^"_CODES_"ALL:ALL STATUS;F:FINISH SELECTING STATUS CODES"
67 S DIR("A")="Select a status code to sort by"_$S(HLSTAT'="":" ("_HLSTAT_")",1:"")
68 S DIR("B")=$S((HLSTAT=""):"ALL",1:"F")
69 S DIR("?",1)="Select a status code to sort the report by. There are two special"
70 S DIR("?",2)="selections. ALL indicates you would like a report on all the statuses. The"
71 S DIR("?")="F means you are finished selecting statuses."
72 D ^DIR K DIR
73 I ((HLSTAT'[Y)&(Y'="F")) S HLSTAT=HLSTAT_Y
74 I Y="ALL" S HLSTAT=SET
75 I (HLSTAT="")!($D(DTOUT))!($D(DUOUT)) S Y=-1 Q
76 I (Y'="ALL")&(Y'="F") G STAT
77 S HLSORT=HLERR_"^"_HLSTAT
78 Q
79QUEUED ; If queued, set up and kick in TASKMAN
80 S ZTRTN="REPORT^HLCSORAT",ZTDESC="HL7 LOGICAL LINK REPORT",ZTSAVE("HLLL")="",ZTSAVE("HLQUEUE")="",ZTSAVE("HLSORT")="" D ^%ZTLOAD
81 W !!,$S($D(ZTSK):"Request Queued",1:"Request Cancelled")
82 K ZTSK
83 Q
84OPEN ; Open a device
85 S %ZIS="QM" D ^%ZIS
86 Q
Note: See TracBrowser for help on using the repository browser.