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

APCDPGK.m

Go to the documentation of this file.
  1. APCDPGK ; IHS/CMI/LAB - LOOKUP GOAL ;
  1. ;;2.0;IHS PCC SUITE;**7**;MAY 14, 2009
  1. ;CALLED FROM APCD INPUT TEMPLATES
  1. ; GOAL based on a GOAL # that is entered through data entry.
  1. S U="^",APCDPERR=""
  1. I APCDPR="?" W !,"Enter a GOAL Number in the form XXXXNN, where XXXX is the 2-4 digit location",!," abbreviation and NN is a GOAL number from 1 to 999.99." S APCDPERR=1 Q
  1. I APCDPR="??" W !,"Enter a GOAL number in the form XXXXNN where XXXX is the 2-4 digit location",!," abbreviation and NN is GOAL number. The available loc. abbrevs are:" D LL S APCDPERR=1 Q
  1. S:APCDPR["#" APCDPR=$P(APCDPR,"#")_$P(APCDPR,"#",2)
  1. S APCDPPL="" F APCDPI=1:1:$L(APCDPR) Q:$E(APCDPR,APCDPI)?1N S APCDPPL=APCDPPL_$E(APCDPR,APCDPI)
  1. I APCDPPL="" W !,"No facility code has been entered." S APCDPERR=1 Q
  1. S APCDPGOC="",APCDPGOC=$O(^AUTTLOC("D",APCDPPL,APCDPGOC)) I APCDPGOC="" W !,"NO Location Abbreviation - PLEASE NOTIFY YOUR SUPERVISOR" S APCDPERR=1 Q
  1. S APCDPN=$P(APCDPR,APCDPPL,2) I APCDPN<0!(APCDPN>999.99) W !,"Invalid GOAL number" S APCDPERR=1 Q
  1. S APCDPN=" "_$E("000",1,(3-$L($P(APCDPN,"."))))_$P(APCDPN,".")_"."_$P(APCDPN,".",2)_$E("00",1,(2-$L($P(APCDPN,".",2))))
  1. I '$D(^AUPNGOAL("AA",APCDPAT,APCDPGOC,APCDPN)) W !,"No GOAL Number ",APCDPN," on file for this patient for location ",$P(^AUTTLOC(APCDPGOC,0),U,2),"." S APCDPERR=1 Q
  1. S APCDPDFN="",APCDPDFN=$O(^AUPNGOAL("AA",APCDPAT,APCDPGOC,APCDPN,APCDPDFN))
  1. S APCDPDFN="`"_APCDPDFN
  1. K APCDPGOC,APCDPN,APCDPI,APCDPN,APCDPPL,APCDPG,APCDPSUB
  1. Q
  1. LL ;
  1. N DIC,DA,D,DZ S DIC="^AUTTLOC(",DIC(0)="E",D="D",DZ="??" D DQ^DICQ K Y,DIC,D
  1. Q