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

FHXWRD.m

Go to the documentation of this file.
  1. FHXWRD ; HISC/REL/NCA - Update Patient Dietetic Ward ;8/7/95 15:13
  1. ;;5.5;DIETETICS;;Jan 28, 2005
  1. EN1 ; Ask user whether they want to update
  1. R !!,"Update the Patient Dietetic Location? N// ",X:DTIME G:'$T!(X["^") KIL S:X="" X="N" D TR^FH
  1. I $P("YES",X,1)'="",$P("NO",X,1)'="" D MSG G EN1
  1. I X?1"Y".E D E1 W !!,"....Done"
  1. G KIL
  1. E1 ; Process Updating Patient Dietetic Ward
  1. K ^FHPT("AW")
  1. S NX="" F S NX=$O(^DPT("CN",NX)) Q:NX="" F DFN=0:0 S DFN=$O(^DPT("CN",NX,DFN)) Q:DFN'>0 S ADM=^(DFN) D SET
  1. Q
  1. SET D DID^FHDPA
  1. S FHZ115="P"_DFN D CHECK^FHOMDPA I FHDFN="" Q
  1. Q:$D(^FHPT(FHDFN,"A",+ADM,0))#2=0
  1. S Y=$P(^FHPT(FHDFN,"A",ADM,0),"^",8,9),$P(^(0),"^",8,9)=FHWRD_"^"_FHRMB
  1. S:FHWRD ^FHPT("AW",FHWRD,FHDFN)=ADM
  1. I (FHWRD_"^"_FHRMB)'=Y S EVT="L^T^^"_$P(Y,"^",1)_"~"_$P(Y,"^",2) S:FHWRD EVT=EVT_"~"_FHWRD_"~"_FHRMB S:'FHWRD $P(EVT,"^",2)="D" D ^FHORX
  1. Q:'FHWRD
  1. ; Update Type of Service
  1. S FHX3=$P($G(^FH(119.6,+FHWRD,0)),"^",10) S:FHX3="" FHX3="TCD" I FHX3[$P(^FHPT(FHDFN,"A",ADM,0),"^",5) Q
  1. S FHX3=$S($L(FHX3)=1:FHX3,FHX3["D":"D",1:"C"),$P(^FHPT(FHDFN,"A",ADM,0),"^",5)=FHX3
  1. S FHX2=$P(^FHPT(FHDFN,"A",ADM,0),"^",2) I FHX2,$P($G(^FHPT(FHDFN,"A",ADM,"DI",+FHX2,0)),"^",8)'="" S $P(^(0),"^",8)=FHX3
  1. Q
  1. KIL G KILL^XUSCLEAN
  1. MSG ; Write Error Message
  1. W *7,!,"Answer YES or NO on whether you want to update the Dietetic"
  1. W !,"locations for inpatients. This will insert the proper location"
  1. W !,"into the Dietetic Patient file for the appropriate admission."
  1. W !,"NOTE: During installation, the Dietetic locations for inpatients"
  1. W !,"have been updated already and this option will update them again."
  1. Q