[613] | 1 | VEPERPT ;DAOU/KFK - PATIENT LOOKUP ERROR REPORT COMPILE ; 6/2/05 5:26pm
|
---|
| 2 | ;;1.0;VOEB;;Jun 12, 2005
|
---|
| 3 | ;
|
---|
| 4 | ; This is the compile routine for the Patient Lookup Error Report.
|
---|
| 5 | ; It is called from VEPERIER. The data is gathered from file 19904.2
|
---|
| 6 | ; (VEPER HL7 ERRORS) and stored in the scratch global (^TMP($J...)).
|
---|
| 7 | ;
|
---|
| 8 | ; Must call at EN
|
---|
| 9 | Q
|
---|
| 10 | ;
|
---|
| 11 | EN(HL7ERTN,HL7ESPC) ; Entry
|
---|
| 12 | ; Init
|
---|
| 13 | N BGDT,EN,ENDT,ERDT,HL7BDT,HL7DT,HL7EDT,HL7SRT,MSG,SORT1,SORT2,SORT3
|
---|
| 14 | I '$D(ZTQUEUED),$G(IOST)["C-" W !!,"Compiling report data ..."
|
---|
| 15 | ;
|
---|
| 16 | ; Kill scratch globals
|
---|
| 17 | K ^TMP($J,HL7ERTN)
|
---|
| 18 | S HL7BDT=HL7ESPC("BEGDT"),HL7EDT=HL7ESPC("ENDDT"),HL7SRT=HL7ESPC("SORT")
|
---|
| 19 | ;
|
---|
| 20 | ; Loop thru the HL7 Error File (#19904.2)
|
---|
| 21 | S BGDT=$P(HL7BDT,"."),ENDT=$P(HL7EDT,".")
|
---|
| 22 | F S BGDT=$O(^VEPER(19904.2,"B",BGDT)) Q:BGDT=""!($P(BGDT,".",1)>ENDT) D
|
---|
| 23 | . S EN=$O(^VEPER(19904.2,"B",BGDT,""))
|
---|
| 24 | . I HL7SRT=1 D
|
---|
| 25 | . . S SORT1=$P(^VEPER(19904.2,EN,0),U,4)
|
---|
| 26 | . . S SORT2=$P(^VEPER(19904.2,EN,0),U,2)
|
---|
| 27 | . . S SORT3=$P(^VEPER(19904.2,EN,0),U,5)
|
---|
| 28 | . I HL7SRT=2 D
|
---|
| 29 | . . S SORT1=$P(^VEPER(19904.2,EN,0),U,2)
|
---|
| 30 | . . S SORT2=$P(^VEPER(19904.2,EN,0),U,4)
|
---|
| 31 | . . S SORT3=$P(^VEPER(19904.2,EN,0),U,5)
|
---|
| 32 | . I HL7SRT=3 D
|
---|
| 33 | . . S SORT1=$P(^VEPER(19904.2,EN,0),U,5)
|
---|
| 34 | . . S SORT2=$P(^VEPER(19904.2,EN,0),U,2)
|
---|
| 35 | . . S SORT3=$P(^VEPER(19904.2,EN,0),U,4)
|
---|
| 36 | . S MSG=^VEPER(19904.2,EN,1),ERDT=$P(^VEPER(19904.2,EN,0),U),HL7DT=$P(^VEPER(19904.2,EN,0),U,6)
|
---|
| 37 | . I SORT1=""!(SORT2="")!(SORT3="") Q
|
---|
| 38 | . S ^TMP($J,HL7ERTN,SORT1,SORT2,SORT3)=ERDT_U_MSG_U_HL7DT
|
---|
| 39 | Q
|
---|