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

FHIPST2.m

Go to the documentation of this file.
  1. FHIPST2 ; HISC/REL - Move Room-Beds to Wards ;5/14/92 13:58
  1. ;;5.0;Dietetics;;Oct 11, 1995
  1. Q:$D(^FH(119.6,"AR"))
  1. W !!,"Insert Ward names in File 119.6 ..."
  1. F KK=0:0 S KK=$O(^DIC(42,KK)) Q:KK<1 S X=$P($G(^(KK,0)),"^",1) D WRD
  1. W !!,"Move Room-Beds to Dietetic Wards ..."
  1. F KK=0:0 S KK=$O(^DG(405.4,KK)) Q:KK<1 I '$D(^FH(119.6,"AR",KK)) D SET
  1. Q
  1. WRD K ^FH(119.6,"B",KK) I '$G(^DIC(42,KK,"ORDER")) K ^FH(119.6,KK) Q
  1. S $P(^FH(119.6,KK,0),"^",1)=X S ^FH(119.6,"B",X,KK)=""
  1. S ^FH(119.6,KK,"W",0)="^119.63P^1^1",^FH(119.6,KK,"W",1,0)=KK,^FH(119.6,KK,"W","B",KK,1)="",^FH(119.6,"AW",KK,KK,1)=""
  1. Q
  1. SET F WRD=0:0 S WRD=$O(^DG(405.4,KK,"W",WRD)) Q:WRD<1 I $G(^DIC(42,WRD,"ORDER")) G S1
  1. W !?5,"No Active Ward found for ",$P(^DG(405.4,KK,0),"^",1)," in Room-Bed File (405.4)" Q
  1. S1 I '$D(^FH(119.6,WRD,"R",0)) S ^(0)="^119.62P^^"
  1. S NX=$P(^FH(119.6,WRD,"R",0),"^",3)+1,$P(^(0),"^",3,4)=NX_"^"_NX
  1. S ^FH(119.6,WRD,"R",NX,0)=KK,^FH(119.6,WRD,"R","B",KK,NX)=""
  1. S ^FH(119.6,"AR",KK,WRD,NX)="" Q