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

SDECGMR.m

Go to the documentation of this file.
  1. SDECGMR ;ALB/SAT - VISTA SCHEDULING RPCS ;MAR 15, 2017
  1. ;;5.3;Scheduling;**627,658**;Aug 13, 1993;Build 23
  1. ;
  1. Q
  1. ;
  1. STOP(GMRSTOP,SDGMR) ;get stop codes from field 688 of REQUEST SERVICES file 123.5
  1. ; .GMRSTOP - returned array of STOP CODE pointers to CLINIC STOP file 40.7
  1. ; GMRSTOP(<clinic stop id>)=<clinic stop name>
  1. ; SDGMR - (required) pointer to REQUEST/CONSULTATION file 123
  1. N RS,SDDATA,SDI,SDIEN,SDNM
  1. K GMRSTOP
  1. S RS=$$GET1^DIQ(123,SDGMR_",",1,"I") ;get TO SERVICE
  1. D GETS^DIQ(123.5,RS_",","688*","IE","SDDATA")
  1. S SDI=0 F S SDI=$O(SDDATA(123.5688,SDI)) Q:SDI="" D
  1. .S SDIEN=$G(SDDATA(123.5688,SDI,.01,"I"))
  1. .S SDNM=$G(SDDATA(123.5688,SDI,.01,"E"))
  1. .S:+SDIEN GMRSTOP(SDIEN)=SDNM
  1. Q
  1. ;
  1. GETSVC(GMRSVC,SVC) ;get REQUEST SERVICES entries for given stop codes
  1. ; .GMRSVC - returned array of REQUEST SERVICES entries
  1. ; .SVC - input array of clinic stop codes SVC(NAME)=ID pointer to CLINIC STOP file 40.7
  1. N AB1,ID,SDN,STOP
  1. K GMRSVC
  1. S SDN="" F S SDN=$O(SVC(SDN)) Q:SDN="" D
  1. .I SVC(SDN)="" Q
  1. .S STOP=SVC(SDN) I '$D(^DIC(40.7,STOP,0)) Q
  1. .S ID=0 F S ID=$O(^GMR(123.5,"AB1",STOP,ID)) Q:ID="" D
  1. ..S AB1=0 F S AB1=$O(^GMR(123.5,"AB1",STOP,ID,AB1)) Q:AB1="" D
  1. ...Q:STOP'=$P($G(^GMR(123.5,ID,688,AB1,0)),U,1)
  1. ...S GMRSVC(ID)=""
  1. Q