source: FOIAVistA/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSIVHLD.m@ 1314

Last change on this file since 1314 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 987 bytes
Line 
1PSIVHLD ;BIR/PR-ORDERS ON/OFF HOLD, ON/OFF CALL ;16 DEC 97 / 1:39 PM
2 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
3 ;Needs DFN,PSIVNST (O or H)
4 ;
5STOP ;Put all orders on hold or on call
6 N DA,DIE,DR,PSIVACT
7 F ON1=0:0 S ON1=$O(^PS(55,DFN,"IV",ON1)) Q:'ON1 I "AR"[$P($G(^(ON1,0)),U,17) D
8 .K DA,DIE,DR S PSIVACT=1,DA=ON1,DA(1)=DFN,DIE="^PS(55,"_DFN_",""IV"",",DR="100///"_PSIVNST,PSIVREA=PSIVNST D ^DIE,LOG
9 Q
10 ;
11START ;Set all orders put on hold or oncall back to active if not expired.
12 N DA,DIE,DR,ON1,PSIVACT,PSIVALT,PSIVHNW,PSIVREA
13 D NOW^%DTC S PSIVHNW=%
14 F ON1=0:0 S ON1=$O(^PS(55,DFN,"IV",ON1)) Q:'ON1 I $D(^(ON1,0)) S Y=^(0) I PSIVNST[$P(Y,U,17) D
15 .K DA,DR,DIE S PSIVACT=1,DA=ON1,DA(1)=DFN,DIE="^PS(55,"_DFN_",""IV"",",P(17)=$S($P(Y,U,3)<PSIVHNW:"E",1:"A"),DR="100///"_P(17) D ^DIE
16 .I P(17)'="E" S PSIVREA=$S(PSIVNST="H":"U",1:"C") D LOG
17 Q
18LOG ;Auto entry to log
19 K PSIVALT S PSIVAL=$P($G(^PS(53.3,+PSGALO,0)),U),(ON,ON55)=ON1_"V"
20 D LOG^PSIVORAL D:PSIVNST="H" HOLD^PSIVOE
21 Q
Note: See TracBrowser for help on using the repository browser.