VistA-WorldVistAEHR/r/NURSING_SERVICE-NUR/NURCAS2.m

16 lines
1.2 KiB
Mathematica

NURCAS2 ;HIRMFO/MD,FT-UTILITY($J) ARRAY BUILDER FOR ASSIGNMENT SHEET ;6/26/97 14:42
;;4.0;NURSING SERVICE;**2,24**;Apr 25, 1997
I "Pp"[NUREDB D PAT
I "Uu"[NUREDB D KVAR^VADPT F DFN=0:0 S DFN=$O(^NURSF(214,"AF","A",NURWARD,DFN)) Q:DFN'>0 W:$E(IOST)="C" "." D 1^VADPT D ALLPAT
I "Ss"[NUREDB F DFN=0:0 S DFN=$O(^NURSF(214,"AF","A",NURWARD,DFN)) Q:DFN'>0 D 1^VADPT W:$E(IOST)="C" "." I VADM(1)'="" D SELECT
Q
SELECT S NROOM="" F S NROOM=$O(NRMBD(NROOM)) Q:NROOM="" I $P($P(VAIN(5),U),"-",1,2)=NROOM D SELECT1
Q
SELECT1 S NBED=$S('($P(VAIN(5),"-",2)=""):$P(VAIN(5),"-",2),1:" BLANK"),NAME=$P(VADM(1),"^"),^TMP($J,"NURCEN",NROOM,NBED,NAME)=DFN_"^"_VA("PID")_"^"_$P(VAIN(7),"^",2)
Q
ALLPAT I '(VADM(1)="") S NAME=VADM(1),NROOM=$S('($P(VAIN(5),"-")=""):$P(VAIN(5),"-"),1:" BLANK"),NBED=$S('($P(VAIN(5),"-",2)=""):$P(VAIN(5),"-",2),1:" BLANK"),^TMP($J,"NURCEN",NROOM,NBED,NAME)=DFN_"^"_VA("PID")_"^"_$P(VAIN(7),"^",2)
Q
PAT D 1^VADPT I '(VADM(1)="") S NAME=VADM(1),NROOM=$S('($P(VAIN(5),"-")=""):$P(VAIN(5),"-"),1:" BLANK"),NBED=$S('($P(VAIN(5),"-",2)=""):$P(VAIN(5),"-",2),1:" BLANK"),^TMP($J,"NURCEN",NROOM,NBED,NAME)=DFN_"^"_VA("PID")_"^"_$P(VAIN(7),"^",2)
S NPWARD=$P($G(^NURSF(214,+DFN,0)),U,3) D EN6^NURSAUTL
Q