#!/usr/bin/mumps

#	display patient info
#	ptid,entry_date,entry_time,name,prefix,suffix,street,city_state,zip,tel

 for ptid=$order(^patientId(ptid)) do
 . write "Patient id: ",ptid," "
 . for entrydate=$order(^patientId(ptid,entrydate)) do
 .. set entrytime=$order(^patientId(ptid,entrydate,""))
 .. write "Date: ",entrydate," Time: ",entrytime,!
 .. set name=$order(^patientId(ptid,entrydate,entrytime,""))
 .. set pre=$order(^patientId(ptid,entrydate,entrytime,name,""))
 .. set suf=$order(^patientId(ptid,entrydate,entrytime,name,pre,""))
 .. write ?10,pre," ",name," ",suf,!
 .. set str=$order(^patientId(ptid,entrydate,entrytime,name,pre,suf,""))
 .. set cs=$order(^patientId(ptid,entrydate,entrytime,name,pre,suf,str,""))
 .. set zip=$order(^patientId(ptid,entrydate,entrytime,name,pre,suf,str,cs,""))
 .. set tel=$order(^patientId(ptid,entrydate,entrytime,name,pre,suf,str,cs,zip,""))
 .. write ?10,str,!,?10,cs," ",zip,!,?10,"Tel: ",tel,!!
