VistA Analysis » VistA Reference » RPCs » TIU GET LINKED PRF NOTES

TIU GET LINKED PRF NOTES

Returns list of SIGNED, LINKED PRF notes for given patient, for givenPRF Title

Properties

Property Value
Label GETNOTES
MUMPS Implementation TIUPRF2
Return Type ARRAY

Input Parameters

Name Type Maximum Data Length Required Description
PTDFN LITERAL   true Patient IEN in Patient file
TIUTTL LITERAL   true PRF Title IEN in file 8925.1
REVORDER LITERAL 1 true Optional. Boolean flag, with 1 indicating to subscript the list of notesin reverse chronological order. Default is chronological order.

MUMPS Method Description

Property Value
Method GETNOTES^TIUPRF2
Method Comment RPC gets SIGNED, LINKED PRF
Input Parameters PTDFN, TIUTTL, REVERSE
First Comment
notes titled TIUTTL for patient PTDFN
Excludes Notes linked to Entered in Error (EIE) actions and
notes linked to Erroneous actions (actions taken prior to
EIE actions).
Receives TIUY by ref; passes back
TIUY = # of notes
TIUY([Reverse][Incremented]InternalNoteDate) =
NoteIEN^ActionName^ExternalNoteDate^AuthorName
Requires PTDFN,TIUTTL
Includes status Uncosigned, Completed, & Amended only.
Optional REVERSE - Boolean Flag:
1 - Sort notes by reverse chronological order
0 (default) - Sort notes by chronological order
Code
 N TIUDG,ACTID,TIUIDATE,TIUEDATE,TIUIEN,TIUACT,STATUS
N TIUAUTH,DTARRAY,HASERR,ARRAYNM
K TIUY ; Initialize array in case caller hasn't done so.
S (TIUY,ACTID)=0
S ARRAYNM="^TMP(""TIUPRFH"",$J)"
S TIUDG=$$GETHTIU^DGPFAPI1(PTDFN,TIUTTL,ARRAYNM)
G:'TIUDG GETNOTEX
S HASERR=$$HASERR^TIUPRFL(ARRAYNM)
F S ACTID=$O(@ARRAYNM@("HISTORY",ACTID)) Q:'ACTID D
. I ACTID=+HASERR Q ;Entered in Error
. I HASERR>0,$$ISERR^TIUPRFL(ARRAYNM,ACTID,$P(HASERR,U,2)) Q ;erroneous
. S TIUIEN=+@ARRAYNM@("HISTORY",ACTID,"TIUIEN")
. Q:TIUIEN'>0 ;TMP node may be just ^
. ; -- Include only complete or amended or uncosigned notes:
. S STATUS=$P($G(^TIU(8925,TIUIEN,0)),U,5) I '((STATUS=6)!(STATUS=7)!(STATUS=8)) Q
. S TIUACT=$P(@ARRAYNM@("HISTORY",ACTID,"ACTION"),U,2)
. N TIUFLDS,TIUERR D GETS^DIQ(8925,TIUIEN_",","1202;1301","IE","TIUFLDS","TIUERR")
. S TIUIDATE=TIUFLDS(8925,TIUIEN_",",1301,"I")
. ; -- Increment date if there are multiple notes w/ same exact date:
. F S:$D(DTARRAY(TIUIDATE)) TIUIDATE=TIUIDATE+.0000001 I '$D(DTARRAY(TIUIDATE)) S DTARRAY(TIUIDATE)="" Q
. I $G(REVERSE) S TIUIDATE=9999999-TIUIDATE
. S TIUEDATE=$E(TIUFLDS(8925,TIUIEN_",",1301,"E"),1,18)
. I TIUEDATE="" S TIUEDATE="No Ref Date"
. S TIUAUTH=TIUFLDS(8925,TIUIEN_",",1202,"E")
. I TIUAUTH="" S TIUAUTH="No Author"
. S TIUY=TIUY+1
. S TIUY(TIUIDATE)=TIUIEN_U_TIUACT_U_TIUEDATE_U_TIUAUTH

CPRS

File Type Description
Pascal File fPatientFlagMulti.pas


Document generated on August 31st 2022, 2:55:43 pm