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

SDES2GETURGENCY.m

Go to the documentation of this file.
SDES2GETURGENCY ;ALB/BWF - SDES2 GET URGENCY LIST; MAR 11,2024
 ;;5.3;Scheduling;**875**;Aug 13, 1993;Build 25
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 ; Reference to PROTOCOL in ICR #7026
 ;
 Q
 ; Input
 ;  SDCONTEXT - SD CONTEXT ARRAY
 ;  SDINPUT - blank placeholder parameter
 ;
GETURGENCY(RES,SDCONTEXT,SDINPUT) ; GET valid urgency protocol values that are used in the URGENCY field 5 of the REQUEST CONSULTAION file 123
 N ERRORS,URGCOUNT,URGENCY,URGENCYIEN,SDNAME,URGENCYLIST,SYNIEN,SYNCOUNT,SYNNAME
 D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
 I $D(ERRORS) S ERRORS("Urgency",1)="" D BUILDJSON^SDES2JSON(.RES,.ERRORS) Q
 S URGCOUNT=0
 S URGENCY="GMRCURGENCY" F  S URGENCY=$O(^ORD(101,"B",URGENCY)) Q:$P(URGENCY," ",1)'="GMRCURGENCY"  Q:URGENCY=""  D
 .S URGENCYIEN="" F  S URGENCYIEN=$O(^ORD(101,"B",URGENCY,URGENCYIEN)) Q:URGENCYIEN=""  D
 ..S SDNAME=$$GET1^DIQ(101,URGENCYIEN_",",.01)
 ..S URGCOUNT=URGCOUNT+1
 ..S URGENCYLIST("Urgency",URGCOUNT,"Name")=SDNAME
 ..S URGENCYLIST("Urgency",URGCOUNT,"Id")=URGENCYIEN
 ..S (SYNIEN,SYNCOUNT)=0
 ..F  S SYNIEN=$O(^ORD(101,URGENCYIEN,2,SYNIEN)) Q:SYNIEN'>0  D
 ...S SYNNAME=$$GET1^DIQ(101.02,SYNIEN_","_URGENCYIEN_",",.01)
 ...S SYNCOUNT=SYNCOUNT+1
 ...S URGENCYLIST("Urgency",URGCOUNT,"Synonym",SYNCOUNT,"SynonymName")=SYNNAME
 I '$D(URGENCYLIST) S URGENCYLIST("Urgency",1)=""
 D BUILDJSON^SDES2JSON(.RES,.URGENCYLIST)
 Q