RMPREO24 ;HINES/ODJ ;suspense reports - Display all notes ;;3.0;PROSTHETICS;**55**;Feb 09, 1996 ; ; ODJ - patch 55 - implement a display of all notes posted to an ; order in reverse chronological order ; (nois MIN-0900-41546) Q ; ; This subroutine implements patch 55 and is called from ; VIEW^RMPREO23 which is called when a user selects the ; View Request option [VR] on the Suspense Processing list ; manager screen. ; ; Inputs ; ------ ; RMPRIEN - ien of the order in ^RMPR(668 ; ; Output ; ------ ; RMPREXC - "^" if key press indicates return to menu ; VALL(RMPRIEN,RMPREXC) ; N RMPRS,RMPRA,RMPRROW,RMPRX,RMPRI,RMPRNTY,RMPRNDT,Y,RMPRDASH N RMPRLL,RMPRSUB,RMPRWP,RMPRCL,RMPRMINL,RMPRUSRI,RMPRUSRC S RMPREXC="" W @IOF,"Chronological list of notes posted to the request...",!! S RMPRCL=3 S $P(RMPRDASH,"-",81)="" S RMPRMINL=5 ; ; build an index RMPRX of notes by date and seq. S RMPRS=^RMPR(668,RMPRIEN,0) S RMPRNDT=$P(RMPRS,"^",9) ; Initial action date (type 3) S RMPRUSRI=$$GETUSR(RMPRIEN,16) ; User entering Init Action S RMPRX=1 S:RMPRNDT'="" RMPRX(RMPRNDT,RMPRX)=3,RMPRX=RMPRX+1 S RMPRNDT=$P(RMPRS,"^",5) ; Completion date (type 4) S:RMPRNDT'="" RMPRX(RMPRNDT,RMPRX)=4,RMPRX=RMPRX+1 S RMPRUSRC=$$GETUSR(RMPRIEN,6) ; User entering Complete Action ; ; loop through all other notes (type 1) S RMPRI=0 F S RMPRI=$O(^RMPR(668,RMPRIEN,1,RMPRI)) Q:'+RMPRI D . S RMPRS=^RMPR(668,RMPRIEN,1,RMPRI,0) . S RMPRNDT=$P(RMPRS,"^",1) . S RMPRX(RMPRNDT,RMPRX)="1^"_RMPRI,RMPRX=RMPRX+1 . Q ; ; If haven't got any notes display message to inform user ; and get any key press, then quit I RMPRX=1 D G VALLX . W "No notes have been posted to this request" . K DIR S DIR(0)="E" D ^DIR K DIR S:Y'=1 RMPREXC="^" . Q ; ; Now use index RMPRX built above to print out the notes S RMPRA="" VALL1 S RMPRA=$O(RMPRX(RMPRA)) ;primary loop on note date I RMPRA="" G VALLEND S RMPRI="" VALL2 S RMPRI=$O(RMPRX(RMPRA,RMPRI)) ;loop on seq. within date I RMPRI="" G VALL1 ;next note date S RMPRS=RMPRX(RMPRA,RMPRI) S RMPRNTY=$P(RMPRS,"^",1) ;get note type 1 Other, 3 Init Action ; 4 Complete S Y=RMPRA D DD^%DT S RMPRNDT=Y ; ; Print the note I RMPRNTY=1 D . S RMPRSUB=$P(RMPRS,"^",2) ;ien of sub-file . S RMPRLL=$O(^RMPR(668,RMPRIEN,1,RMPRSUB,1,":"),-1) . Q E D . S RMPRLL=$O(^RMPR(668,RMPRIEN,RMPRNTY,1,":"),-1) . Q I RMPRCL>3,(IOSL-(RMPRLL+RMPRCL))