Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PXRMTUTL

PXRMTUTL.m

Go to the documentation of this file.
PXRMTUTL ;SLC/AGP - Reminder term utility routine. ;04/06/2020
 ;;2.0;CLINICAL REMINDERS;**72**;Feb 04, 2005;Build 16
 ;
 ;=================================
SETTFIND(RESULT,TNAME,FINDING) ;
 N FCNT,FDA,FIELD,ICNT,IENS,MSG,SCNT,SIDX,TIEN,VALUE
 S TIEN=$O(^PXRMD(811.5,"B",TNAME,""))
 I TIEN=0 S RESULT="-1^Reminder term "_TNAME_" not found in Reminder Term file" Q
 S FDA(811.5,TIEN_",",.01)=TNAME
 S FCNT=TIEN,SCNT=0
 S ICNT=0 F  S ICNT=$O(FINDING(ICNT)) Q:ICNT'>0  D
 .S FIELD="" F  S FIELD=$O(FINDING(ICNT,FIELD)) Q:FIELD=""  D
 ..I FIELD=.01 D
 ...I SCNT>0,SCNT>0 S FCNT=SCNT+1 Q
 ...S FCNT=FCNT+1
 ..I FIELD'="STATUS" D  Q
 ...S VALUE=FINDING(ICNT,FIELD) I VALUE="" Q
 ...S FDA(811.52,"+"_FCNT_","_TIEN_",",FIELD)=VALUE
 ..I FIELD="STATUS" D
 ...S SCNT=FCNT
 ...S SIDX=0 F  S SIDX=$O(FINDING(ICNT,FIELD,SIDX)) Q:SIDX'>0  D
 ....S VALUE=FINDING(ICNT,FIELD,SIDX) Q:VALUE=""
 ....S SCNT=SCNT+1
 ....S FDA(811.54,"+"_SCNT_",+"_FCNT_","_TIEN_",",.01)=VALUE
 I '$D(FDA) Q
 D UPDATE^DIE("E","FDA","","MSG")
 I $D(MSG) D  Q
 .S RESULT=0
 .D AWRITE^PXRMUTIL("MSG")
 S RESULT=1
 Q
 ;