Code |
N DOTMP,NEWTMP S DOTMP=0 I $G(TMPFLAG) D ; Was value passed? .I TMPFLAG S DOTMP=1 ; Is value TRUE? I +$G(TEAM)<1 D .I DOTMP S NEWTMP=ORY_1_")",@NEWTMP="^No team identified" Q .I 'DOTMP S ORY(1)="^No team identified" Q N ORI,ORPT,I S I=0 S ORI=0 F S ORI=$O(^OR(100.21,+TEAM,10,ORI)) Q:ORI<1 D .S ORPT=^OR(100.21,+TEAM,10,ORI,0) .I DOTMP D ..S I=I+1,NEWTMP=ORY_+I_")" ..S @NEWTMP=+ORPT_U_$P(^DPT(+ORPT,0),U) .I 'DOTMP S I=I+1,ORY(I)=+ORPT_U_$P(^DPT(+ORPT,0),U) I DOTMP S:I<1 NEWTMP=ORY_1_")",@NEWTMP="^No patients found." I 'DOTMP S:I<1 ORY(1)="^No patients found."
|