source: EWD/ewdapps/bb/pages/bb.ewd@ 1439

Last change on this file since 1439 was 1284, checked in by Sam Habiel, 13 years ago

Added Sign-On Project, Bed Board, Tutorial, and Roll-and-Scroll emulator

File size: 7.9 KB
Line 
1<ewd:comment>
2 Ajax page contains the beds that gets auto-updated every 5 seconds.
3 V 0.4
4 (c) Sam Habiel
5 Licensed under AGPL
6</ewd:comment>
7<ewd:config pageType="ajax" applyTemplate="false" prePageScript="getbeds^jjihbb">
8<div>
9 <table width="100%" style="border: 1px solid #CFCFC3; border-style: outset">
10 <ewd:comment>
11 First Row: Ward Names
12 ; Ward Data has the following structure:
13 ; occ beds/total^occmale/maletotal^occfemale/femaletotal^oos^emptymale/emptyfemale/emptytotal
14 </ewd:comment>
15 <tr>
16 <ewd:forEach sessionName="wardbed" index="$ward" return="$warddata">
17 <ewd:getPiece data="$warddata" asciiDelimiter="94" pieceNumber="1" return="$nBed">
18 <ewd:getPiece data="$warddata" asciiDelimiter="94" pieceNumber="2" return="$nMale">
19 <ewd:getPiece data="$warddata" asciiDelimiter="94" pieceNumber="3" return="$nFemale">
20 <ewd:getPiece data="$warddata" asciiDelimiter="94" pieceNumber="4" return="$nOOS">
21 <ewd:getPiece data="$warddata" asciiDelimiter="94" pieceNumber="5" return="$nAvail">
22 <th style="color: white; font-weight: bold; background-color: #357AE8; border: 1px solid #2F5BB7; text-align: center">
23 <?= $ward ?> <br />
24 <ewd:getPiece data="$nBed" asciiDelimiter="47" pieceNumber="1" return="$nWardCensus">
25 (Census: <?= $nWardCensus ?>) <br />
26 (M: <?= $nMale ?> F: <?= $nFemale ?> OOS: <?= $nOOS ?>) <br />
27 <ewd:getPiece data="$nAvail" asciiDelimiter="47" pieceNumber="1" return="$nEmptyMaleBeds">
28 <ewd:getPiece data="$nAvail" asciiDelimiter="47" pieceNumber="2" return="$nEmptyFemaleBeds">
29 <ewd:getPiece data="$nAvail" asciiDelimiter="47" pieceNumber="3" return="$nEmptyBeds">
30 (Availability: M: <?= $nEmptyMaleBeds ?> F: <?= $nEmptyFemaleBeds ?> T: <?= $nEmptyBeds ?> )
31 </th>
32 </ewd:forEach>
33 </tr>
34
35 <ewd:comment>Second Row: Contents.
36 We use valign and style vertical align on the td b/c only valign works even though it's deprecated!
37 </ewd:comment>
38 <tr>
39 <ewd:forEach sessionName="wardbed" index="$ward">
40 <td valign="top" style="verical-align: top;">
41 <table style="padding:0; border:0">
42 <ewd:forEach sessionName="wardbed" param1="$ward" index="$bed" return="$beddata">
43 <ewd:comment>
44 Bed Data is as follows:
45 pt name^pt sex^adm date^lodger^EDW^MOT^bed oos?^bed oos msg^bed oss comment
46 </ewd:comment>
47 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="1" return="$ptname">
48 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="2" return="$sex">
49 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="3" return="$admDate">
50 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="4" return="$lodger">
51 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="5" return="$edw">
52 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="6" return="$mot">
53 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="7" return="$oos">
54 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="8" return="$oosmsg">
55 <ewd:getPiece data="$beddata" asciiDelimiter="94" pieceNumber="9" return="$ooscomment">
56 <ewd:getPiece data="$bed" asciidelimiter="45" pieceNumber="3" return="$bedsex">
57 <tr>
58 <ewd:comment>Bed: Color beds for males and females</ewd:comment>
59 <ewd:if firstValue="$bedsex" operation="=" secondValue="M">
60 <td class="mbed"><?= $bed ?></td>
61 <ewd:elseif firstValue="$bedsex" operation="=" secondValue="F">
62 <td class="fbed"><?= $bed ?></td>
63 <ewd:else>
64 <td class="nbed"><?= $bed ?></td>
65 </ewd:if>
66
67 <ewd:comment>Now, Patients...</ewd:comment>
68 <td>
69 <ewd:if firstValue="$ptname" operation="=" secondValue="">
70 <ewd:comment>Do nothing here, for now.</ewd:comment>
71 <ewd:else>
72
73 <ewd:comment> Print patients; mismatched beds show up in a different color</ewd:comment>
74 <ewd:if firstValue="$bedsex" operation="=" secondValue="">
75 <span class="okbed"><?= $ptname ?></span>
76 <ewd:else>
77 <ewd:if firstValue="$bedsex" operation="[" secondValue="$sex">
78 <span class="okbed"><?= $ptname ?></span>
79 <ewd:else>
80 <span class="mismatch"><?= $ptname ?></span>
81 </ewd:if>
82 </ewd:if>
83
84 <ewd:comment>Lodger</ewd:comment>
85 <ewd:if firstValue="$lodger" operation="=" secondValue="1">
86 <br />
87 <span class="lodger">(reserved) (since <?= $admDate ?>)</span>
88 </ewd:if>
89
90 <ewd:comment>EDW</ewd:comment>
91 <ewd:if firstValue="$edw" operation="=" secondValue="1">
92 &nbsp;<span class="EDW">EDW</span>
93 </ewd:if>
94
95 <ewd:comment>MOT</ewd:comment>
96 <ewd:if firstValue="$mot" operation="=" secondValue="1">
97 &nbsp;<span class="MOT">MOT</span>
98 </ewd:if>
99
100 </ewd:if>
101
102 <ewd:comment>Deal with Out Of Service Beds</ewd:comment>
103 <ewd:if firstValue="$oos" operation="=" secondvalue="1">
104 <span class="oos"><?= $oosmsg ?>: <?= $ooscomment ?></span>
105 </ewd:if>
106 </td>
107 </tr>
108 </ewd:forEach>
109 </table>
110 </td>
111 </ewd:forEach>
112 </tr>
113 </table>
114 <br />
115 <ewd:comment>
116 Here we have the Census Table
117 wardbed=beds^males^females^empty beds^occupancy %
118 </ewd:comment>
119 <ewd:getPiece data="#wardbed" asciiDelimiter="94" pieceNumber="1" return="$tBed">
120 <ewd:getPiece data="#wardbed" asciiDelimiter="94" pieceNumber="2" return="$tMale">
121 <ewd:getPiece data="#wardbed" asciiDelimiter="94" pieceNumber="3" return="$tFemale">
122 <ewd:getPiece data="#wardbed" asciiDelimiter="94" pieceNumber="4" return="$tEmptyBed">
123 <ewd:getPiece data="#wardbed" asciiDelimiter="94" pieceNumber="5" return="$occper">
124 <table width="100%" style="border: 1px solid #CFCFC3">
125 <tr>
126 <th colspan="100%" style="color: white; font-weight: bold; background-color: #357AE8">Census</th>
127 </tr>
128 <tr style="color: white; font-weight: bold; background-color: #357AE8; border: 1px solid #2F5BB7; text-align: center">
129 <td width="20%">Total Beds</td>
130 <td width="20%">Males</td>
131 <td width="20%">Females</td>
132 <td width="20%">Empty Beds</td>
133 <td width="20%">% Occupation</td>
134 </tr>
135 <tr style="font-weight: bold; text-align: center">
136 <td><?= $tBed ?></td>
137 <td><?= $tMale ?></td>
138 <td><?= $tFemale ?></td>
139 <td><?= $tEmptyBed ?></td>
140 <td><?= $occper ?></td>
141 </tr>
142 </table>
143</div>
Note: See TracBrowser for help on using the repository browser.