Spaces:
Sleeping
Sleeping
Generate Table Models and schema
Browse files- .env.example +1 -1
- alembic.ini +1 -1
- alembic/versions/273997959ba7_add_6_models_in_database.py +32 -0
- data/rag_input_data/incidentpersonnel_columns_details.txt +44 -541
- poetry.lock +104 -2
- src/entities/apparatus/__init__.py +2 -0
- src/entities/apparatus/_model.py +68 -0
- src/entities/apparatus/_schema.py +307 -0
- src/entities/auv_incidentapparatus/__init__.py +2 -0
- src/entities/auv_incidentapparatus/_model.py +95 -0
- src/entities/auv_incidentapparatus/_schema.py +484 -0
- src/entities/auv_incidentbase/__init__.py +2 -0
- src/entities/auv_incidentbase/_model.py +185 -0
- src/entities/auv_incidentbase/_schema.py +193 -0
- src/entities/auv_incidentpersonnel/__init__.py +2 -0
- src/entities/auv_incidentpersonnel/_model.py +30 -0
- src/entities/auv_incidentpersonnel/_schema.py +156 -0
- src/entities/base/_model.py +1 -6
- src/entities/incident/__init__.py +2 -0
- src/entities/incident/_model.py +113 -0
- src/entities/incident/_schema.py +209 -0
- src/entities/personnel/__init__.py +2 -0
- src/entities/personnel/_model.py +44 -0
- src/entities/personnel/_schema.py +182 -0
.env.example
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
SQLALCHEMY_DATABASE_URI=
|
| 2 |
OPENAI_API_KEY=
|
| 3 |
OPENAI_MODEL_NAME=
|
| 4 |
CHROMA_COLLECTION_NAME=
|
|
|
|
| 1 |
+
SQLALCHEMY_DATABASE_URI=sqlite+aiosqlite:///./database/firemsdata.db
|
| 2 |
OPENAI_API_KEY=
|
| 3 |
OPENAI_MODEL_NAME=
|
| 4 |
CHROMA_COLLECTION_NAME=
|
alembic.ini
CHANGED
|
@@ -86,7 +86,7 @@ path_separator = os
|
|
| 86 |
# database URL. This is consumed by the user-maintained env.py script only.
|
| 87 |
# other means of configuring database URLs may be customized within the env.py
|
| 88 |
# file.
|
| 89 |
-
sqlalchemy.url =
|
| 90 |
|
| 91 |
|
| 92 |
[post_write_hooks]
|
|
|
|
| 86 |
# database URL. This is consumed by the user-maintained env.py script only.
|
| 87 |
# other means of configuring database URLs may be customized within the env.py
|
| 88 |
# file.
|
| 89 |
+
sqlalchemy.url = sqlite+aiosqlite:///./database/firemsdata.db
|
| 90 |
|
| 91 |
|
| 92 |
[post_write_hooks]
|
alembic/versions/273997959ba7_add_6_models_in_database.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Add 6 models in database
|
| 2 |
+
|
| 3 |
+
Revision ID: 273997959ba7
|
| 4 |
+
Revises:
|
| 5 |
+
Create Date: 2026-03-13 11:51:55.126289
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
+
from typing import Sequence, Union
|
| 9 |
+
|
| 10 |
+
from alembic import op
|
| 11 |
+
import sqlalchemy as sa
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
# revision identifiers, used by Alembic.
|
| 15 |
+
revision: str = '273997959ba7'
|
| 16 |
+
down_revision: Union[str, Sequence[str], None] = None
|
| 17 |
+
branch_labels: Union[str, Sequence[str], None] = None
|
| 18 |
+
depends_on: Union[str, Sequence[str], None] = None
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def upgrade() -> None:
|
| 22 |
+
"""Upgrade schema."""
|
| 23 |
+
# ### commands auto generated by Alembic - please adjust! ###
|
| 24 |
+
pass
|
| 25 |
+
# ### end Alembic commands ###
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def downgrade() -> None:
|
| 29 |
+
"""Downgrade schema."""
|
| 30 |
+
# ### commands auto generated by Alembic - please adjust! ###
|
| 31 |
+
pass
|
| 32 |
+
# ### end Alembic commands ###
|
data/rag_input_data/incidentpersonnel_columns_details.txt
CHANGED
|
@@ -1,656 +1,159 @@
|
|
| 1 |
-
Column Name:
|
| 2 |
-
Description:
|
| 3 |
Data Type: char(14), NOT NULL
|
| 4 |
-
Examples: _4GR15262U_SMS, _4GR15HZEC_SMS, _4GR166YT7_SMS
|
| 5 |
-
|
| 6 |
-
Column Name: apparatuskey
|
| 7 |
-
Description: The primary key for the apparatus table. This is a unique, system-generated 14-character identifier for a specific apparatus response to an incident. It serves as the primary link between apparatus response records and personnel assignments. It indicates which piece of equipment a person was assigned to for a given incident.
|
| 8 |
-
Data Type: char(14), NOT NULL
|
| 9 |
-
Examples: _4GR15265W_SMS, _4GR15HZF7_SMS, _4GR166YUI_SMS
|
| 10 |
-
|
| 11 |
-
Column Name: pslid
|
| 12 |
-
Description: A unique, system-generated identifier for an individual firefighter or personnel record. This key links a personnel record to their assignments in an incident. It is the primary identifier used to join with a master personnel table to retrieve static information like name and rank.
|
| 13 |
-
Data Type: char(15), NOT NULL
|
| 14 |
-
Examples: _1XL0XJ7VGDEFA, _26H0W4XBHCPAU, _2FW0KTEBFCPAU
|
| 15 |
-
|
| 16 |
-
Column Name: personnelid
|
| 17 |
-
Description: An employee or badge number assigned to the firefighter or personnel. This is a human-readable identifier, likely used for payroll, scheduling, or internal identification, and is distinct from the system-generated pslid.
|
| 18 |
-
Data Type: int, NOT NULL
|
| 19 |
Examples:
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
Column Name: namefirst
|
| 23 |
-
Description: The first name of the firefighter or personnel
|
| 24 |
Data Type: char(25), NOT NULL
|
| 25 |
Examples:
|
| 26 |
Dale, Brandon, Kyle
|
| 27 |
|
|
|
|
| 28 |
Column Name: namemi
|
| 29 |
-
Description: The middle initial of the firefighter or personnel. This field may contain a single character
|
| 30 |
Data Type: char(2), NULL
|
| 31 |
Examples:
|
| 32 |
E, A, S
|
| 33 |
|
|
|
|
| 34 |
Column Name: namelast
|
| 35 |
-
Description: The last name of the firefighter or personnel
|
| 36 |
Data Type: char(25), NOT NULL
|
| 37 |
Examples:
|
| 38 |
Bryan, Davis, Coles
|
| 39 |
|
|
|
|
| 40 |
Column Name: namesuffix
|
| 41 |
-
Description:
|
| 42 |
Data Type: char(5), NULL
|
| 43 |
Examples:
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
Column Name: namefirstlast
|
| 47 |
-
Description: A concatenated string of the personnel's first and last name in "First Last" format (e.g., "Dale Bryan"). This is likely a pre-processed field for reporting or display purposes.
|
| 48 |
-
Data Type: varchar(51), NOT NULL
|
| 49 |
-
Examples:
|
| 50 |
-
Dale Bryan, Brandon Davis, Kyle Coles
|
| 51 |
|
| 52 |
-
Column Name: namelastfirst
|
| 53 |
-
Description: A concatenated string of the personnel's last and first name in "Last, First" format (e.g., "Bryan, Dale"). This is likely a pre-processed field for reporting or display purposes, such as in lists sorted by last name.
|
| 54 |
-
Data Type: varchar(51), NOT NULL
|
| 55 |
-
Examples:
|
| 56 |
-
Bryan, Dale, Davis, Brandon, Coles, Kyle
|
| 57 |
-
|
| 58 |
-
Column Name: namefull
|
| 59 |
-
Description: The full name of the personnel, including first name, middle initial, and last name (e.g., "Dale E Bryan"). This is likely a pre-processed field for display purposes.
|
| 60 |
-
Data Type: varchar(77), NOT NULL
|
| 61 |
-
Examples:
|
| 62 |
-
Dale E Bryan, Brandon A Davis, Kyle S Coles
|
| 63 |
|
| 64 |
Column Name: rank
|
| 65 |
-
Description:
|
| 66 |
Data Type: char(10), NOT NULL
|
| 67 |
Examples:
|
| 68 |
CAPT, FF, ENG
|
| 69 |
|
|
|
|
| 70 |
Column Name: actiontaken1code
|
| 71 |
-
Description:
|
| 72 |
Data Type: int, NULL
|
| 73 |
Examples:
|
| 74 |
NULL, NULL, 93
|
| 75 |
|
|
|
|
| 76 |
Column Name: actiontaken1descip
|
| 77 |
-
Description:
|
| 78 |
Data Type: varchar(50), NULL
|
| 79 |
Examples:
|
| 80 |
NULL, NULL, Cancelled en route
|
| 81 |
|
|
|
|
| 82 |
Column Name: actiontaken2code
|
| 83 |
-
Description:
|
| 84 |
Data Type: int, NULL
|
| 85 |
Examples:
|
| 86 |
NULL, NULL, NULL
|
| 87 |
|
|
|
|
| 88 |
Column Name: actiontaken2descip
|
| 89 |
-
Description:
|
| 90 |
Data Type: varchar(50), NULL
|
| 91 |
Examples:
|
| 92 |
NULL, NULL, NULL
|
| 93 |
|
|
|
|
| 94 |
Column Name: actiontaken3code
|
| 95 |
-
Description:
|
| 96 |
Data Type: int, NULL
|
| 97 |
Examples:
|
| 98 |
NULL, NULL, NULL
|
| 99 |
|
|
|
|
| 100 |
Column Name: actiontaken3descip
|
| 101 |
-
Description:
|
| 102 |
Data Type: varchar(50), NULL
|
| 103 |
Examples:
|
| 104 |
NULL, NULL, NULL
|
| 105 |
|
|
|
|
| 106 |
Column Name: actiontaken4code
|
| 107 |
-
Description:
|
| 108 |
Data Type: int, NULL
|
| 109 |
Examples:
|
| 110 |
NULL, NULL, NULL
|
| 111 |
|
|
|
|
| 112 |
Column Name: actiontaken4descip
|
| 113 |
-
Description:
|
| 114 |
Data Type: varchar(50), NULL
|
| 115 |
Examples:
|
| 116 |
NULL, NULL, NULL
|
| 117 |
|
|
|
|
| 118 |
Column Name: amount1
|
| 119 |
-
Description:
|
| 120 |
Data Type: float, NULL
|
| 121 |
Examples:
|
| 122 |
NULL, NULL, NULL
|
| 123 |
|
|
|
|
| 124 |
Column Name: amount2
|
| 125 |
-
Description:
|
| 126 |
Data Type: float, NULL
|
| 127 |
Examples:
|
| 128 |
NULL, NULL, NULL
|
| 129 |
|
|
|
|
| 130 |
Column Name: crole
|
| 131 |
-
Description:
|
| 132 |
Data Type: int, NULL
|
| 133 |
Examples:
|
| 134 |
NULL, NULL, NULL
|
| 135 |
|
|
|
|
| 136 |
Column Name: losapcreditcode
|
| 137 |
-
Description:
|
| 138 |
Data Type: int, NULL
|
| 139 |
Examples:
|
| 140 |
1, 1, 1
|
| 141 |
|
|
|
|
| 142 |
Column Name: losapcreditdescrip
|
| 143 |
-
Description:
|
| 144 |
Data Type: varchar(50), NULL
|
| 145 |
Examples:
|
| 146 |
Losap Credit, Losap Credit, Losap Credit
|
| 147 |
|
| 148 |
-
Column Name: incidentkey (duplicate)
|
| 149 |
-
Description: (Duplicate) The primary key for the incident table, repeated here likely to facilitate joins or reporting within this dataset.
|
| 150 |
-
Data Type: char(14), NOT NULL
|
| 151 |
-
Examples:
|
| 152 |
-
_4GR15262U_SMS, _4GR15HZEC_SMS, _4GR166YT7_SMS
|
| 153 |
-
|
| 154 |
-
Column Name: apparatuskey (duplicate)
|
| 155 |
-
Description: (Duplicate) The primary key for the apparatus table, repeated here likely to facilitate joins or reporting within this dataset.
|
| 156 |
-
Data Type: char(14), NOT NULL
|
| 157 |
-
Examples:
|
| 158 |
-
_4GR15265W_SMS, _4GR15HZF7_SMS, _4GR166YUI_SMS
|
| 159 |
|
| 160 |
Column Name: apparatusid
|
| 161 |
-
Description:
|
| 162 |
Data Type: char(10), NOT NULL
|
| 163 |
Examples:
|
| 164 |
BE7, BE6, BE3
|
| 165 |
|
| 166 |
-
Column Name: deptunitornotcode
|
| 167 |
-
Description: A numeric code indicating whether the apparatus is a department-owned unit or from another agency/service. A value of 0 likely means it is a department unit.
|
| 168 |
-
Data Type: int, NOT NULL
|
| 169 |
-
Examples:
|
| 170 |
-
0, 0, 0
|
| 171 |
-
|
| 172 |
-
Column Name: deptunitornotdescrip
|
| 173 |
-
Description: A textual description corresponding to the deptunitornotcode, indicating if the apparatus is a department unit (e.g., "DeptUnit").
|
| 174 |
-
Data Type: varchar(50), NOT NULL
|
| 175 |
-
Examples:
|
| 176 |
-
DeptUnit, DeptUnit, DeptUnit
|
| 177 |
-
|
| 178 |
-
Column Name: priorityresponsecode
|
| 179 |
-
Description: A numeric code indicating the priority of the response (e.g., emergency vs. non-emergency). A value of 1 typically signifies an emergency response (lights and sirens).
|
| 180 |
-
Data Type: int, NOT NULL
|
| 181 |
-
Examples:
|
| 182 |
-
1, 1, 1
|
| 183 |
-
|
| 184 |
-
Column Name: priorityresponsedescrip
|
| 185 |
-
Description: A textual description corresponding to the priorityresponsecode. This confirms the response priority, e.g., "Yes" for emergency, "No" for non-emergency.
|
| 186 |
-
Data Type: varchar(50), NOT NULL
|
| 187 |
-
Examples:
|
| 188 |
-
Yes, Yes, Yes
|
| 189 |
-
|
| 190 |
-
Column Name: cancelledenroutecode
|
| 191 |
-
Description: A numeric code indicating whether the apparatus was cancelled while en route to the incident. A value of 1 typically means "Yes", 0 means "No".
|
| 192 |
-
Data Type: int, NOT NULL
|
| 193 |
-
Examples:
|
| 194 |
-
0, 1, 1
|
| 195 |
-
|
| 196 |
-
Column Name: cancelledenroutedescrip
|
| 197 |
-
Description: A textual description corresponding to the cancelledenroutecode. This indicates if the unit was cancelled en route, e.g., "No" or "Yes".
|
| 198 |
-
Data Type: varchar(50), NOT NULL
|
| 199 |
-
Examples:
|
| 200 |
-
No, Yes, Yes
|
| 201 |
-
|
| 202 |
-
Column Name: firstarrivingunitcode
|
| 203 |
-
Description: A numeric code indicating whether this apparatus was the first to arrive on the scene of the incident. A value of 1 means "Yes", 0 means "No".
|
| 204 |
-
Data Type: int, NOT NULL
|
| 205 |
-
Examples:
|
| 206 |
-
1, 0, 1
|
| 207 |
-
|
| 208 |
-
Column Name: firstarrivingunitdescrip
|
| 209 |
-
Description: A textual description corresponding to the firstarrivingunitcode. This confirms if the unit was the first to arrive, e.g., "Yes" or "No".
|
| 210 |
-
Data Type: varchar(50), NOT NULL
|
| 211 |
-
Examples:
|
| 212 |
-
Yes, No, Yes
|
| 213 |
-
|
| 214 |
-
Column Name: dispatchtype
|
| 215 |
-
Description: A numeric code representing the type of dispatch (e.g., how the call was received or categorized). This field is often NULL.
|
| 216 |
-
Data Type: int, NULL
|
| 217 |
-
Examples:
|
| 218 |
-
NULL, NULL, NULL
|
| 219 |
-
|
| 220 |
-
Column Name: dispatchtypedescrip
|
| 221 |
-
Description: A textual description corresponding to the dispatchtype. This field is often NULL.
|
| 222 |
-
Data Type: varchar(50), NULL
|
| 223 |
-
Examples:
|
| 224 |
-
NULL, NULL, NULL
|
| 225 |
-
|
| 226 |
-
Column Name: respondedfromquarterscode
|
| 227 |
-
Description: A numeric code indicating whether the apparatus responded directly from its quarters/station. A value of 1 likely means "Yes", 0 means "No".
|
| 228 |
-
Data Type: int, NOT NULL
|
| 229 |
-
Examples:
|
| 230 |
-
0, 0, 0
|
| 231 |
-
|
| 232 |
-
Column Name: respondedfromquarterdescrip
|
| 233 |
-
Description: A textual description corresponding to the respondedfromquarterscode. This indicates if the response was from quarters, e.g., "No" (meaning they were likely already in service or responding from another location).
|
| 234 |
-
Data Type: varchar(50), NOT NULL
|
| 235 |
-
Examples:
|
| 236 |
-
No, No, No
|
| 237 |
-
|
| 238 |
-
Column Name: mainapparatususecode
|
| 239 |
-
Description: A numeric code describing the primary function or use of the apparatus (e.g., suppression, rescue). A value of 1 indicates suppression.
|
| 240 |
-
Data Type: int, NOT NULL
|
| 241 |
-
Examples:
|
| 242 |
-
1, 1, 1
|
| 243 |
-
|
| 244 |
-
Column Name: mainapparatususedescrip
|
| 245 |
-
Description: A textual description corresponding to the mainapparatususecode, describing the apparatus's primary function (e.g., "Suppression").
|
| 246 |
-
Data Type: varchar(50), NOT NULL
|
| 247 |
-
Examples:
|
| 248 |
-
Suppression, Suppression, Suppression
|
| 249 |
-
|
| 250 |
-
Column Name: apparatustypecode
|
| 251 |
-
Description: A numeric code representing the specific type of apparatus (e.g., engine, truck, ambulance). A value of 11 indicates an engine, 12 indicates a truck/aerial.
|
| 252 |
-
Data Type: int, NOT NULL
|
| 253 |
-
Examples:
|
| 254 |
-
11, 11, 11
|
| 255 |
-
|
| 256 |
-
Column Name: apparatustypedescrip
|
| 257 |
-
Description: A textual description corresponding to the apparatustypecode, providing the type of vehicle (e.g., "Engine", "Truck or aerial").
|
| 258 |
-
Data Type: varchar(50), NOT NULL
|
| 259 |
-
Examples:
|
| 260 |
-
Engine, Engine, Engine
|
| 261 |
-
|
| 262 |
-
Column Name: actiontaken1code (duplicate)
|
| 263 |
-
Description: (Duplicate) A code representing the primary action taken by the apparatus on the incident. This is likely the same as the personnel-level action code.
|
| 264 |
-
Data Type: int, NULL
|
| 265 |
-
Examples:
|
| 266 |
-
NULL, 93, 86
|
| 267 |
-
|
| 268 |
-
Column Name: actiontaken1descip (duplicate)
|
| 269 |
-
Description: (Duplicate) A textual description corresponding to the apparatus-level actiontaken1code.
|
| 270 |
-
Data Type: varchar(50), NULL
|
| 271 |
-
Examples:
|
| 272 |
-
NULL, Cancelled en route, Investigate
|
| 273 |
-
|
| 274 |
-
Column Name: actiontaken2code (duplicate)
|
| 275 |
-
Description: (Duplicate) A code representing a secondary action taken by the apparatus.
|
| 276 |
-
Data Type: int, NULL
|
| 277 |
-
Examples:
|
| 278 |
-
NULL, NULL, NULL
|
| 279 |
-
|
| 280 |
-
Column Name: actiontaken2descip (duplicate)
|
| 281 |
-
Description: (Duplicate) A textual description corresponding to the apparatus-level actiontaken2code.
|
| 282 |
-
Data Type: varchar(50), NULL
|
| 283 |
-
Examples:
|
| 284 |
-
NULL, NULL, NULL
|
| 285 |
-
|
| 286 |
-
Column Name: actiontaken3code (duplicate)
|
| 287 |
-
Description: (Duplicate) A code representing a tertiary action taken by the apparatus.
|
| 288 |
-
Data Type: int, NULL
|
| 289 |
-
Examples:
|
| 290 |
-
NULL, NULL, NULL
|
| 291 |
-
|
| 292 |
-
Column Name: actiontaken3descip (duplicate)
|
| 293 |
-
Description: (Duplicate) A textual description corresponding to the apparatus-level actiontaken3code.
|
| 294 |
-
Data Type: varchar(50), NULL
|
| 295 |
-
Examples:
|
| 296 |
-
NULL, NULL, NULL
|
| 297 |
-
|
| 298 |
-
Column Name: actiontaken4code (duplicate)
|
| 299 |
-
Description: (Duplicate) A code representing a quaternary action taken by the apparatus.
|
| 300 |
-
Data Type: int, NULL
|
| 301 |
-
Examples:
|
| 302 |
-
NULL, NULL, NULL
|
| 303 |
-
|
| 304 |
-
Column Name: actiontaken4descip (duplicate)
|
| 305 |
-
Description: (Duplicate) A textual description corresponding to the apparatus-level actiontaken4code.
|
| 306 |
-
Data Type: varchar(50), NULL
|
| 307 |
-
Examples:
|
| 308 |
-
NULL, NULL, NULL
|
| 309 |
|
| 310 |
Column Name: numberofresponders
|
| 311 |
-
Description: The total number of personnel who responded on
|
| 312 |
Data Type: int, NOT NULL
|
| 313 |
Examples:
|
| 314 |
3, 3, 3
|
| 315 |
|
| 316 |
-
Column Name: dispatchdatetime
|
| 317 |
-
Description: The combined date and time the apparatus was dispatched to the incident. Stored as a string in the format "HH:MM.ss" or similar.
|
| 318 |
-
Data Type: nvarchar(255), NULL
|
| 319 |
-
Examples:
|
| 320 |
-
08:31.0, 20:21.0, 39:16.0
|
| 321 |
-
|
| 322 |
-
Column Name: dispatchtime
|
| 323 |
-
Description: The time the apparatus was dispatched, represented in a 24-hour format (e.g., 19:08:31 for 7:08:31 PM).
|
| 324 |
-
Data Type: nvarchar(255), NULL
|
| 325 |
-
Examples:
|
| 326 |
-
19:08:31, 19:20:21, 19:39:16
|
| 327 |
-
|
| 328 |
-
Column Name: dispatchdate
|
| 329 |
-
Description: The date the apparatus was dispatched, in MM/DD/YYYY format.
|
| 330 |
-
Data Type: nvarchar(255), NULL
|
| 331 |
-
Examples:
|
| 332 |
-
10/9/2015, 10/9/2015, 10/9/2015
|
| 333 |
-
|
| 334 |
-
Column Name: dispatchenroutetime
|
| 335 |
-
Description: The duration between the dispatch time and the time the unit went en route. Formatted as HH:MM:SS.
|
| 336 |
-
Data Type: nvarchar(255), NULL
|
| 337 |
-
Examples:
|
| 338 |
-
0:00:44, 0:01:15, NULL
|
| 339 |
-
|
| 340 |
-
Column Name: dispatchenroutediffseconds
|
| 341 |
-
Description: The dispatchenroutetime expressed in total seconds. Useful for calculating average response times.
|
| 342 |
-
Data Type: int, NULL
|
| 343 |
-
Examples:
|
| 344 |
-
44, 75, 0
|
| 345 |
-
|
| 346 |
-
Column Name: enroutetoscenedatetime
|
| 347 |
-
Description: The combined date and time the apparatus marked that it was en route to the scene.
|
| 348 |
-
Data Type: nvarchar(255), NULL
|
| 349 |
-
Examples:
|
| 350 |
-
09:15.0, 21:36.0, 00:00.0
|
| 351 |
-
|
| 352 |
-
Column Name: enroutetoscenetime
|
| 353 |
-
Description: The time the apparatus marked en route, in a 24-hour format.
|
| 354 |
-
Data Type: nvarchar(255), NULL
|
| 355 |
-
Examples:
|
| 356 |
-
19:09:15, 19:21:36,
|
| 357 |
-
|
| 358 |
-
Column Name: enroutetoscenedate
|
| 359 |
-
Description: The date the apparatus marked en route.
|
| 360 |
-
Data Type: nvarchar(255), NULL
|
| 361 |
-
Examples:
|
| 362 |
-
10/9/2015, 10/9/2015, NULL
|
| 363 |
-
|
| 364 |
-
Column Name: enroutearrivalscenetime
|
| 365 |
-
Description: The duration between the unit marking en route and its arrival on the scene. Formatted as HH:MM:SS.
|
| 366 |
-
Data Type: nvarchar(255), NULL
|
| 367 |
-
Examples:
|
| 368 |
-
0:01:55, 0:03:37, NULL
|
| 369 |
-
|
| 370 |
-
Column Name: enroutearrivalscenediffseconds
|
| 371 |
-
Description: The enroutearrivalscenetime expressed in total seconds.
|
| 372 |
-
Data Type: int, NULL
|
| 373 |
-
Examples:
|
| 374 |
-
115, 217, 0
|
| 375 |
-
|
| 376 |
-
Column Name: responsetime
|
| 377 |
-
Description: The total duration from dispatch to arrival on scene. Formatted as HH:MM:SS.
|
| 378 |
-
Data Type: nvarchar(255), NULL
|
| 379 |
-
Examples:
|
| 380 |
-
0:02:39, 0:04:52, 0:00:00
|
| 381 |
|
| 382 |
Column Name: responsetimeseconds
|
| 383 |
-
Description:
|
| 384 |
Data Type: int, NULL
|
| 385 |
Examples:
|
| 386 |
159, 292, 0
|
| 387 |
|
| 388 |
-
Column Name: arrivaldatetime
|
| 389 |
-
Description: The combined date and time the apparatus arrived on the scene.
|
| 390 |
-
Data Type: nvarchar(255), NULL
|
| 391 |
-
Examples:
|
| 392 |
-
11:10.0, 25:13.0, 00:00.0
|
| 393 |
-
|
| 394 |
-
Column Name: arrivaltime
|
| 395 |
-
Description: The time the apparatus arrived on the scene, in a 24-hour format.
|
| 396 |
-
Data Type: nvarchar(255), NULL
|
| 397 |
-
Examples:
|
| 398 |
-
19:11:10, 19:25:13,
|
| 399 |
-
|
| 400 |
-
Column Name: arrivaldate
|
| 401 |
-
Description: The date the apparatus arrived on the scene.
|
| 402 |
-
Data Type: nvarchar(255), NULL
|
| 403 |
-
Examples:
|
| 404 |
-
10/9/2015, 10/9/2015, NULL
|
| 405 |
-
|
| 406 |
-
Column Name: arrivaltoenroutehospdifftime
|
| 407 |
-
Description: The duration between arrival on scene and the unit going en route to a hospital (for EMS calls). This field is largely NULL for non-EMS runs.
|
| 408 |
-
Data Type: nvarchar(255), NULL
|
| 409 |
-
Examples:
|
| 410 |
-
NULL, NULL, NULL
|
| 411 |
-
|
| 412 |
-
Column Name: arrivaltoenroutehospdiffseconds
|
| 413 |
-
Description: The arrivaltoenroutehospdifftime expressed in seconds.
|
| 414 |
-
Data Type: int, NULL
|
| 415 |
-
Examples:
|
| 416 |
-
0, 0, 0
|
| 417 |
-
|
| 418 |
-
Column Name: enroutetohospitaldatetime
|
| 419 |
-
Description: The combined date and time the unit went en route to the hospital.
|
| 420 |
-
Data Type: nvarchar(255), NULL
|
| 421 |
-
Examples:
|
| 422 |
-
00:00.0, 00:00.0, 00:00.0
|
| 423 |
-
|
| 424 |
-
Column Name: enroutetohospitaltime
|
| 425 |
-
Description: The time the unit went en route to the hospital.
|
| 426 |
-
Data Type: nvarchar(255), NULL
|
| 427 |
-
Examples:
|
| 428 |
-
, ,
|
| 429 |
-
|
| 430 |
-
Column Name: enroutetohospitaldate
|
| 431 |
-
Description: The date the unit went en route to the hospital.
|
| 432 |
-
Data Type: nvarchar(255), NULL
|
| 433 |
-
Examples:
|
| 434 |
-
NULL, NULL, NULL
|
| 435 |
-
|
| 436 |
-
Column Name: enroutetoarrivalhospdifftime
|
| 437 |
-
Description: The duration between going en route to the hospital and arriving at the hospital. This field is largely NULL.
|
| 438 |
-
Data Type: nvarchar(255), NULL
|
| 439 |
-
Examples:
|
| 440 |
-
NULL, NULL, NULL
|
| 441 |
-
|
| 442 |
-
Column Name: enroutetoarrivalhospdiffseconds
|
| 443 |
-
Description: The enroutetoarrivalhospdifftime expressed in seconds.
|
| 444 |
-
Data Type: int, NULL
|
| 445 |
-
Examples:
|
| 446 |
-
0, 0, 0
|
| 447 |
-
|
| 448 |
-
Column Name: arrivalscenetoarrivalhospdifftime
|
| 449 |
-
Description: The total duration from arrival on scene to arrival at the hospital (for patient transports). This field is largely NULL.
|
| 450 |
-
Data Type: nvarchar(255), NULL
|
| 451 |
-
Examples:
|
| 452 |
-
NULL, NULL, NULL
|
| 453 |
-
|
| 454 |
-
Column Name: arrivalscenetoarrivalhospdiffseconds
|
| 455 |
-
Description: The arrivalscenetoarrivalhospdifftime expressed in seconds.
|
| 456 |
-
Data Type: int, NULL
|
| 457 |
-
Examples:
|
| 458 |
-
0, 0, 0
|
| 459 |
-
|
| 460 |
-
Column Name: hospitalarrivaldatetime
|
| 461 |
-
Description: The combined date and time the apparatus arrived at the hospital.
|
| 462 |
-
Data Type: nvarchar(255), NULL
|
| 463 |
-
Examples:
|
| 464 |
-
00:00.0, 00:00.0, 00:00.0
|
| 465 |
-
|
| 466 |
-
Column Name: hospitalarrivaltime
|
| 467 |
-
Description: The time the apparatus arrived at the hospital.
|
| 468 |
-
Data Type: nvarchar(255), NULL
|
| 469 |
-
Examples:
|
| 470 |
-
, ,
|
| 471 |
-
|
| 472 |
-
Column Name: hospitalarrivaldate
|
| 473 |
-
Description: The date the apparatus arrived at the hospital.
|
| 474 |
-
Data Type: nvarchar(255), NULL
|
| 475 |
-
Examples:
|
| 476 |
-
NULL, NULL, NULL
|
| 477 |
-
|
| 478 |
-
Column Name: arrivalclearhospdifftime
|
| 479 |
-
Description: The duration between arrival at the hospital and the unit clearing (becoming available) from the hospital. This field is largely NULL.
|
| 480 |
-
Data Type: nvarchar(255), NULL
|
| 481 |
-
Examples:
|
| 482 |
-
NULL, NULL, NULL
|
| 483 |
-
|
| 484 |
-
Column Name: arrivalclearhospdiffseconds
|
| 485 |
-
Description: The arrivalclearhospdifftime expressed in seconds.
|
| 486 |
-
Data Type: int, NULL
|
| 487 |
-
Examples:
|
| 488 |
-
0, 0, 0
|
| 489 |
-
|
| 490 |
-
Column Name: cleardatetime
|
| 491 |
-
Description: The combined date and time the apparatus cleared the incident and became available for service.
|
| 492 |
-
Data Type: nvarchar(255), NULL
|
| 493 |
-
Examples:
|
| 494 |
-
16:17.0, 40:39.0, 41:06.0
|
| 495 |
-
|
| 496 |
-
Column Name: cleartime
|
| 497 |
-
Description: The time the apparatus cleared the incident, in a 24-hour format.
|
| 498 |
-
Data Type: nvarchar(255), NULL
|
| 499 |
-
Examples:
|
| 500 |
-
19:16:17, 19:40:39, 19:41:06
|
| 501 |
-
|
| 502 |
-
Column Name: cleardate
|
| 503 |
-
Description: The date the apparatus cleared the incident.
|
| 504 |
-
Data Type: nvarchar(255), NULL
|
| 505 |
-
Examples:
|
| 506 |
-
10/9/2015, 10/9/2015, 10/9/2015
|
| 507 |
-
|
| 508 |
-
Column Name: dispatchcleardifftime
|
| 509 |
-
Description: The total duration from initial dispatch to the unit clearing the incident. Formatted as HH:MM:SS.
|
| 510 |
-
Data Type: nvarchar(255), NULL
|
| 511 |
-
Examples:
|
| 512 |
-
0:07:46, 0:20:18, 0:01:50
|
| 513 |
|
| 514 |
Column Name: dispatchcleardiffseconds
|
| 515 |
-
Description:
|
| 516 |
-
Data Type: int, NULL
|
| 517 |
-
Examples:
|
| 518 |
-
466, 1218, 110
|
| 519 |
-
|
| 520 |
-
Column Name: inservicedatetime
|
| 521 |
-
Description: The combined date and time the unit was marked as "in service" or available at the start of their shift. This field is largely NULL or 00:00.0.
|
| 522 |
-
Data Type: nvarchar(255), NULL
|
| 523 |
-
Examples:
|
| 524 |
-
00:00.0, 00:00.0, 00:00.0
|
| 525 |
-
|
| 526 |
-
Column Name: inservicetime
|
| 527 |
-
Description: The time the unit was marked "in service".
|
| 528 |
-
Data Type: nvarchar(255), NULL
|
| 529 |
-
Examples:
|
| 530 |
-
, ,
|
| 531 |
-
|
| 532 |
-
Column Name: inservicedate
|
| 533 |
-
Description: The date the unit was marked "in service".
|
| 534 |
-
Data Type: nvarchar(255), NULL
|
| 535 |
-
Examples:
|
| 536 |
-
NULL, NULL, NULL
|
| 537 |
-
|
| 538 |
-
Column Name: emsruncode
|
| 539 |
-
Description: A code or identifier for an EMS (Emergency Medical Services) run, if applicable. The value "Not EMS Run" indicates this was not an EMS incident.
|
| 540 |
-
Data Type: nvarchar(255), NULL
|
| 541 |
-
Examples:
|
| 542 |
-
Not EMS Run, Not EMS Run, Not EMS Run
|
| 543 |
-
|
| 544 |
-
Column Name: emsrundescrip
|
| 545 |
-
Description: A description of the EMS run. This field is largely NULL.
|
| 546 |
-
Data Type: nvarchar(255), NULL
|
| 547 |
-
Examples:
|
| 548 |
-
NULL, NULL, NULL
|
| 549 |
-
|
| 550 |
-
Column Name: emsrunnumber
|
| 551 |
-
Description: A specific run number for the EMS call. This field is largely NULL.
|
| 552 |
-
Data Type: nvarchar(255), NULL
|
| 553 |
-
Examples:
|
| 554 |
-
NULL, NULL, NULL
|
| 555 |
-
|
| 556 |
-
Column Name: losapcode
|
| 557 |
-
Description: A code indicating LOSAP credit, similar to losapcreditcode.
|
| 558 |
Data Type: int, NULL
|
| 559 |
Examples:
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
Column Name: losapdescrip
|
| 563 |
-
Description: A description of the LOSAP credit, similar to losapcreditdescrip.
|
| 564 |
-
Data Type: nvarchar(255), NULL
|
| 565 |
-
Examples:
|
| 566 |
-
Losap Credit, Losap Credit, Losap Credit
|
| 567 |
-
|
| 568 |
-
Column Name: alarmscode
|
| 569 |
-
Description: A code indicating the alarm level or type for the incident. This field is largely NULL.
|
| 570 |
-
Data Type: int, NULL
|
| 571 |
-
Examples:
|
| 572 |
-
NULL, NULL, NULL
|
| 573 |
-
|
| 574 |
-
Column Name: alarmdescrip
|
| 575 |
-
Description: A description of the alarm level. This field is largely NULL.
|
| 576 |
-
Data Type: nvarchar(255), NULL
|
| 577 |
-
Examples:
|
| 578 |
-
NULL, NULL, NULL
|
| 579 |
-
|
| 580 |
-
Column Name: amount1 (duplicate)
|
| 581 |
-
Description: (Duplicate) Another instance of the generic amount1 field, likely for apparatus-level data. Predominantly NULL.
|
| 582 |
-
Data Type: float, NULL
|
| 583 |
-
Examples:
|
| 584 |
-
NULL, NULL, NULL
|
| 585 |
-
|
| 586 |
-
Column Name: amount2 (duplicate)
|
| 587 |
-
Description: (Duplicate) Another instance of the generic amount2 field, likely for apparatus-level data. Predominantly NULL.
|
| 588 |
-
Data Type: float, NULL
|
| 589 |
-
Examples:
|
| 590 |
-
NULL, NULL, NULL
|
| 591 |
-
|
| 592 |
-
Column Name: fdid_no
|
| 593 |
-
Description: The Fire Department ID number or identifier. This field is consistently NULL in the provided sample.
|
| 594 |
-
Data Type: nvarchar(255), NULL
|
| 595 |
-
Examples:
|
| 596 |
-
NULL, NULL, NULL
|
| 597 |
-
|
| 598 |
-
Column Name: stagingdatetime
|
| 599 |
-
Description: The combined date and time the apparatus went to a staging area. This field is largely NULL or 00:00.0.
|
| 600 |
-
Data Type: nvarchar(255), NULL
|
| 601 |
-
Examples:
|
| 602 |
-
00:00.0, 00:00.0, 00:00.0
|
| 603 |
-
|
| 604 |
-
Column Name: stagingtime
|
| 605 |
-
Description: The time the apparatus went to a staging area.
|
| 606 |
-
Data Type: nvarchar(255), NULL
|
| 607 |
-
Examples:
|
| 608 |
-
, ,
|
| 609 |
-
|
| 610 |
-
Column Name: stagingdate
|
| 611 |
-
Description: The date the apparatus went to a staging area.
|
| 612 |
-
Data Type: nvarchar(255), NULL
|
| 613 |
-
Examples:
|
| 614 |
-
NULL, NULL, NULL
|
| 615 |
-
|
| 616 |
-
Column Name: AtPatientSideDateTime
|
| 617 |
-
Description: The combined date and time the personnel arrived at the patient's side (for EMS incidents). This field is largely NULL or 00:00.0.
|
| 618 |
-
Data Type: nvarchar(255), NULL
|
| 619 |
-
Examples:
|
| 620 |
-
00:00.0, 00:00.0, 00:00.0
|
| 621 |
-
|
| 622 |
-
Column Name: AtPatientSideTime
|
| 623 |
-
Description: The time the personnel arrived at the patient's side.
|
| 624 |
-
Data Type: nvarchar(255), NULL
|
| 625 |
-
Examples:
|
| 626 |
-
, ,
|
| 627 |
-
|
| 628 |
-
Column Name: AtPatientSideDate
|
| 629 |
-
Description: The date the personnel arrived at the patient's side.
|
| 630 |
-
Data Type: nvarchar(255), NULL
|
| 631 |
-
Examples:
|
| 632 |
-
NULL, NULL, NULL
|
| 633 |
-
|
| 634 |
-
Column Name: FacilityDateTime
|
| 635 |
-
Description: The combined date and time the personnel arrived at a medical facility. This field is largely NULL or 00:00.0.
|
| 636 |
-
Data Type: nvarchar(255), NULL
|
| 637 |
-
Examples:
|
| 638 |
-
00:00.0, 00:00.0, 00:00.0
|
| 639 |
-
|
| 640 |
-
Column Name: FacilityTime
|
| 641 |
-
Description: The time the personnel arrived at a medical facility.
|
| 642 |
-
Data Type: nvarchar(255), NULL
|
| 643 |
-
Examples:
|
| 644 |
-
, ,
|
| 645 |
-
|
| 646 |
-
Column Name: FacilityDate
|
| 647 |
-
Description: The date the personnel arrived at a medical facility.
|
| 648 |
-
Data Type: nvarchar(255), NULL
|
| 649 |
-
Examples:
|
| 650 |
-
NULL, NULL, NULL
|
| 651 |
-
|
| 652 |
-
Column Name: changedate
|
| 653 |
-
Description: The date and time the record was last updated or changed. The format appears to be a floating-point number representing time, possibly the number of minutes or seconds after a reference point.
|
| 654 |
-
Data Type: float, NULL
|
| 655 |
-
Examples:
|
| 656 |
-
17:39.0, 42:11.5, 48:24.5
|
|
|
|
| 1 |
+
Column Name: personnelkey
|
| 2 |
+
Description: Unique system-generated identifier for the personnel record associated with an incident. This serves as the primary key for the incident_personnel table and uniquely identifies a responder assigned to a specific incident.
|
| 3 |
Data Type: char(14), NOT NULL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
Examples:
|
| 5 |
+
_4GR15265W_SMS, _4GR15HZF7_SMS
|
| 6 |
+
|
| 7 |
|
| 8 |
Column Name: namefirst
|
| 9 |
+
Description: The first name of the firefighter or personnel involved in the incident. The value may include trailing spaces because it is stored as a fixed-length field.
|
| 10 |
Data Type: char(25), NOT NULL
|
| 11 |
Examples:
|
| 12 |
Dale, Brandon, Kyle
|
| 13 |
|
| 14 |
+
|
| 15 |
Column Name: namemi
|
| 16 |
+
Description: The middle initial of the firefighter or personnel. This field may contain a single character or may be empty.
|
| 17 |
Data Type: char(2), NULL
|
| 18 |
Examples:
|
| 19 |
E, A, S
|
| 20 |
|
| 21 |
+
|
| 22 |
Column Name: namelast
|
| 23 |
+
Description: The last name of the firefighter or personnel assigned to the incident.
|
| 24 |
Data Type: char(25), NOT NULL
|
| 25 |
Examples:
|
| 26 |
Bryan, Davis, Coles
|
| 27 |
|
| 28 |
+
|
| 29 |
Column Name: namesuffix
|
| 30 |
+
Description: Optional suffix associated with the personnel name such as Jr., Sr., or III.
|
| 31 |
Data Type: char(5), NULL
|
| 32 |
Examples:
|
| 33 |
+
Jr, Sr, III
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
Column Name: rank
|
| 37 |
+
Description: Rank or title of the firefighter or personnel such as Captain, Firefighter, or Engineer. This identifies the personnel's role or seniority in the department.
|
| 38 |
Data Type: char(10), NOT NULL
|
| 39 |
Examples:
|
| 40 |
CAPT, FF, ENG
|
| 41 |
|
| 42 |
+
|
| 43 |
Column Name: actiontaken1code
|
| 44 |
+
Description: Code representing the primary action taken by the personnel during the incident. This usually references a predefined action code list.
|
| 45 |
Data Type: int, NULL
|
| 46 |
Examples:
|
| 47 |
NULL, NULL, 93
|
| 48 |
|
| 49 |
+
|
| 50 |
Column Name: actiontaken1descip
|
| 51 |
+
Description: Human-readable description corresponding to the primary action code. It explains the action performed by the personnel.
|
| 52 |
Data Type: varchar(50), NULL
|
| 53 |
Examples:
|
| 54 |
NULL, NULL, Cancelled en route
|
| 55 |
|
| 56 |
+
|
| 57 |
Column Name: actiontaken2code
|
| 58 |
+
Description: Code representing a secondary action taken by the personnel during the incident.
|
| 59 |
Data Type: int, NULL
|
| 60 |
Examples:
|
| 61 |
NULL, NULL, NULL
|
| 62 |
|
| 63 |
+
|
| 64 |
Column Name: actiontaken2descip
|
| 65 |
+
Description: Textual description corresponding to the secondary action code.
|
| 66 |
Data Type: varchar(50), NULL
|
| 67 |
Examples:
|
| 68 |
NULL, NULL, NULL
|
| 69 |
|
| 70 |
+
|
| 71 |
Column Name: actiontaken3code
|
| 72 |
+
Description: Code representing a tertiary action taken by the personnel during the incident.
|
| 73 |
Data Type: int, NULL
|
| 74 |
Examples:
|
| 75 |
NULL, NULL, NULL
|
| 76 |
|
| 77 |
+
|
| 78 |
Column Name: actiontaken3descip
|
| 79 |
+
Description: Textual description corresponding to the tertiary action code.
|
| 80 |
Data Type: varchar(50), NULL
|
| 81 |
Examples:
|
| 82 |
NULL, NULL, NULL
|
| 83 |
|
| 84 |
+
|
| 85 |
Column Name: actiontaken4code
|
| 86 |
+
Description: Code representing a fourth action taken by the personnel during the incident.
|
| 87 |
Data Type: int, NULL
|
| 88 |
Examples:
|
| 89 |
NULL, NULL, NULL
|
| 90 |
|
| 91 |
+
|
| 92 |
Column Name: actiontaken4descip
|
| 93 |
+
Description: Textual description corresponding to the fourth action code.
|
| 94 |
Data Type: varchar(50), NULL
|
| 95 |
Examples:
|
| 96 |
NULL, NULL, NULL
|
| 97 |
|
| 98 |
+
|
| 99 |
Column Name: amount1
|
| 100 |
+
Description: Generic numeric field used for additional reporting metrics related to personnel participation in the incident.
|
| 101 |
Data Type: float, NULL
|
| 102 |
Examples:
|
| 103 |
NULL, NULL, NULL
|
| 104 |
|
| 105 |
+
|
| 106 |
Column Name: amount2
|
| 107 |
+
Description: Secondary generic numeric field used for additional measurements or reporting metrics.
|
| 108 |
Data Type: float, NULL
|
| 109 |
Examples:
|
| 110 |
NULL, NULL, NULL
|
| 111 |
|
| 112 |
+
|
| 113 |
Column Name: crole
|
| 114 |
+
Description: Numeric code indicating the operational role of the personnel during the incident or apparatus assignment, such as officer, driver, or firefighter.
|
| 115 |
Data Type: int, NULL
|
| 116 |
Examples:
|
| 117 |
NULL, NULL, NULL
|
| 118 |
|
| 119 |
+
|
| 120 |
Column Name: losapcreditcode
|
| 121 |
+
Description: Numeric code indicating whether the personnel received LOSAP (Length of Service Award Program) credit for their participation in the incident.
|
| 122 |
Data Type: int, NULL
|
| 123 |
Examples:
|
| 124 |
1, 1, 1
|
| 125 |
|
| 126 |
+
|
| 127 |
Column Name: losapcreditdescrip
|
| 128 |
+
Description: Textual description corresponding to the LOSAP credit code indicating credit eligibility.
|
| 129 |
Data Type: varchar(50), NULL
|
| 130 |
Examples:
|
| 131 |
Losap Credit, Losap Credit, Losap Credit
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
Column Name: apparatusid
|
| 135 |
+
Description: Human-readable identifier or unit number for the apparatus the personnel was assigned to during the incident.
|
| 136 |
Data Type: char(10), NOT NULL
|
| 137 |
Examples:
|
| 138 |
BE7, BE6, BE3
|
| 139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
Column Name: numberofresponders
|
| 142 |
+
Description: The total number of personnel who responded on the associated apparatus to the incident.
|
| 143 |
Data Type: int, NOT NULL
|
| 144 |
Examples:
|
| 145 |
3, 3, 3
|
| 146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
Column Name: responsetimeseconds
|
| 149 |
+
Description: Total response time from dispatch to arrival on the scene expressed in seconds. This is an important operational performance metric.
|
| 150 |
Data Type: int, NULL
|
| 151 |
Examples:
|
| 152 |
159, 292, 0
|
| 153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
Column Name: dispatchcleardiffseconds
|
| 156 |
+
Description: Total duration from dispatch until the apparatus cleared the incident and became available again, expressed in seconds.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
Data Type: int, NULL
|
| 158 |
Examples:
|
| 159 |
+
466, 1218, 110
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
poetry.lock
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# This file is automatically @generated by Poetry 2.3.
|
| 2 |
|
| 3 |
[[package]]
|
| 4 |
name = "aiosqlite"
|
|
@@ -1903,6 +1903,95 @@ files = [
|
|
| 1903 |
{file = "packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4"},
|
| 1904 |
]
|
| 1905 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1906 |
[[package]]
|
| 1907 |
name = "protobuf"
|
| 1908 |
version = "6.33.5"
|
|
@@ -3057,6 +3146,19 @@ files = [
|
|
| 3057 |
[package.dependencies]
|
| 3058 |
typing-extensions = ">=4.12.0"
|
| 3059 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3060 |
[[package]]
|
| 3061 |
name = "urllib3"
|
| 3062 |
version = "2.6.3"
|
|
@@ -3415,4 +3517,4 @@ type = ["pytest-mypy"]
|
|
| 3415 |
[metadata]
|
| 3416 |
lock-version = "2.1"
|
| 3417 |
python-versions = "3.12.*"
|
| 3418 |
-
content-hash = "
|
|
|
|
| 1 |
+
# This file is automatically @generated by Poetry 2.3.1 and should not be changed by hand.
|
| 2 |
|
| 3 |
[[package]]
|
| 4 |
name = "aiosqlite"
|
|
|
|
| 1903 |
{file = "packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4"},
|
| 1904 |
]
|
| 1905 |
|
| 1906 |
+
[[package]]
|
| 1907 |
+
name = "pandas"
|
| 1908 |
+
version = "3.0.1"
|
| 1909 |
+
description = "Powerful data structures for data analysis, time series, and statistics"
|
| 1910 |
+
optional = false
|
| 1911 |
+
python-versions = ">=3.11"
|
| 1912 |
+
groups = ["main"]
|
| 1913 |
+
files = [
|
| 1914 |
+
{file = "pandas-3.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:de09668c1bf3b925c07e5762291602f0d789eca1b3a781f99c1c78f6cac0e7ea"},
|
| 1915 |
+
{file = "pandas-3.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:24ba315ba3d6e5806063ac6eb717504e499ce30bd8c236d8693a5fd3f084c796"},
|
| 1916 |
+
{file = "pandas-3.0.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:406ce835c55bac912f2a0dcfaf27c06d73c6b04a5dde45f1fd3169ce31337389"},
|
| 1917 |
+
{file = "pandas-3.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:830994d7e1f31dd7e790045235605ab61cff6c94defc774547e8b7fdfbff3dc7"},
|
| 1918 |
+
{file = "pandas-3.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:a64ce8b0f2de1d2efd2ae40b0abe7f8ae6b29fbfb3812098ed5a6f8e235ad9bf"},
|
| 1919 |
+
{file = "pandas-3.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9832c2c69da24b602c32e0c7b1b508a03949c18ba08d4d9f1c1033426685b447"},
|
| 1920 |
+
{file = "pandas-3.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:84f0904a69e7365f79a0c77d3cdfccbfb05bf87847e3a51a41e1426b0edb9c79"},
|
| 1921 |
+
{file = "pandas-3.0.1-cp311-cp311-win_arm64.whl", hash = "sha256:4a68773d5a778afb31d12e34f7dd4612ab90de8c6fb1d8ffe5d4a03b955082a1"},
|
| 1922 |
+
{file = "pandas-3.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:476f84f8c20c9f5bc47252b66b4bb25e1a9fc2fa98cead96744d8116cb85771d"},
|
| 1923 |
+
{file = "pandas-3.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0ab749dfba921edf641d4036c4c21c0b3ea70fea478165cb98a998fb2a261955"},
|
| 1924 |
+
{file = "pandas-3.0.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b8e36891080b87823aff3640c78649b91b8ff6eea3c0d70aeabd72ea43ab069b"},
|
| 1925 |
+
{file = "pandas-3.0.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:532527a701281b9dd371e2f582ed9094f4c12dd9ffb82c0c54ee28d8ac9520c4"},
|
| 1926 |
+
{file = "pandas-3.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:356e5c055ed9b0da1580d465657bc7d00635af4fd47f30afb23025352ba764d1"},
|
| 1927 |
+
{file = "pandas-3.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9d810036895f9ad6345b8f2a338dd6998a74e8483847403582cab67745bff821"},
|
| 1928 |
+
{file = "pandas-3.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:536232a5fe26dd989bd633e7a0c450705fdc86a207fec7254a55e9a22950fe43"},
|
| 1929 |
+
{file = "pandas-3.0.1-cp312-cp312-win_arm64.whl", hash = "sha256:0f463ebfd8de7f326d38037c7363c6dacb857c5881ab8961fb387804d6daf2f7"},
|
| 1930 |
+
{file = "pandas-3.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5272627187b5d9c20e55d27caf5f2cd23e286aba25cadf73c8590e432e2b7262"},
|
| 1931 |
+
{file = "pandas-3.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:661e0f665932af88c7877f31da0dc743fe9c8f2524bdffe23d24fdcb67ef9d56"},
|
| 1932 |
+
{file = "pandas-3.0.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:75e6e292ff898679e47a2199172593d9f6107fd2dd3617c22c2946e97d5df46e"},
|
| 1933 |
+
{file = "pandas-3.0.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1ff8cf1d2896e34343197685f432450ec99a85ba8d90cce2030c5eee2ef98791"},
|
| 1934 |
+
{file = "pandas-3.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:eca8b4510f6763f3d37359c2105df03a7a221a508f30e396a51d0713d462e68a"},
|
| 1935 |
+
{file = "pandas-3.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:06aff2ad6f0b94a17822cf8b83bbb563b090ed82ff4fe7712db2ce57cd50d9b8"},
|
| 1936 |
+
{file = "pandas-3.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:9fea306c783e28884c29057a1d9baa11a349bbf99538ec1da44c8476563d1b25"},
|
| 1937 |
+
{file = "pandas-3.0.1-cp313-cp313-win_arm64.whl", hash = "sha256:a8d37a43c52917427e897cb2e429f67a449327394396a81034a4449b99afda59"},
|
| 1938 |
+
{file = "pandas-3.0.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:d54855f04f8246ed7b6fc96b05d4871591143c46c0b6f4af874764ed0d2d6f06"},
|
| 1939 |
+
{file = "pandas-3.0.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4e1b677accee34a09e0dc2ce5624e4a58a1870ffe56fc021e9caf7f23cd7668f"},
|
| 1940 |
+
{file = "pandas-3.0.1-cp313-cp313t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a9cabbdcd03f1b6cd254d6dda8ae09b0252524be1592594c00b7895916cb1324"},
|
| 1941 |
+
{file = "pandas-3.0.1-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5ae2ab1f166668b41e770650101e7090824fd34d17915dd9cd479f5c5e0065e9"},
|
| 1942 |
+
{file = "pandas-3.0.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6bf0603c2e30e2cafac32807b06435f28741135cb8697eae8b28c7d492fc7d76"},
|
| 1943 |
+
{file = "pandas-3.0.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6c426422973973cae1f4a23e51d4ae85974f44871b24844e4f7de752dd877098"},
|
| 1944 |
+
{file = "pandas-3.0.1-cp313-cp313t-win_amd64.whl", hash = "sha256:b03f91ae8c10a85c1613102c7bef5229b5379f343030a3ccefeca8a33414cf35"},
|
| 1945 |
+
{file = "pandas-3.0.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:99d0f92ed92d3083d140bf6b97774f9f13863924cf3f52a70711f4e7588f9d0a"},
|
| 1946 |
+
{file = "pandas-3.0.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:3b66857e983208654294bb6477b8a63dee26b37bdd0eb34d010556e91261784f"},
|
| 1947 |
+
{file = "pandas-3.0.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:56cf59638bf24dc9bdf2154c81e248b3289f9a09a6d04e63608c159022352749"},
|
| 1948 |
+
{file = "pandas-3.0.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c1a9f55e0f46951874b863d1f3906dcb57df2d9be5c5847ba4dfb55b2c815249"},
|
| 1949 |
+
{file = "pandas-3.0.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:1849f0bba9c8a2fb0f691d492b834cc8dadf617e29015c66e989448d58d011ee"},
|
| 1950 |
+
{file = "pandas-3.0.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:c3d288439e11b5325b02ae6e9cc83e6805a62c40c5a6220bea9beb899c073b1c"},
|
| 1951 |
+
{file = "pandas-3.0.1-cp314-cp314-win_amd64.whl", hash = "sha256:93325b0fe372d192965f4cca88d97667f49557398bbf94abdda3bf1b591dbe66"},
|
| 1952 |
+
{file = "pandas-3.0.1-cp314-cp314-win_arm64.whl", hash = "sha256:97ca08674e3287c7148f4858b01136f8bdfe7202ad25ad04fec602dd1d29d132"},
|
| 1953 |
+
{file = "pandas-3.0.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:58eeb1b2e0fb322befcf2bbc9ba0af41e616abadb3d3414a6bc7167f6cbfce32"},
|
| 1954 |
+
{file = "pandas-3.0.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:cd9af1276b5ca9e298bd79a26bda32fa9cc87ed095b2a9a60978d2ca058eaf87"},
|
| 1955 |
+
{file = "pandas-3.0.1-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:94f87a04984d6b63788327cd9f79dda62b7f9043909d2440ceccf709249ca988"},
|
| 1956 |
+
{file = "pandas-3.0.1-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:85fe4c4df62e1e20f9db6ebfb88c844b092c22cd5324bdcf94bfa2fc1b391221"},
|
| 1957 |
+
{file = "pandas-3.0.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:331ca75a2f8672c365ae25c0b29e46f5ac0c6551fdace8eec4cd65e4fac271ff"},
|
| 1958 |
+
{file = "pandas-3.0.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:15860b1fdb1973fffade772fdb931ccf9b2f400a3f5665aef94a00445d7d8dd5"},
|
| 1959 |
+
{file = "pandas-3.0.1-cp314-cp314t-win_amd64.whl", hash = "sha256:44f1364411d5670efa692b146c748f4ed013df91ee91e9bec5677fb1fd58b937"},
|
| 1960 |
+
{file = "pandas-3.0.1-cp314-cp314t-win_arm64.whl", hash = "sha256:108dd1790337a494aa80e38def654ca3f0968cf4f362c85f44c15e471667102d"},
|
| 1961 |
+
{file = "pandas-3.0.1.tar.gz", hash = "sha256:4186a699674af418f655dbd420ed87f50d56b4cd6603784279d9eef6627823c8"},
|
| 1962 |
+
]
|
| 1963 |
+
|
| 1964 |
+
[package.dependencies]
|
| 1965 |
+
numpy = {version = ">=1.26.0", markers = "python_version < \"3.14\""}
|
| 1966 |
+
python-dateutil = ">=2.8.2"
|
| 1967 |
+
tzdata = {version = "*", markers = "sys_platform == \"win32\" or sys_platform == \"emscripten\""}
|
| 1968 |
+
|
| 1969 |
+
[package.extras]
|
| 1970 |
+
all = ["PyQt5 (>=5.15.9)", "SQLAlchemy (>=2.0.36)", "adbc-driver-postgresql (>=1.2.0)", "adbc-driver-sqlite (>=1.2.0)", "beautifulsoup4 (>=4.12.3)", "bottleneck (>=1.4.2)", "fastparquet (>=2024.11.0)", "fsspec (>=2024.10.0)", "gcsfs (>=2024.10.0)", "html5lib (>=1.1)", "hypothesis (>=6.116.0)", "jinja2 (>=3.1.5)", "lxml (>=5.3.0)", "matplotlib (>=3.9.3)", "numba (>=0.60.0)", "numexpr (>=2.10.2)", "odfpy (>=1.4.1)", "openpyxl (>=3.1.5)", "psycopg2 (>=2.9.10)", "pyarrow (>=13.0.0)", "pyiceberg (>=0.8.1)", "pymysql (>=1.1.1)", "pyreadstat (>=1.2.8)", "pytest (>=8.3.4)", "pytest-xdist (>=3.6.1)", "python-calamine (>=0.3.0)", "pytz (>=2024.2)", "pyxlsb (>=1.0.10)", "qtpy (>=2.4.2)", "s3fs (>=2024.10.0)", "scipy (>=1.14.1)", "tables (>=3.10.1)", "tabulate (>=0.9.0)", "xarray (>=2024.10.0)", "xlrd (>=2.0.1)", "xlsxwriter (>=3.2.0)", "zstandard (>=0.23.0)"]
|
| 1971 |
+
aws = ["s3fs (>=2024.10.0)"]
|
| 1972 |
+
clipboard = ["PyQt5 (>=5.15.9)", "qtpy (>=2.4.2)"]
|
| 1973 |
+
compression = ["zstandard (>=0.23.0)"]
|
| 1974 |
+
computation = ["scipy (>=1.14.1)", "xarray (>=2024.10.0)"]
|
| 1975 |
+
excel = ["odfpy (>=1.4.1)", "openpyxl (>=3.1.5)", "python-calamine (>=0.3.0)", "pyxlsb (>=1.0.10)", "xlrd (>=2.0.1)", "xlsxwriter (>=3.2.0)"]
|
| 1976 |
+
feather = ["pyarrow (>=13.0.0)"]
|
| 1977 |
+
fss = ["fsspec (>=2024.10.0)"]
|
| 1978 |
+
gcp = ["gcsfs (>=2024.10.0)"]
|
| 1979 |
+
hdf5 = ["tables (>=3.10.1)"]
|
| 1980 |
+
html = ["beautifulsoup4 (>=4.12.3)", "html5lib (>=1.1)", "lxml (>=5.3.0)"]
|
| 1981 |
+
iceberg = ["pyiceberg (>=0.8.1)"]
|
| 1982 |
+
mysql = ["SQLAlchemy (>=2.0.36)", "pymysql (>=1.1.1)"]
|
| 1983 |
+
output-formatting = ["jinja2 (>=3.1.5)", "tabulate (>=0.9.0)"]
|
| 1984 |
+
parquet = ["pyarrow (>=13.0.0)"]
|
| 1985 |
+
performance = ["bottleneck (>=1.4.2)", "numba (>=0.60.0)", "numexpr (>=2.10.2)"]
|
| 1986 |
+
plot = ["matplotlib (>=3.9.3)"]
|
| 1987 |
+
postgresql = ["SQLAlchemy (>=2.0.36)", "adbc-driver-postgresql (>=1.2.0)", "psycopg2 (>=2.9.10)"]
|
| 1988 |
+
pyarrow = ["pyarrow (>=13.0.0)"]
|
| 1989 |
+
spss = ["pyreadstat (>=1.2.8)"]
|
| 1990 |
+
sql-other = ["SQLAlchemy (>=2.0.36)", "adbc-driver-postgresql (>=1.2.0)", "adbc-driver-sqlite (>=1.2.0)"]
|
| 1991 |
+
test = ["hypothesis (>=6.116.0)", "pytest (>=8.3.4)", "pytest-xdist (>=3.6.1)"]
|
| 1992 |
+
timezone = ["pytz (>=2024.2)"]
|
| 1993 |
+
xml = ["lxml (>=5.3.0)"]
|
| 1994 |
+
|
| 1995 |
[[package]]
|
| 1996 |
name = "protobuf"
|
| 1997 |
version = "6.33.5"
|
|
|
|
| 3146 |
[package.dependencies]
|
| 3147 |
typing-extensions = ">=4.12.0"
|
| 3148 |
|
| 3149 |
+
[[package]]
|
| 3150 |
+
name = "tzdata"
|
| 3151 |
+
version = "2025.3"
|
| 3152 |
+
description = "Provider of IANA time zone data"
|
| 3153 |
+
optional = false
|
| 3154 |
+
python-versions = ">=2"
|
| 3155 |
+
groups = ["main"]
|
| 3156 |
+
markers = "sys_platform == \"win32\" or sys_platform == \"emscripten\""
|
| 3157 |
+
files = [
|
| 3158 |
+
{file = "tzdata-2025.3-py2.py3-none-any.whl", hash = "sha256:06a47e5700f3081aab02b2e513160914ff0694bce9947d6b76ebd6bf57cfc5d1"},
|
| 3159 |
+
{file = "tzdata-2025.3.tar.gz", hash = "sha256:de39c2ca5dc7b0344f2eba86f49d614019d29f060fc4ebc8a417896a620b56a7"},
|
| 3160 |
+
]
|
| 3161 |
+
|
| 3162 |
[[package]]
|
| 3163 |
name = "urllib3"
|
| 3164 |
version = "2.6.3"
|
|
|
|
| 3517 |
[metadata]
|
| 3518 |
lock-version = "2.1"
|
| 3519 |
python-versions = "3.12.*"
|
| 3520 |
+
content-hash = "71ae3966704d36786fc8db92b5c592b9b92682cf7d3cc913039a86ced4b02b18"
|
src/entities/apparatus/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from _model import *
|
| 2 |
+
from _schema import *
|
src/entities/apparatus/_model.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import Column, String, Integer, Boolean, DateTime, Text, Numeric, ForeignKey
|
| 2 |
+
from sqlalchemy.orm import relationship
|
| 3 |
+
from base import BaseModel_
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class ApparatusModel(BaseModel_):
|
| 7 |
+
__tablename__ = "apparatus"
|
| 8 |
+
|
| 9 |
+
apparatuskey = Column(String(14), primary_key=True, index=True)
|
| 10 |
+
incidentkey = Column(String(14), ForeignKey("incident.incidentkey"))
|
| 11 |
+
apsid = Column(String(14), nullable=True)
|
| 12 |
+
apparatusid = Column(String(8), nullable=True)
|
| 13 |
+
priorityresponseflag = Column(Boolean, nullable=True)
|
| 14 |
+
arrivaldate = Column(DateTime, nullable=True)
|
| 15 |
+
scenedate = Column(DateTime, nullable=True)
|
| 16 |
+
enroutedate = Column(DateTime, nullable=True)
|
| 17 |
+
facilitydate = Column(DateTime, nullable=True)
|
| 18 |
+
cleardate = Column(DateTime, nullable=True)
|
| 19 |
+
dispatchdate = Column(DateTime, nullable=True)
|
| 20 |
+
inservicedate = Column(DateTime, nullable=True)
|
| 21 |
+
cancelledenrouteflag = Column(Boolean, nullable=True)
|
| 22 |
+
numberpeople = Column(Integer, nullable=True)
|
| 23 |
+
usecode = Column(String(4), nullable=True)
|
| 24 |
+
actiontaken1 = Column(String(4), nullable=True)
|
| 25 |
+
actiontaken2 = Column(String(4), nullable=True)
|
| 26 |
+
actiontaken3 = Column(String(4), nullable=True)
|
| 27 |
+
actiontaken4 = Column(String(4), nullable=True)
|
| 28 |
+
apparatustype = Column(String(4), nullable=True)
|
| 29 |
+
amount1 = Column(Numeric(10, 2), nullable=True)
|
| 30 |
+
amount2 = Column(Numeric(10, 2), nullable=True)
|
| 31 |
+
otherinfo = Column(String(20), nullable=True)
|
| 32 |
+
logcomments = Column(Text, nullable=True)
|
| 33 |
+
fdid_no = Column(String(20), nullable=True)
|
| 34 |
+
paramedicdispatch = Column(String(6), nullable=True)
|
| 35 |
+
firstarrivingunit = Column(Boolean, nullable=True)
|
| 36 |
+
inservicetime = Column(DateTime, nullable=True)
|
| 37 |
+
respondfromquarters = Column(Boolean, nullable=True)
|
| 38 |
+
changedate = Column(DateTime, nullable=True)
|
| 39 |
+
rowguid = Column(String(36), nullable=False)
|
| 40 |
+
hydrant_idnumber = Column(String(20), nullable=True)
|
| 41 |
+
hydrant_location = Column(String(116), nullable=True)
|
| 42 |
+
alarms = Column(String(10), nullable=True)
|
| 43 |
+
llosap_credit = Column(Boolean, nullable=True)
|
| 44 |
+
emsrun = Column(Boolean, nullable=True)
|
| 45 |
+
emsrunnumber = Column(String(14), nullable=True)
|
| 46 |
+
lprocessepcr = Column(Boolean, nullable=True)
|
| 47 |
+
nepcrrun = Column(Integer, nullable=True)
|
| 48 |
+
stagingdate = Column(DateTime, nullable=True)
|
| 49 |
+
isepcr = Column(Boolean, nullable=True)
|
| 50 |
+
unit_exc = Column(String(10), nullable=True)
|
| 51 |
+
aedtype = Column(String(10), nullable=True)
|
| 52 |
+
odometeronscene = Column(Numeric(12, 2), nullable=True)
|
| 53 |
+
odometerdestination = Column(Numeric(12, 2), nullable=True)
|
| 54 |
+
mileagetransport = Column(Numeric(12, 2), nullable=True)
|
| 55 |
+
atpatientsidetime = Column(DateTime, nullable=True)
|
| 56 |
+
aerialdeviceused = Column(Integer, nullable=True)
|
| 57 |
+
gmtoffset = Column(String(6), nullable=True)
|
| 58 |
+
firsteffectiveunit = Column(Integer, nullable=True)
|
| 59 |
+
lnfirsexported = Column(Boolean, nullable=True)
|
| 60 |
+
nfirsexporteddate = Column(DateTime, nullable=True)
|
| 61 |
+
infirssequence = Column(Integer, nullable=True)
|
| 62 |
+
nfirsttransactiontype = Column(String(1), nullable=True)
|
| 63 |
+
hydrant_used = Column(Integer, nullable=True)
|
| 64 |
+
defaultdispatchcode = Column(String(25), nullable=True)
|
| 65 |
+
responsetime = Column(String(20), nullable=True)
|
| 66 |
+
turntime = Column(String(20), nullable=True)
|
| 67 |
+
|
| 68 |
+
incident = relationship("Incident", back_populates="apparatus")
|
src/entities/apparatus/_schema.py
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import Field
|
| 2 |
+
from datetime import datetime
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from decimal import Decimal
|
| 5 |
+
from base import BaseSchema
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class ApparatusSchema(BaseSchema):
|
| 9 |
+
|
| 10 |
+
apparatuskey: str = Field(
|
| 11 |
+
...,
|
| 12 |
+
description="Primary key for the apparatus table. Unique 14-character identifier representing a specific apparatus response to an incident.",
|
| 13 |
+
example="_4GR15265W_SMS"
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
incidentkey: Optional[str] = Field(
|
| 17 |
+
...,
|
| 18 |
+
description="Foreign key linking this apparatus response to the incident table.",
|
| 19 |
+
example="_4GR15262U_SMS"
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
apsid: Optional[str] = Field(
|
| 23 |
+
...,
|
| 24 |
+
description="System-generated identifier used internally for apparatus personnel or assignment records.",
|
| 25 |
+
example="_APS123456789"
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
apparatusid: Optional[str] = Field(
|
| 29 |
+
...,
|
| 30 |
+
description="Human-readable apparatus or unit identifier used in dispatch and radio communication.",
|
| 31 |
+
example="BE7"
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
priorityresponseflag: Optional[bool] = Field(
|
| 35 |
+
...,
|
| 36 |
+
description="Indicates whether the apparatus responded with priority (lights and sirens)."
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
arrivaldate: Optional[datetime] = Field(
|
| 40 |
+
...,
|
| 41 |
+
description="Date and time when the apparatus arrived at the incident scene."
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
scenedate: Optional[datetime] = Field(
|
| 45 |
+
...,
|
| 46 |
+
description="Date and time when the apparatus officially reached the scene location."
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
enroutedate: Optional[datetime] = Field(
|
| 50 |
+
...,
|
| 51 |
+
description="Date and time when the apparatus began traveling to the incident after dispatch."
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
facilitydate: Optional[datetime] = Field(
|
| 55 |
+
...,
|
| 56 |
+
description="Date and time when the apparatus arrived at a medical facility with a patient (EMS incidents)."
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
cleardate: Optional[datetime] = Field(
|
| 60 |
+
...,
|
| 61 |
+
description="Date and time when the apparatus cleared the incident and became available for another response."
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
dispatchdate: Optional[datetime] = Field(
|
| 65 |
+
...,
|
| 66 |
+
description="Date and time when the apparatus was dispatched to the incident."
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
inservicedate: Optional[datetime] = Field(
|
| 70 |
+
...,
|
| 71 |
+
description="Date and time when the apparatus returned to service after completing the incident."
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
cancelledenrouteflag: Optional[bool] = Field(
|
| 75 |
+
...,
|
| 76 |
+
description="Indicates whether the apparatus was cancelled while en route to the incident."
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
numberpeople: Optional[int] = Field(
|
| 80 |
+
...,
|
| 81 |
+
description="Total number of personnel assigned to this apparatus during the incident."
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
+
usecode: Optional[str] = Field(
|
| 85 |
+
...,
|
| 86 |
+
description="NFIRS code identifying how the apparatus was used in the incident response."
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
actiontaken1: Optional[str] = Field(
|
| 90 |
+
...,
|
| 91 |
+
description="NFIRS code representing the primary action taken by the apparatus."
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
+
actiontaken2: Optional[str] = Field(
|
| 95 |
+
...,
|
| 96 |
+
description="NFIRS code representing the secondary action taken."
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
actiontaken3: Optional[str] = Field(
|
| 100 |
+
...,
|
| 101 |
+
description="NFIRS code representing the tertiary action taken."
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
actiontaken4: Optional[str] = Field(
|
| 105 |
+
...,
|
| 106 |
+
description="NFIRS code representing the fourth action taken during the incident."
|
| 107 |
+
)
|
| 108 |
+
|
| 109 |
+
apparatustype: Optional[str] = Field(
|
| 110 |
+
...,
|
| 111 |
+
description="NFIRS apparatus type code representing the type of responding vehicle."
|
| 112 |
+
)
|
| 113 |
+
|
| 114 |
+
amount1: Optional[Decimal] = Field(
|
| 115 |
+
...,
|
| 116 |
+
description="Monetary value associated with the apparatus response such as property loss or equipment value."
|
| 117 |
+
)
|
| 118 |
+
|
| 119 |
+
amount2: Optional[Decimal] = Field(
|
| 120 |
+
...,
|
| 121 |
+
description="Additional monetary value related to the incident such as property saved."
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
otherinfo: Optional[str] = Field(
|
| 125 |
+
...,
|
| 126 |
+
description="Additional miscellaneous information associated with the apparatus response."
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
+
logcomments: Optional[str] = Field(
|
| 130 |
+
...,
|
| 131 |
+
description="Free-text comments or operational notes recorded during the apparatus response."
|
| 132 |
+
)
|
| 133 |
+
|
| 134 |
+
fdid_no: Optional[str] = Field(
|
| 135 |
+
...,
|
| 136 |
+
description="Fire Department Identification Number (FDID) representing the department responsible for the incident."
|
| 137 |
+
)
|
| 138 |
+
|
| 139 |
+
paramedicdispatch: Optional[str] = Field(
|
| 140 |
+
...,
|
| 141 |
+
description="Indicator showing whether paramedics were dispatched with the apparatus."
|
| 142 |
+
)
|
| 143 |
+
|
| 144 |
+
firstarrivingunit: Optional[bool] = Field(
|
| 145 |
+
...,
|
| 146 |
+
description="Indicates whether this apparatus was the first unit to arrive on scene."
|
| 147 |
+
)
|
| 148 |
+
|
| 149 |
+
inservicetime: Optional[datetime] = Field(
|
| 150 |
+
...,
|
| 151 |
+
description="Time when the apparatus returned to service after completing the response."
|
| 152 |
+
)
|
| 153 |
+
|
| 154 |
+
respondfromquarters: Optional[bool] = Field(
|
| 155 |
+
...,
|
| 156 |
+
description="Indicates whether the apparatus responded directly from its station."
|
| 157 |
+
)
|
| 158 |
+
|
| 159 |
+
changedate: Optional[datetime] = Field(
|
| 160 |
+
...,
|
| 161 |
+
description="Timestamp representing when this record was last modified."
|
| 162 |
+
)
|
| 163 |
+
|
| 164 |
+
rowguid: str = Field(
|
| 165 |
+
...,
|
| 166 |
+
description="Globally unique identifier (GUID) used internally for replication or system-level identification."
|
| 167 |
+
)
|
| 168 |
+
|
| 169 |
+
hydrant_idnumber: Optional[str] = Field(
|
| 170 |
+
...,
|
| 171 |
+
description="Identifier of the fire hydrant used during the incident response."
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
hydrant_location: Optional[str] = Field(
|
| 175 |
+
...,
|
| 176 |
+
description="Location description of the hydrant used during the response."
|
| 177 |
+
)
|
| 178 |
+
|
| 179 |
+
alarms: Optional[str] = Field(
|
| 180 |
+
...,
|
| 181 |
+
description="Alarm level associated with the incident response."
|
| 182 |
+
)
|
| 183 |
+
|
| 184 |
+
llosap_credit: Optional[bool] = Field(
|
| 185 |
+
...,
|
| 186 |
+
description="Indicates whether LOSAP (Length of Service Award Program) credit was awarded."
|
| 187 |
+
)
|
| 188 |
+
|
| 189 |
+
emsrun: Optional[bool] = Field(
|
| 190 |
+
...,
|
| 191 |
+
description="Indicates whether this apparatus response was related to an EMS call."
|
| 192 |
+
)
|
| 193 |
+
|
| 194 |
+
emsrunnumber: Optional[str] = Field(
|
| 195 |
+
...,
|
| 196 |
+
description="Unique identifier associated with the EMS patient care report."
|
| 197 |
+
)
|
| 198 |
+
|
| 199 |
+
lprocessepcr: Optional[bool] = Field(
|
| 200 |
+
...,
|
| 201 |
+
description="Indicates whether an electronic patient care report (ePCR) was processed."
|
| 202 |
+
)
|
| 203 |
+
|
| 204 |
+
nepcrrun: Optional[int] = Field(
|
| 205 |
+
...,
|
| 206 |
+
description="Numeric identifier representing the ePCR run sequence."
|
| 207 |
+
)
|
| 208 |
+
|
| 209 |
+
stagingdate: Optional[datetime] = Field(
|
| 210 |
+
...,
|
| 211 |
+
description="Date and time when the apparatus entered a staging area during the incident."
|
| 212 |
+
)
|
| 213 |
+
|
| 214 |
+
isepcr: Optional[bool] = Field(
|
| 215 |
+
...,
|
| 216 |
+
description="Indicates whether this incident has an associated electronic patient care report."
|
| 217 |
+
)
|
| 218 |
+
|
| 219 |
+
unit_exc: Optional[str] = Field(
|
| 220 |
+
...,
|
| 221 |
+
description="Internal code used for apparatus unit exceptions or operational categories."
|
| 222 |
+
)
|
| 223 |
+
|
| 224 |
+
aedtype: Optional[str] = Field(
|
| 225 |
+
...,
|
| 226 |
+
description="Type of automated external defibrillator (AED) used during the response."
|
| 227 |
+
)
|
| 228 |
+
|
| 229 |
+
odometeronscene: Optional[Decimal] = Field(
|
| 230 |
+
...,
|
| 231 |
+
description="Vehicle odometer reading when arriving on scene."
|
| 232 |
+
)
|
| 233 |
+
|
| 234 |
+
odometerdestination: Optional[Decimal] = Field(
|
| 235 |
+
...,
|
| 236 |
+
description="Vehicle odometer reading when reaching the destination (hospital or facility)."
|
| 237 |
+
)
|
| 238 |
+
|
| 239 |
+
mileagetransport: Optional[Decimal] = Field(
|
| 240 |
+
...,
|
| 241 |
+
description="Mileage traveled while transporting a patient."
|
| 242 |
+
)
|
| 243 |
+
|
| 244 |
+
atpatientsidetime: Optional[datetime] = Field(
|
| 245 |
+
...,
|
| 246 |
+
description="Date and time when personnel reached the patient."
|
| 247 |
+
)
|
| 248 |
+
|
| 249 |
+
created: datetime = Field(
|
| 250 |
+
...,
|
| 251 |
+
description="Timestamp indicating when the apparatus response record was created."
|
| 252 |
+
)
|
| 253 |
+
|
| 254 |
+
aerialdeviceused: Optional[int] = Field(
|
| 255 |
+
...,
|
| 256 |
+
description="Indicator showing whether an aerial device (ladder platform etc.) was used."
|
| 257 |
+
)
|
| 258 |
+
|
| 259 |
+
gmtoffset: Optional[str] = Field(
|
| 260 |
+
...,
|
| 261 |
+
description="Timezone offset from GMT for the recorded timestamps."
|
| 262 |
+
)
|
| 263 |
+
|
| 264 |
+
firsteffectiveunit: Optional[int] = Field(
|
| 265 |
+
...,
|
| 266 |
+
description="Indicates whether this apparatus was the first effective operational unit."
|
| 267 |
+
)
|
| 268 |
+
|
| 269 |
+
lnfirsexported: Optional[bool] = Field(
|
| 270 |
+
...,
|
| 271 |
+
description="Indicates whether the incident record was exported to the NFIRS reporting system."
|
| 272 |
+
)
|
| 273 |
+
|
| 274 |
+
nfirsexporteddate: Optional[datetime] = Field(
|
| 275 |
+
...,
|
| 276 |
+
description="Date when the incident data was exported to NFIRS."
|
| 277 |
+
)
|
| 278 |
+
|
| 279 |
+
infirssequence: Optional[int] = Field(
|
| 280 |
+
...,
|
| 281 |
+
description="NFIRS sequence number used for tracking exported records."
|
| 282 |
+
)
|
| 283 |
+
|
| 284 |
+
nfirsttransactiontype: Optional[str] = Field(
|
| 285 |
+
...,
|
| 286 |
+
description="NFIRS transaction type code representing the type of record export."
|
| 287 |
+
)
|
| 288 |
+
|
| 289 |
+
hydrant_used: Optional[int] = Field(
|
| 290 |
+
...,
|
| 291 |
+
description="Indicator representing whether a hydrant was used during the incident."
|
| 292 |
+
)
|
| 293 |
+
|
| 294 |
+
defaultdispatchcode: Optional[str] = Field(
|
| 295 |
+
...,
|
| 296 |
+
description="Default dispatch code assigned to the apparatus response."
|
| 297 |
+
)
|
| 298 |
+
|
| 299 |
+
responsetime: Optional[str] = Field(
|
| 300 |
+
...,
|
| 301 |
+
description="Total response time from dispatch to arrival at scene formatted as HH:MM:SS."
|
| 302 |
+
)
|
| 303 |
+
|
| 304 |
+
turntime: Optional[str] = Field(
|
| 305 |
+
...,
|
| 306 |
+
description="Time between dispatch and apparatus leaving the station (turnout time)."
|
| 307 |
+
)
|
src/entities/auv_incidentapparatus/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from _model import *
|
| 2 |
+
from _schema import *
|
src/entities/auv_incidentapparatus/_model.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import Column, String, Integer, Date, DateTime, Time, ForeignKey
|
| 2 |
+
from sqlalchemy.orm import relationship
|
| 3 |
+
from base import BaseModel_
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class IncidentApparatusModel(BaseModel_):
|
| 7 |
+
__tablename__ = "auv_incidentapparatus"
|
| 8 |
+
|
| 9 |
+
apparatuskey = Column(String(14), primary_key=True, index=True)
|
| 10 |
+
incidentkey = Column(String(14), ForeignKey("incident.incidentkey"))
|
| 11 |
+
apparatusid = Column(String(20))
|
| 12 |
+
deptunitornotcode = Column(Integer)
|
| 13 |
+
deptunitornotdescrip = Column(String(50))
|
| 14 |
+
priorityresponsecode = Column(Integer)
|
| 15 |
+
priorityresponsedescrip = Column(String(50))
|
| 16 |
+
cancelledenroutecode = Column(Integer)
|
| 17 |
+
cancelledenroutedescrip = Column(String(50))
|
| 18 |
+
firstarrivingunitcode = Column(Integer)
|
| 19 |
+
firstarrivingunitdescrip = Column(String(50))
|
| 20 |
+
dispatchtype = Column(Integer)
|
| 21 |
+
dispatchtypedescrip = Column(String(100))
|
| 22 |
+
respondedfromquarterscode = Column(Integer)
|
| 23 |
+
respondedfromquarterdescrip = Column(String(100))
|
| 24 |
+
mainapparatususecode = Column(Integer)
|
| 25 |
+
mainapparatususedescrip = Column(String(100))
|
| 26 |
+
apparatustypecode = Column(Integer)
|
| 27 |
+
apparatustypedescrip = Column(String(100))
|
| 28 |
+
actiontaken1code = Column(String(10))
|
| 29 |
+
actiontaken1descip = Column(String(255))
|
| 30 |
+
actiontaken2code = Column(String(10))
|
| 31 |
+
actiontaken2descip = Column(String(255))
|
| 32 |
+
actiontaken3code = Column(String(10))
|
| 33 |
+
actiontaken3descip = Column(String(255))
|
| 34 |
+
actiontaken4code = Column(String(10))
|
| 35 |
+
actiontaken4descip = Column(String(255))
|
| 36 |
+
numberofresponders = Column(Integer)
|
| 37 |
+
dispatchdatetime = Column(DateTime)
|
| 38 |
+
dispatchtime = Column(Time)
|
| 39 |
+
dispatchdate = Column(Date)
|
| 40 |
+
dispatchenroutetime = Column(Time)
|
| 41 |
+
dispatchenroutediffseconds = Column(Integer)
|
| 42 |
+
enroutetoscenedatetime = Column(DateTime)
|
| 43 |
+
enroutetoscenetime = Column(Time)
|
| 44 |
+
enroutetoscenedate = Column(Date)
|
| 45 |
+
enroutearrivalscenetime = Column(Time)
|
| 46 |
+
enroutearrivalscenediffseconds = Column(Integer)
|
| 47 |
+
responsetime = Column(Time)
|
| 48 |
+
responsetimeseconds = Column(Integer)
|
| 49 |
+
arrivaldatetime = Column(DateTime)
|
| 50 |
+
arrivaltime = Column(Time)
|
| 51 |
+
arrivaldate = Column(Date)
|
| 52 |
+
arrivaltoenroutehospdifftime = Column(Time)
|
| 53 |
+
arrivaltoenroutehospdiffseconds = Column(Integer)
|
| 54 |
+
enroutetohospitaldatetime = Column(DateTime)
|
| 55 |
+
enroutetohospitaltime = Column(Time)
|
| 56 |
+
enroutetohospitaldate = Column(Date)
|
| 57 |
+
enroutetoarrivalhospdifftime = Column(Time)
|
| 58 |
+
enroutetoarrivalhospdiffseconds = Column(Integer)
|
| 59 |
+
arrivalscenetoarrivalhospdifftime = Column(Time)
|
| 60 |
+
arrivalscenetoarrivalhospdiffseconds = Column(Integer)
|
| 61 |
+
hospitalarrivaldatetime = Column(DateTime)
|
| 62 |
+
hospitalarrivaltime = Column(Time)
|
| 63 |
+
hospitalarrivaldate = Column(Date)
|
| 64 |
+
arrivalclearhospdifftime = Column(Time)
|
| 65 |
+
arrivalclearhospdiffseconds = Column(Integer)
|
| 66 |
+
cleardatetime = Column(DateTime)
|
| 67 |
+
cleartime = Column(Time)
|
| 68 |
+
cleardate = Column(Date)
|
| 69 |
+
dispatchcleardifftime = Column(Time)
|
| 70 |
+
dispatchcleardiffseconds = Column(Integer)
|
| 71 |
+
inservicedatetime = Column(DateTime)
|
| 72 |
+
inservicetime = Column(Time)
|
| 73 |
+
inservicedate = Column(Date)
|
| 74 |
+
emsruncode = Column(String(10))
|
| 75 |
+
emsrundescrip = Column(String(100))
|
| 76 |
+
emsrunnumber = Column(Integer)
|
| 77 |
+
losapcode = Column(Integer)
|
| 78 |
+
losapdescrip = Column(String(100))
|
| 79 |
+
alarmscode = Column(Integer)
|
| 80 |
+
alarmdescrip = Column(String(100))
|
| 81 |
+
amount1 = Column(Integer)
|
| 82 |
+
amount2 = Column(Integer)
|
| 83 |
+
fdid_no = Column(String(20))
|
| 84 |
+
stagingdatetime = Column(DateTime)
|
| 85 |
+
stagingtime = Column(Time)
|
| 86 |
+
stagingdate = Column(Date)
|
| 87 |
+
AtPatientSideDateTime = Column(DateTime)
|
| 88 |
+
AtPatientSideTime = Column(Time)
|
| 89 |
+
AtPatientSideDate = Column(Date)
|
| 90 |
+
FacilityDateTime = Column(DateTime)
|
| 91 |
+
FacilityTime = Column(Time)
|
| 92 |
+
FacilityDate = Column(Date)
|
| 93 |
+
changedate = Column(DateTime)
|
| 94 |
+
|
| 95 |
+
incident = relationship("Incident", back_populates="apparatus")
|
src/entities/auv_incidentapparatus/_schema.py
ADDED
|
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from datetime import date, datetime, time
|
| 2 |
+
from typing import Optional
|
| 3 |
+
from pydantic import Field
|
| 4 |
+
from base import BaseSchema
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class IncidentApparatusSchema(BaseSchema):
|
| 8 |
+
"""Base model for Incident Apparatus view with common fields."""
|
| 9 |
+
|
| 10 |
+
# Primary Keys and Identifiers
|
| 11 |
+
incidentkey: str = Field(
|
| 12 |
+
...,
|
| 13 |
+
description="The primary key for the incident table. This is a unique, system-generated 14-character identifier for every incident record.",
|
| 14 |
+
max_length=14,
|
| 15 |
+
examples=["_48Y061NFN_SMS", "_48Y006CZ7_SMS", "_48Y09QZRO_SMS"]
|
| 16 |
+
)
|
| 17 |
+
apparatuskey: Optional[str] = Field(
|
| 18 |
+
...,
|
| 19 |
+
description="The primary key for the apparatus table. This is a unique, system-generated 14-character identifier for a specific apparatus response to an incident.",
|
| 20 |
+
max_length=14,
|
| 21 |
+
examples=["_48Y062BSQ_SMS", "_48Y006D02_SMS", "_48Y09RO93_SMS"]
|
| 22 |
+
)
|
| 23 |
+
apparatusid: Optional[str] = Field(
|
| 24 |
+
...,
|
| 25 |
+
description="The public-facing identifier or 'unit number' of the apparatus (e.g., 'BE5', 'BB2').",
|
| 26 |
+
examples=["BE5", "BE13", "BE2", "BB2"]
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
# Apparatus Classification
|
| 30 |
+
deptunitornotcode: Optional[int] = Field(
|
| 31 |
+
...,
|
| 32 |
+
description="A code indicating whether the apparatus is a primary department unit or another type of resource. '0' = DeptUnit.",
|
| 33 |
+
ge=0,
|
| 34 |
+
le=1,
|
| 35 |
+
examples=[0]
|
| 36 |
+
)
|
| 37 |
+
deptunitornotdescrip: Optional[str] = Field(
|
| 38 |
+
...,
|
| 39 |
+
description="A description of the apparatus's departmental affiliation. 'DeptUnit' indicates the apparatus is owned and operated by the fire department.",
|
| 40 |
+
examples=["DeptUnit"]
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
# Response Priority
|
| 44 |
+
priorityresponsecode: Optional[int] = Field(
|
| 45 |
+
...,
|
| 46 |
+
description="A code indicating the priority of the response. '1' = emergent response, '0' = non-emergent.",
|
| 47 |
+
ge=0,
|
| 48 |
+
le=1,
|
| 49 |
+
examples=[0, 1]
|
| 50 |
+
)
|
| 51 |
+
priorityresponsedescrip: Optional[str] = Field(
|
| 52 |
+
...,
|
| 53 |
+
description="A description of the response priority. 'Yes' = emergent response, 'No' = non-emergent.",
|
| 54 |
+
examples=["No", "Yes"]
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
# Cancellation Status
|
| 58 |
+
cancelledenroutecode: Optional[int] = Field(
|
| 59 |
+
...,
|
| 60 |
+
description="A code indicating whether the apparatus was cancelled while responding. '1' = Yes, '0' = No.",
|
| 61 |
+
ge=0,
|
| 62 |
+
le=1,
|
| 63 |
+
examples=[0, 1]
|
| 64 |
+
)
|
| 65 |
+
cancelledenroutedescrip: Optional[str] = Field(
|
| 66 |
+
...,
|
| 67 |
+
description="A description of the cancellation status. 'Yes' = cancelled en route, 'No' = not cancelled.",
|
| 68 |
+
examples=["No", "Yes"]
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
# First Arriving Unit
|
| 72 |
+
firstarrivingunitcode: Optional[int] = Field(
|
| 73 |
+
...,
|
| 74 |
+
description="A code indicating whether this apparatus was the first to arrive on scene. '1' = Yes, '0' = No.",
|
| 75 |
+
ge=0,
|
| 76 |
+
le=1,
|
| 77 |
+
examples=[1, 0]
|
| 78 |
+
)
|
| 79 |
+
firstarrivingunitdescrip: Optional[str] = Field(
|
| 80 |
+
...,
|
| 81 |
+
description="A description of the first-arriving status. 'Yes' = first to arrive, 'No' = not first.",
|
| 82 |
+
examples=["Yes", "No"]
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
# Dispatch Type
|
| 86 |
+
dispatchtype: Optional[int] = Field(
|
| 87 |
+
...,
|
| 88 |
+
description="A code indicating the type of dispatch. This field appears to be unused or deprecated.",
|
| 89 |
+
examples=[None]
|
| 90 |
+
)
|
| 91 |
+
dispatchtypedescrip: Optional[str] = Field(
|
| 92 |
+
...,
|
| 93 |
+
description="A description of the dispatch type. This field appears to be unused or deprecated.",
|
| 94 |
+
examples=[None]
|
| 95 |
+
)
|
| 96 |
+
|
| 97 |
+
# Response Origin
|
| 98 |
+
respondedfromquarterscode: Optional[int] = Field(
|
| 99 |
+
...,
|
| 100 |
+
description="A code indicating whether the apparatus responded directly from its quarters. '1' = Yes, '0' = No.",
|
| 101 |
+
ge=0,
|
| 102 |
+
le=1,
|
| 103 |
+
examples=[0, 1]
|
| 104 |
+
)
|
| 105 |
+
respondedfromquarterdescrip: Optional[str] = Field(
|
| 106 |
+
...,
|
| 107 |
+
description="A description of the response origin. 'Yes' = responded from station, 'No' = already out.",
|
| 108 |
+
examples=["No", "Yes"]
|
| 109 |
+
)
|
| 110 |
+
|
| 111 |
+
# Apparatus Use
|
| 112 |
+
mainapparatususecode: Optional[int] = Field(
|
| 113 |
+
...,
|
| 114 |
+
description="A code representing the primary function or use of the apparatus during this response. '1' = suppression, '2' = EMS.",
|
| 115 |
+
ge=0,
|
| 116 |
+
le=2,
|
| 117 |
+
examples=[1]
|
| 118 |
+
)
|
| 119 |
+
mainapparatususedescrip: Optional[str] = Field(
|
| 120 |
+
...,
|
| 121 |
+
description="A description of the primary apparatus use. 'Suppression' indicates the apparatus is primarily for firefighting.",
|
| 122 |
+
examples=["Suppression"]
|
| 123 |
+
)
|
| 124 |
+
|
| 125 |
+
# Apparatus Type
|
| 126 |
+
apparatustypecode: Optional[int] = Field(
|
| 127 |
+
...,
|
| 128 |
+
description="A code that specifies the type of apparatus. '11' = Engine, '12' = Truck/Aerial, '92' = Chief Officer, '16' = Brush Truck.",
|
| 129 |
+
examples=[11, 92, 12, 16]
|
| 130 |
+
)
|
| 131 |
+
apparatustypedescrip: Optional[str] = Field(
|
| 132 |
+
...,
|
| 133 |
+
description="A description of the apparatus type. Provides the full textual name for the apparatustypecode.",
|
| 134 |
+
examples=["Engine", "Chief officer car", "Truck or aerial", "Brush truck"]
|
| 135 |
+
)
|
| 136 |
+
|
| 137 |
+
# Actions Taken
|
| 138 |
+
actiontaken1code: Optional[str] = Field(
|
| 139 |
+
...,
|
| 140 |
+
description="A code representing the first primary action taken by the crew of this apparatus at the scene.",
|
| 141 |
+
examples=["93", "86", "31"]
|
| 142 |
+
)
|
| 143 |
+
actiontaken1descip: Optional[str] = Field(
|
| 144 |
+
...,
|
| 145 |
+
description="A description of the first action taken by the crew.",
|
| 146 |
+
examples=["Cancelled en route", "Investigate", "Provide first aid & check for injuries"]
|
| 147 |
+
)
|
| 148 |
+
|
| 149 |
+
actiontaken2code: Optional[str] = Field(
|
| 150 |
+
...,
|
| 151 |
+
description="A code representing the second primary action taken by the crew of this apparatus at the scene.",
|
| 152 |
+
examples=["93", "86", "31"]
|
| 153 |
+
)
|
| 154 |
+
actiontaken2descip: Optional[str] = Field(
|
| 155 |
+
...,
|
| 156 |
+
description="A description of the second action taken by the crew.",
|
| 157 |
+
examples=["Cancelled en route", "Investigate", "Provide first aid & check for injuries"]
|
| 158 |
+
)
|
| 159 |
+
|
| 160 |
+
actiontaken3code: Optional[str] = Field(
|
| 161 |
+
...,
|
| 162 |
+
description="A code representing the third primary action taken by the crew of this apparatus at the scene.",
|
| 163 |
+
examples=["93", "86", "31"]
|
| 164 |
+
)
|
| 165 |
+
actiontaken3descip: Optional[str] = Field(
|
| 166 |
+
...,
|
| 167 |
+
description="A description of the third action taken by the crew.",
|
| 168 |
+
examples=["Cancelled en route", "Investigate", "Provide first aid & check for injuries"]
|
| 169 |
+
)
|
| 170 |
+
|
| 171 |
+
actiontaken4code: Optional[str] = Field(
|
| 172 |
+
...,
|
| 173 |
+
description="A code representing the fourth primary action taken by the crew of this apparatus at the scene.",
|
| 174 |
+
examples=["93", "86", "31"]
|
| 175 |
+
)
|
| 176 |
+
actiontaken4descip: Optional[str] = Field(
|
| 177 |
+
...,
|
| 178 |
+
description="A description of the fourth action taken by the crew.",
|
| 179 |
+
examples=["Cancelled en route", "Investigate", "Provide first aid & check for injuries"]
|
| 180 |
+
)
|
| 181 |
+
|
| 182 |
+
# Personnel
|
| 183 |
+
numberofresponders: Optional[int] = Field(
|
| 184 |
+
...,
|
| 185 |
+
description="The number of personnel who responded on this apparatus to the incident.",
|
| 186 |
+
ge=0,
|
| 187 |
+
examples=[3, 1, 4]
|
| 188 |
+
)
|
| 189 |
+
|
| 190 |
+
# Dispatch Timestamps
|
| 191 |
+
dispatchdatetime: Optional[datetime] = Field(
|
| 192 |
+
...,
|
| 193 |
+
description="The date and time when the apparatus was dispatched to the incident."
|
| 194 |
+
)
|
| 195 |
+
dispatchtime: Optional[time] = Field(
|
| 196 |
+
...,
|
| 197 |
+
description="The time of day when the apparatus was dispatched, derived from dispatchdatetime."
|
| 198 |
+
)
|
| 199 |
+
dispatchdate: Optional[date] = Field(
|
| 200 |
+
...,
|
| 201 |
+
description="The date on which the apparatus was dispatched, derived from dispatchdatetime."
|
| 202 |
+
)
|
| 203 |
+
|
| 204 |
+
# En Route Timestamps
|
| 205 |
+
dispatchenroutetime: Optional[time] = Field(
|
| 206 |
+
...,
|
| 207 |
+
description="The time of day when the apparatus acknowledged the dispatch and began traveling to the scene (en route)."
|
| 208 |
+
)
|
| 209 |
+
dispatchenroutediffseconds: Optional[int] = Field(
|
| 210 |
+
...,
|
| 211 |
+
description="The time difference, in seconds, between dispatch and en route (turnout time).",
|
| 212 |
+
ge=0,
|
| 213 |
+
examples=[91, 79, 109]
|
| 214 |
+
)
|
| 215 |
+
|
| 216 |
+
enroutetoscenedatetime: Optional[datetime] = Field(
|
| 217 |
+
...,
|
| 218 |
+
description="The date and time when the apparatus reported that it was en route to the scene."
|
| 219 |
+
)
|
| 220 |
+
enroutetoscenetime: Optional[time] = Field(
|
| 221 |
+
...,
|
| 222 |
+
description="The time of day when the apparatus reported it was en route to the scene."
|
| 223 |
+
)
|
| 224 |
+
enroutetoscenedate: Optional[date] = Field(
|
| 225 |
+
...,
|
| 226 |
+
description="The date on which the apparatus reported it was en route to the scene."
|
| 227 |
+
)
|
| 228 |
+
|
| 229 |
+
enroutearrivalscenetime: Optional[time] = Field(
|
| 230 |
+
...,
|
| 231 |
+
description="The time of day when the apparatus arrived at the scene of the incident."
|
| 232 |
+
)
|
| 233 |
+
enroutearrivalscenediffseconds: Optional[int] = Field(
|
| 234 |
+
...,
|
| 235 |
+
description="The time difference, in seconds, between en route and arrival on scene (travel time).",
|
| 236 |
+
ge=0,
|
| 237 |
+
examples=[0, 372]
|
| 238 |
+
)
|
| 239 |
+
|
| 240 |
+
# Arrival Timestamps
|
| 241 |
+
responsetime: Optional[time] = Field(
|
| 242 |
+
...,
|
| 243 |
+
description="The total time from dispatch to arrival on scene (h:mm:ss)."
|
| 244 |
+
)
|
| 245 |
+
responsetimeseconds: Optional[int] = Field(
|
| 246 |
+
...,
|
| 247 |
+
description="The total response time, in seconds, from dispatch to arrival on scene.",
|
| 248 |
+
ge=0,
|
| 249 |
+
examples=[0, 457]
|
| 250 |
+
)
|
| 251 |
+
|
| 252 |
+
arrivaldatetime: Optional[datetime] = Field(
|
| 253 |
+
...,
|
| 254 |
+
description="The date and time when the apparatus arrived on the scene of the incident."
|
| 255 |
+
)
|
| 256 |
+
arrivaltime: Optional[time] = Field(
|
| 257 |
+
...,
|
| 258 |
+
description="The time of day when the apparatus arrived on the scene."
|
| 259 |
+
)
|
| 260 |
+
arrivaldate: Optional[date] = Field(
|
| 261 |
+
...,
|
| 262 |
+
description="The date on which the apparatus arrived on the scene."
|
| 263 |
+
)
|
| 264 |
+
|
| 265 |
+
arrivaltoenroutehospdifftime: Optional[time] = Field(
|
| 266 |
+
...,
|
| 267 |
+
description="This field appears to be unused or deprecated for this dataset. May relate to EMS transport time calculations."
|
| 268 |
+
)
|
| 269 |
+
arrivaltoenroutehospdiffseconds: Optional[int] = Field(
|
| 270 |
+
...,
|
| 271 |
+
description="This field appears to be unused or deprecated for this dataset.",
|
| 272 |
+
ge=0,
|
| 273 |
+
examples=[0]
|
| 274 |
+
)
|
| 275 |
+
|
| 276 |
+
# Hospital Transport Timestamps
|
| 277 |
+
enroutetohospitaldatetime: Optional[datetime] = Field(
|
| 278 |
+
...,
|
| 279 |
+
description="The date and time when the apparatus began transporting a patient to the hospital. NULL for non-EMS responses."
|
| 280 |
+
)
|
| 281 |
+
enroutetohospitaltime: Optional[time] = Field(
|
| 282 |
+
...,
|
| 283 |
+
description="The time of day when the apparatus began transporting a patient to the hospital."
|
| 284 |
+
)
|
| 285 |
+
enroutetohospitaldate: Optional[date] = Field(
|
| 286 |
+
...,
|
| 287 |
+
description="The date on which the apparatus began transporting a patient to the hospital."
|
| 288 |
+
)
|
| 289 |
+
|
| 290 |
+
enroutetoarrivalhospdifftime: Optional[time] = Field(
|
| 291 |
+
...,
|
| 292 |
+
description="This field appears to be unused or deprecated for this dataset."
|
| 293 |
+
)
|
| 294 |
+
enroutetoarrivalhospdiffseconds: Optional[int] = Field(
|
| 295 |
+
...,
|
| 296 |
+
description="This field appears to be unused or deprecated for this dataset.",
|
| 297 |
+
ge=0,
|
| 298 |
+
examples=[0]
|
| 299 |
+
)
|
| 300 |
+
|
| 301 |
+
arrivalscenetoarrivalhospdifftime: Optional[time] = Field(
|
| 302 |
+
...,
|
| 303 |
+
description="This field appears to be unused or deprecated for this dataset."
|
| 304 |
+
)
|
| 305 |
+
arrivalscenetoarrivalhospdiffseconds: Optional[int] = Field(
|
| 306 |
+
...,
|
| 307 |
+
description="This field appears to be unused or deprecated for this dataset.",
|
| 308 |
+
ge=0,
|
| 309 |
+
examples=[0]
|
| 310 |
+
)
|
| 311 |
+
|
| 312 |
+
hospitalarrivaldatetime: Optional[datetime] = Field(
|
| 313 |
+
...,
|
| 314 |
+
description="The date and time when the apparatus arrived at the hospital with a patient. NULL for non-EMS responses."
|
| 315 |
+
)
|
| 316 |
+
hospitalarrivaltime: Optional[time] = Field(
|
| 317 |
+
...,
|
| 318 |
+
description="The time of day when the apparatus arrived at the hospital."
|
| 319 |
+
)
|
| 320 |
+
hospitalarrivaldate: Optional[date] = Field(
|
| 321 |
+
...,
|
| 322 |
+
description="The date on which the apparatus arrived at the hospital."
|
| 323 |
+
)
|
| 324 |
+
|
| 325 |
+
arrivalclearhospdifftime: Optional[time] = Field(
|
| 326 |
+
...,
|
| 327 |
+
description="This field appears to be unused or deprecated for this dataset."
|
| 328 |
+
)
|
| 329 |
+
arrivalclearhospdiffseconds: Optional[int] = Field(
|
| 330 |
+
...,
|
| 331 |
+
description="This field appears to be unused or deprecated for this dataset.",
|
| 332 |
+
ge=0,
|
| 333 |
+
examples=[0]
|
| 334 |
+
)
|
| 335 |
+
|
| 336 |
+
# Clear Timestamps
|
| 337 |
+
cleardatetime: Optional[datetime] = Field(
|
| 338 |
+
...,
|
| 339 |
+
description="The date and time when the apparatus was cleared from the incident and became available for another response."
|
| 340 |
+
)
|
| 341 |
+
cleartime: Optional[time] = Field(
|
| 342 |
+
...,
|
| 343 |
+
description="The time of day when the apparatus was cleared from the incident."
|
| 344 |
+
)
|
| 345 |
+
cleardate: Optional[date] = Field(
|
| 346 |
+
...,
|
| 347 |
+
description="The date on which the apparatus was cleared from the incident."
|
| 348 |
+
)
|
| 349 |
+
|
| 350 |
+
dispatchcleardifftime: Optional[time] = Field(
|
| 351 |
+
...,
|
| 352 |
+
description="The total time from dispatch to being cleared from the incident (h:mm:ss)."
|
| 353 |
+
)
|
| 354 |
+
dispatchcleardiffseconds: Optional[int] = Field(
|
| 355 |
+
...,
|
| 356 |
+
description="The total time from dispatch to being cleared, in seconds.",
|
| 357 |
+
ge=0,
|
| 358 |
+
examples=[550, 325, 655]
|
| 359 |
+
)
|
| 360 |
+
|
| 361 |
+
# In Service Timestamps
|
| 362 |
+
inservicedatetime: Optional[datetime] = Field(
|
| 363 |
+
...,
|
| 364 |
+
description="The date and time when the apparatus was placed back in service and available for responses."
|
| 365 |
+
)
|
| 366 |
+
inservicetime: Optional[time] = Field(
|
| 367 |
+
...,
|
| 368 |
+
description="The time of day when the apparatus was placed back in service."
|
| 369 |
+
)
|
| 370 |
+
inservicedate: Optional[date] = Field(
|
| 371 |
+
...,
|
| 372 |
+
description="The date on which the apparatus was placed back in service."
|
| 373 |
+
)
|
| 374 |
+
|
| 375 |
+
# EMS Information
|
| 376 |
+
emsruncode: Optional[str] = Field(
|
| 377 |
+
...,
|
| 378 |
+
description="A code indicating whether this was an EMS (Emergency Medical Services) run.",
|
| 379 |
+
examples=["Not EMS Run"]
|
| 380 |
+
)
|
| 381 |
+
emsrundescrip: Optional[str] = Field(
|
| 382 |
+
...,
|
| 383 |
+
description="A description of the EMS run status.",
|
| 384 |
+
examples=[None]
|
| 385 |
+
)
|
| 386 |
+
emsrunnumber: Optional[int] = Field(
|
| 387 |
+
...,
|
| 388 |
+
description="A number associated with the EMS run, potentially a sequential or tracking number.",
|
| 389 |
+
examples=[None]
|
| 390 |
+
)
|
| 391 |
+
|
| 392 |
+
# LOSAP Information
|
| 393 |
+
losapcode: Optional[int] = Field(
|
| 394 |
+
...,
|
| 395 |
+
description="A code related to LOSAP (Length of Service Award Program) credit. '1' = qualifies for LOSAP credit.",
|
| 396 |
+
ge=0,
|
| 397 |
+
le=1,
|
| 398 |
+
examples=[1]
|
| 399 |
+
)
|
| 400 |
+
losapdescrip: Optional[str] = Field(
|
| 401 |
+
...,
|
| 402 |
+
description="A description of the LOSAP credit status.",
|
| 403 |
+
examples=["Losap Credit"]
|
| 404 |
+
)
|
| 405 |
+
|
| 406 |
+
# Alarms Information
|
| 407 |
+
alarmscode: Optional[int] = Field(
|
| 408 |
+
...,
|
| 409 |
+
description="A code indicating the alarm level or number of alarms for the incident.",
|
| 410 |
+
examples=[None]
|
| 411 |
+
)
|
| 412 |
+
alarmdescrip: Optional[str] = Field(
|
| 413 |
+
...,
|
| 414 |
+
description="A description of the alarm level.",
|
| 415 |
+
examples=[None]
|
| 416 |
+
)
|
| 417 |
+
|
| 418 |
+
# Amount Fields
|
| 419 |
+
amount1: Optional[int] = Field(
|
| 420 |
+
...,
|
| 421 |
+
description="Generic numeric field, possibly for recording quantities like hose lengths, water used, or other resources.",
|
| 422 |
+
examples=[None]
|
| 423 |
+
)
|
| 424 |
+
amount2: Optional[int] = Field(
|
| 425 |
+
...,
|
| 426 |
+
description="Generic numeric field, possibly for recording quantities like hose lengths, water used, or other resources.",
|
| 427 |
+
examples=[None]
|
| 428 |
+
)
|
| 429 |
+
|
| 430 |
+
# FDID
|
| 431 |
+
fdid_no: Optional[str] = Field(
|
| 432 |
+
...,
|
| 433 |
+
description="The Fire Department ID number.",
|
| 434 |
+
examples=[None]
|
| 435 |
+
)
|
| 436 |
+
|
| 437 |
+
# Staging Information
|
| 438 |
+
stagingdatetime: Optional[datetime] = Field(
|
| 439 |
+
...,
|
| 440 |
+
description="The date and time when the apparatus was placed in a staging area."
|
| 441 |
+
)
|
| 442 |
+
stagingtime: Optional[time] = Field(
|
| 443 |
+
...,
|
| 444 |
+
description="The time of day when the apparatus was placed in a staging area."
|
| 445 |
+
)
|
| 446 |
+
stagingdate: Optional[date] = Field(
|
| 447 |
+
...,
|
| 448 |
+
description="The date on which the apparatus was placed in a staging area."
|
| 449 |
+
)
|
| 450 |
+
|
| 451 |
+
# Patient Side Information
|
| 452 |
+
AtPatientSideDateTime: Optional[datetime] = Field(
|
| 453 |
+
...,
|
| 454 |
+
description="The date and time when the crew arrived at the patient's side, typically for EMS calls."
|
| 455 |
+
)
|
| 456 |
+
AtPatientSideTime: Optional[time] = Field(
|
| 457 |
+
...,
|
| 458 |
+
description="The time of day when the crew arrived at the patient's side."
|
| 459 |
+
)
|
| 460 |
+
AtPatientSideDate: Optional[date] = Field(
|
| 461 |
+
...,
|
| 462 |
+
description="The date on which the crew arrived at the patient's side."
|
| 463 |
+
)
|
| 464 |
+
|
| 465 |
+
# Facility Information (duplicate of hospital fields)
|
| 466 |
+
FacilityDateTime: Optional[datetime] = Field(
|
| 467 |
+
...,
|
| 468 |
+
description="The date and time when the apparatus arrived at a medical facility with a patient."
|
| 469 |
+
)
|
| 470 |
+
FacilityTime: Optional[time] = Field(
|
| 471 |
+
...,
|
| 472 |
+
description="The time of day when the apparatus arrived at a medical facility."
|
| 473 |
+
)
|
| 474 |
+
FacilityDate: Optional[date] = Field(
|
| 475 |
+
...,
|
| 476 |
+
description="The date on which the apparatus arrived at a medical facility."
|
| 477 |
+
)
|
| 478 |
+
|
| 479 |
+
# Change Tracking
|
| 480 |
+
changedate: Optional[datetime] = Field(
|
| 481 |
+
...,
|
| 482 |
+
description="A timestamp indicating the last time this record was modified in the database.",
|
| 483 |
+
examples=["43:34.2", "10:02.9", "36:07.4"]
|
| 484 |
+
)
|
src/entities/auv_incidentbase/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from _model import *
|
| 2 |
+
from _schema import *
|
src/entities/auv_incidentbase/_model.py
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import Column, String, Integer, Float, DateTime, Text
|
| 2 |
+
from base import BaseModel_
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class IncidentBaseModel(BaseModel_):
|
| 6 |
+
__tablename__ = "auv_incidentbase"
|
| 7 |
+
|
| 8 |
+
incidentkey = Column(String(14), primary_key=True, index=True)
|
| 9 |
+
IncidentNumber = Column(String(20))
|
| 10 |
+
IncidentExposureNumber = Column(String(5))
|
| 11 |
+
CompletedReportCode = Column(String(2))
|
| 12 |
+
CompletedReportDescrip = Column(String(50))
|
| 13 |
+
ReviewedReportCode = Column(String(2))
|
| 14 |
+
ReviewReportDescrip = Column(String(50))
|
| 15 |
+
PublicReleaseReportCode = Column(String(2))
|
| 16 |
+
PublicReleaseReportDescrip = Column(String(50))
|
| 17 |
+
DidNotArriveCode = Column(String(2))
|
| 18 |
+
DidNotArriveDescrip = Column(String(50))
|
| 19 |
+
AlarmDateTime = Column(DateTime)
|
| 20 |
+
Alarmtime = Column(String(10))
|
| 21 |
+
Alarmdate = Column(String(10))
|
| 22 |
+
ArrivalDateTime = Column(DateTime)
|
| 23 |
+
Arrivaltime = Column(String(10))
|
| 24 |
+
Arrivaldate = Column(String(10))
|
| 25 |
+
ControlledDateTime = Column(DateTime)
|
| 26 |
+
Controlledtime = Column(String(10))
|
| 27 |
+
Controlleddate = Column(String(10))
|
| 28 |
+
ClearedDateTime = Column(DateTime)
|
| 29 |
+
Clearedtime = Column(String(10))
|
| 30 |
+
Cleareddate = Column(String(10))
|
| 31 |
+
ResponseTime = Column(String(20))
|
| 32 |
+
ResponseTimediffseconds = Column(Integer)
|
| 33 |
+
IncidentTotalTime1 = Column(String(20))
|
| 34 |
+
IncidentTotalTimediffseconds = Column(Integer)
|
| 35 |
+
District = Column(String(20))
|
| 36 |
+
Station = Column(String(20))
|
| 37 |
+
Shift = Column(String(10))
|
| 38 |
+
Alarms = Column(Integer)
|
| 39 |
+
IncidentTypeCode = Column(String(10))
|
| 40 |
+
IncidentTypeDescrip = Column(String(255))
|
| 41 |
+
InitialDispatchCode = Column(String(10))
|
| 42 |
+
finaldispatchcode = Column(String(10))
|
| 43 |
+
MutualAidFlagCode = Column(String(2))
|
| 44 |
+
MutualAidTypeCode = Column(String(10))
|
| 45 |
+
MutualAidTypeDescrip = Column(String(255))
|
| 46 |
+
MutalAidIncidentNo = Column(String(50))
|
| 47 |
+
actiontaken1code = Column(String(10))
|
| 48 |
+
actiontaken1descip = Column(String(255))
|
| 49 |
+
actiontaken2code = Column(String(10))
|
| 50 |
+
actiontaken2descip = Column(String(255))
|
| 51 |
+
actiontaken3code = Column(String(10))
|
| 52 |
+
actiontaken3descip = Column(String(255))
|
| 53 |
+
ApparatusSuppressionCount = Column(Integer)
|
| 54 |
+
ApparatusEMSCount = Column(Integer)
|
| 55 |
+
ApparatusOtherCount = Column(Integer)
|
| 56 |
+
ApparatusTotalCount = Column(Integer)
|
| 57 |
+
PersonnelSuppressionCount = Column(Integer)
|
| 58 |
+
PersonnelEMSCount = Column(Integer)
|
| 59 |
+
PersonnelOtherCount = Column(Integer)
|
| 60 |
+
PersonnelTotalCount = Column(Integer)
|
| 61 |
+
MAidApparatusSuppressionCount = Column(Integer)
|
| 62 |
+
MAidApparatusEMSCount = Column(Integer)
|
| 63 |
+
MAidApparatusOtherCount = Column(Integer)
|
| 64 |
+
MAidApparatusTotalCount = Column(Integer)
|
| 65 |
+
MAidPersonnelSuppressionCount = Column(Integer)
|
| 66 |
+
MaidPersonnelEMSCount = Column(Integer)
|
| 67 |
+
MAidPersonnelOtherCount = Column(Integer)
|
| 68 |
+
MaidPersonnelTotalCount = Column(Integer)
|
| 69 |
+
LossProperty = Column(Float)
|
| 70 |
+
LossContents = Column(Float)
|
| 71 |
+
ValueProperty = Column(Float)
|
| 72 |
+
ValueContents = Column(Float)
|
| 73 |
+
LossTotal = Column(Float)
|
| 74 |
+
ValueTotal = Column(Float)
|
| 75 |
+
ValueSaved = Column(Float)
|
| 76 |
+
DetectorAlertedCode = Column(String(10))
|
| 77 |
+
DetectorAlertedDescrip = Column(String(255))
|
| 78 |
+
HazardMaterialReleasedCode = Column(String(10))
|
| 79 |
+
HazardMaterialReleasedDescrip = Column(String(255))
|
| 80 |
+
PropertyUseCode = Column(String(10))
|
| 81 |
+
PropertyUseDescrip = Column(String(255))
|
| 82 |
+
MixedUseCode = Column(String(10))
|
| 83 |
+
MixedUseDescrip = Column(String(255))
|
| 84 |
+
StreetNumber = Column(String(50))
|
| 85 |
+
StreetPrefix = Column(String(20))
|
| 86 |
+
StreetName = Column(String(255))
|
| 87 |
+
StreetType = Column(String(20))
|
| 88 |
+
StreetSuffix = Column(String(20))
|
| 89 |
+
Apartment = Column(String(20))
|
| 90 |
+
City = Column(String(100))
|
| 91 |
+
State = Column(String(20))
|
| 92 |
+
ZipCode = Column(String(20))
|
| 93 |
+
AddressComposite = Column(Text)
|
| 94 |
+
CityStateZipComposite = Column(Text)
|
| 95 |
+
CensusTract = Column(String(20))
|
| 96 |
+
EmsProvidedCode = Column(String(2))
|
| 97 |
+
EMSProvidedDescrip = Column(String(50))
|
| 98 |
+
LocationTypeCode = Column(String(5))
|
| 99 |
+
LocationTypeDescrip = Column(String(100))
|
| 100 |
+
fatalfireservicecode = Column(String(2))
|
| 101 |
+
fatalfireservicedescrip = Column(String(100))
|
| 102 |
+
fatalciviliancode = Column(String(2))
|
| 103 |
+
fatalciviliandescrip = Column(String(100))
|
| 104 |
+
injuredfireservicecode = Column(String(2))
|
| 105 |
+
injuredfireservicedescrip = Column(String(100))
|
| 106 |
+
injuredciviliancode = Column(String(2))
|
| 107 |
+
injuredciviliandescrip = Column(String(100))
|
| 108 |
+
casualtiescode = Column(String(2))
|
| 109 |
+
casualtiesdescrip = Column(String(100))
|
| 110 |
+
priorityrespcode = Column(String(2))
|
| 111 |
+
priorityrespdescrip = Column(String(100))
|
| 112 |
+
crossstreetprefix = Column(String(20))
|
| 113 |
+
crossstreetname = Column(String(255))
|
| 114 |
+
crossstreettype = Column(String(20))
|
| 115 |
+
crossstreetsuffix = Column(String(20))
|
| 116 |
+
CrossStreetComposite = Column(Text)
|
| 117 |
+
directions = Column(Text)
|
| 118 |
+
county = Column(String(100))
|
| 119 |
+
mappage = Column(String(50))
|
| 120 |
+
hwycalloutrequestby = Column(String(50))
|
| 121 |
+
hwyinvestpolicecode = Column(String(10))
|
| 122 |
+
hwyinvetpolicedescrip = Column(String(255))
|
| 123 |
+
hwyofficer = Column(String(100))
|
| 124 |
+
hwybadgenumber = Column(String(20))
|
| 125 |
+
hwyreportnumber = Column(String(50))
|
| 126 |
+
hwycauseemergcode = Column(String(10))
|
| 127 |
+
hwycauseemergdescrip = Column(String(255))
|
| 128 |
+
hwycauseotherdescrip = Column(Text)
|
| 129 |
+
hwyloecode = Column(String(10))
|
| 130 |
+
hwyloedescrip = Column(String(255))
|
| 131 |
+
hwyloeotherdescrip = Column(Text)
|
| 132 |
+
hwyobstrcutioncode = Column(String(10))
|
| 133 |
+
hwyobstructiondescrip = Column(String(255))
|
| 134 |
+
hwyobstructionotherdescrip = Column(Text)
|
| 135 |
+
hwynoservicecode = Column(String(2))
|
| 136 |
+
hwynoservicedescrip = Column(String(100))
|
| 137 |
+
hwyextinguishcode = Column(String(2))
|
| 138 |
+
hwyextinguishdescrip = Column(String(100))
|
| 139 |
+
hwycleanupcode = Column(String(2))
|
| 140 |
+
hwycleanupdescrip = Column(String(100))
|
| 141 |
+
hwyextractioncode = Column(String(2))
|
| 142 |
+
hwyextractiodescrip = Column(String(100))
|
| 143 |
+
hwyfirstaidcode = Column(String(2))
|
| 144 |
+
hwyfirstaidedescrip = Column(String(100))
|
| 145 |
+
hwydamagecode = Column(String(2))
|
| 146 |
+
hwydamagedescrip = Column(String(100))
|
| 147 |
+
hwyprivatedamcode = Column(String(2))
|
| 148 |
+
hwyprivatedescrip = Column(String(100))
|
| 149 |
+
hwycitycode = Column(String(2))
|
| 150 |
+
hwycitydescrip = Column(String(100))
|
| 151 |
+
hwyothercode = Column(String(2))
|
| 152 |
+
hwynotherdescrip = Column(String(100))
|
| 153 |
+
hwyothertext = Column(Text)
|
| 154 |
+
water_used = Column(String(2))
|
| 155 |
+
water_used_quantity = Column(Float)
|
| 156 |
+
foam_used = Column(String(2))
|
| 157 |
+
foam_used_quantity = Column(Float)
|
| 158 |
+
oilzorb_used = Column(String(2))
|
| 159 |
+
oilzorb_used_quantity = Column(Float)
|
| 160 |
+
other_used = Column(String(2))
|
| 161 |
+
other_used_quantity = Column(Float)
|
| 162 |
+
codetectpresentcode = Column(String(2))
|
| 163 |
+
codetectpresentdescrip = Column(String(100))
|
| 164 |
+
cotypecode = Column(String(10))
|
| 165 |
+
cotypedescrip = Column(String(255))
|
| 166 |
+
copowersupplycode = Column(String(10))
|
| 167 |
+
copowersupplydescrip = Column(String(255))
|
| 168 |
+
cooperationcode = Column(String(10))
|
| 169 |
+
cooperationdescrip = Column(String(255))
|
| 170 |
+
coeffectivecode = Column(String(10))
|
| 171 |
+
coeffectivedescrip = Column(String(255))
|
| 172 |
+
cofailurecode = Column(String(10))
|
| 173 |
+
cofailuredescrip = Column(String(255))
|
| 174 |
+
codetectormfg = Column(String(100))
|
| 175 |
+
codetectormodel = Column(String(100))
|
| 176 |
+
cochildrencount = Column(Integer)
|
| 177 |
+
coyouthscount = Column(Integer)
|
| 178 |
+
coadultscount = Column(Integer)
|
| 179 |
+
coseniorscount = Column(Integer)
|
| 180 |
+
latitude = Column(Float)
|
| 181 |
+
longitude = Column(Float)
|
| 182 |
+
changedate = Column(DateTime)
|
| 183 |
+
IncidentDateTime = Column(DateTime)
|
| 184 |
+
Incidenttime = Column(String(10))
|
| 185 |
+
Incidentdate = Column(String(10))
|
src/entities/auv_incidentbase/_schema.py
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import BaseModel, Field
|
| 2 |
+
from datetime import datetime, time, date
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from base import BaseSchema
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class IncidentBaseSchema(BaseSchema):
|
| 8 |
+
"""Base Pydantic schema for IncidentFullView, matching the SQLAlchemy model."""
|
| 9 |
+
|
| 10 |
+
IncidentNumber: Optional[str] = Field(None, description="The human-readable, sequential number assigned to an incident by the dispatch center.")
|
| 11 |
+
IncidentExposureNumber: Optional[str] = Field(None, description="A number used to differentiate between multiple separate fire or event 'exposures'.")
|
| 12 |
+
CompletedReportCode: Optional[str] = Field(None, description="A code indicating the completion status of the incident report.")
|
| 13 |
+
CompletedReportDescrip: Optional[str] = Field(None, description="A textual description corresponding to the CompletedReportCode.")
|
| 14 |
+
ReviewedReportCode: Optional[str] = Field(None, description="A code indicating whether the incident report has been reviewed.")
|
| 15 |
+
ReviewReportDescrip: Optional[str] = Field(None, description="A textual description corresponding to the ReviewedReportCode.")
|
| 16 |
+
PublicReleaseReportCode: Optional[str] = Field(None, description="A code indicating if the report is cleared for public release.")
|
| 17 |
+
PublicReleaseReportDescrip: Optional[str] = Field(None, description="A textual description corresponding to the PublicReleaseReportCode.")
|
| 18 |
+
DidNotArriveCode: Optional[str] = Field(None, description="A flag indicating whether the fire unit arrived on the scene.")
|
| 19 |
+
DidNotArriveDescrip: Optional[str] = Field(None, description="A textual description corresponding to the DidNotArriveCode.")
|
| 20 |
+
AlarmDateTime: Optional[datetime] = Field(None, description="The timestamp the alarm was received.")
|
| 21 |
+
Alarmtime: Optional[str] = Field(None, description="The time portion of the alarm receipt timestamp.")
|
| 22 |
+
Alarmdate: Optional[str] = Field(None, description="The date portion of the alarm receipt timestamp.")
|
| 23 |
+
ArrivalDateTime: Optional[datetime] = Field(None, description="The timestamp the first unit arrived on the scene.")
|
| 24 |
+
Arrivaltime: Optional[str] = Field(None, description="The time portion of the arrival timestamp.")
|
| 25 |
+
Arrivaldate: Optional[str] = Field(None, description="The date portion of the arrival timestamp.")
|
| 26 |
+
ControlledDateTime: Optional[datetime] = Field(None, description="The timestamp the incident was controlled.")
|
| 27 |
+
Controlledtime: Optional[str] = Field(None, description="The time portion of the controlled timestamp.")
|
| 28 |
+
Controlleddate: Optional[str] = Field(None, description="The date portion of the controlled timestamp.")
|
| 29 |
+
ClearedDateTime: Optional[datetime] = Field(None, description="The timestamp the incident was cleared.")
|
| 30 |
+
Clearedtime: Optional[str] = Field(None, description="The time portion of the cleared timestamp.")
|
| 31 |
+
Cleareddate: Optional[str] = Field(None, description="The date portion of the cleared timestamp.")
|
| 32 |
+
ResponseTime: Optional[str] = Field(None, description="Human-readable representation of the time taken from alarm to arrival (MM:SS).")
|
| 33 |
+
ResponseTimediffseconds: Optional[int] = Field(None, description="The ResponseTime expressed purely as a total number of seconds.")
|
| 34 |
+
IncidentTotalTime1: Optional[str] = Field(None, description="Human-readable representation of the total incident duration.")
|
| 35 |
+
IncidentTotalTimediffseconds: Optional[int] = Field(None, description="The total incident duration expressed as a total number of seconds.")
|
| 36 |
+
District: Optional[str] = Field(None, description="The district code for the geographic area in which the incident occurred.")
|
| 37 |
+
Station: Optional[str] = Field(None, description="The station number or code of the primary fire station that responded.")
|
| 38 |
+
Shift: Optional[str] = Field(None, description="The shift that was on duty at the time of the incident.")
|
| 39 |
+
Alarms: Optional[int] = Field(None, description="The number of alarms for the incident.")
|
| 40 |
+
IncidentTypeCode: Optional[str] = Field(None, description="A code that classifies the primary type of incident.")
|
| 41 |
+
IncidentTypeDescrip: Optional[str] = Field(None, description="A textual description corresponding to the IncidentTypeCode.")
|
| 42 |
+
InitialDispatchCode: Optional[str] = Field(None, description="The code for the initial dispatch call type.")
|
| 43 |
+
finaldispatchcode: Optional[str] = Field(None, description="The final code assigned to the dispatch.")
|
| 44 |
+
MutualAidFlagCode: Optional[str] = Field(None, description="Flag indicating if mutual aid was requested.")
|
| 45 |
+
MutualAidTypeCode: Optional[str] = Field(None, description="The code for the type of mutual aid provided.")
|
| 46 |
+
MutualAidTypeDescrip: Optional[str] = Field(None, description="A textual description of the mutual aid type.")
|
| 47 |
+
MutalAidIncidentNo: Optional[str] = Field(None, description="The incident number of the mutual aid agency.")
|
| 48 |
+
actiontaken1code: Optional[str] = Field(None, description="Code describing the primary action taken by fire personnel.")
|
| 49 |
+
actiontaken1descip: Optional[str] = Field(None, description="Textual description of the primary action taken.")
|
| 50 |
+
actiontaken2code: Optional[str] = Field(None, description="Code describing the secondary action taken by fire personnel.")
|
| 51 |
+
actiontaken2descip: Optional[str] = Field(None, description="Textual description of the secondary action taken.")
|
| 52 |
+
actiontaken3code: Optional[str] = Field(None, description="Code describing the tertiary action taken by fire personnel.")
|
| 53 |
+
actiontaken3descip: Optional[str] = Field(None, description="Textual description of the tertiary action taken.")
|
| 54 |
+
ApparatusSuppressionCount: Optional[int] = Field(None, description="Number of suppression apparatus (fire engines) that responded.")
|
| 55 |
+
ApparatusEMSCount: Optional[int] = Field(None, description="Number of EMS apparatus (ambulances) that responded.")
|
| 56 |
+
ApparatusOtherCount: Optional[int] = Field(None, description="Number of other apparatus that responded.")
|
| 57 |
+
ApparatusTotalCount: Optional[int] = Field(None, description="Total number of apparatus that responded.")
|
| 58 |
+
PersonnelSuppressionCount: Optional[int] = Field(None, description="Number of suppression personnel that responded.")
|
| 59 |
+
PersonnelEMSCount: Optional[int] = Field(None, description="Number of EMS personnel that responded.")
|
| 60 |
+
PersonnelOtherCount: Optional[int] = Field(None, description="Number of other personnel that responded.")
|
| 61 |
+
PersonnelTotalCount: Optional[int] = Field(None, description="Total number of personnel that responded.")
|
| 62 |
+
MAidApparatusSuppressionCount: Optional[int] = Field(None, description="Number of mutual aid suppression apparatus that responded.")
|
| 63 |
+
MAidApparatusEMSCount: Optional[int] = Field(None, description="Number of mutual aid EMS apparatus that responded.")
|
| 64 |
+
MAidApparatusOtherCount: Optional[int] = Field(None, description="Number of mutual aid other apparatus that responded.")
|
| 65 |
+
MAidApparatusTotalCount: Optional[int] = Field(None, description="Total number of mutual aid apparatus that responded.")
|
| 66 |
+
MAidPersonnelSuppressionCount: Optional[int] = Field(None, description="Number of mutual aid suppression personnel that responded.")
|
| 67 |
+
MaidPersonnelEMSCount: Optional[int] = Field(None, description="Number of mutual aid EMS personnel that responded.")
|
| 68 |
+
MAidPersonnelOtherCount: Optional[int] = Field(None, description="Number of mutual aid other personnel that responded.")
|
| 69 |
+
MaidPersonnelTotalCount: Optional[int] = Field(None, description="Total number of mutual aid personnel that responded.")
|
| 70 |
+
LossProperty: Optional[float] = Field(None, description="Value of property loss.")
|
| 71 |
+
LossContents: Optional[float] = Field(None, description="Value of contents loss.")
|
| 72 |
+
ValueProperty: Optional[float] = Field(None, description="Value of property at risk.")
|
| 73 |
+
ValueContents: Optional[float] = Field(None, description="Value of contents at risk.")
|
| 74 |
+
LossTotal: Optional[float] = Field(None, description="Total value of loss (property + contents).")
|
| 75 |
+
ValueTotal: Optional[float] = Field(None, description="Total value at risk (property + contents).")
|
| 76 |
+
ValueSaved: Optional[float] = Field(None, description="Total value saved.")
|
| 77 |
+
DetectorAlertedCode: Optional[str] = Field(None, description="Code indicating if and how a detector alerted occupants.")
|
| 78 |
+
DetectorAlertedDescrip: Optional[str] = Field(None, description="Textual description of how the detector alerted.")
|
| 79 |
+
HazardMaterialReleasedCode: Optional[str] = Field(None, description="Code indicating if a hazardous material was released.")
|
| 80 |
+
HazardMaterialReleasedDescrip: Optional[str] = Field(None, description="Textual description of the hazardous material released.")
|
| 81 |
+
PropertyUseCode: Optional[str] = Field(None, description="Code for the primary use of the property.")
|
| 82 |
+
PropertyUseDescrip: Optional[str] = Field(None, description="Textual description of the property use.")
|
| 83 |
+
MixedUseCode: Optional[str] = Field(None, description="Code indicating if the property has mixed uses.")
|
| 84 |
+
MixedUseDescrip: Optional[str] = Field(None, description="Textual description of the mixed use.")
|
| 85 |
+
StreetNumber: Optional[str] = Field(None, description="The street number of the incident location.")
|
| 86 |
+
StreetPrefix: Optional[str] = Field(None, description="The street prefix (e.g., N, S, E, W).")
|
| 87 |
+
StreetName: Optional[str] = Field(None, description="The name of the street.")
|
| 88 |
+
StreetType: Optional[str] = Field(None, description="The street type (e.g., St, Ave, Rd).")
|
| 89 |
+
StreetSuffix: Optional[str] = Field(None, description="The street suffix.")
|
| 90 |
+
Apartment: Optional[str] = Field(None, description="Apartment or unit number.")
|
| 91 |
+
City: Optional[str] = Field(None, description="The city of the incident location.")
|
| 92 |
+
State: Optional[str] = Field(None, description="The state of the incident location.")
|
| 93 |
+
ZipCode: Optional[str] = Field(None, description="The zip code of the incident location.")
|
| 94 |
+
AddressComposite: Optional[str] = Field(None, description="A concatenated string of the full, formatted street address.")
|
| 95 |
+
CityStateZipComposite: Optional[str] = Field(None, description="A concatenated string of the city, state, and zip code.")
|
| 96 |
+
CensusTract: Optional[str] = Field(None, description="The census tract of the incident location.")
|
| 97 |
+
EmsProvidedCode: Optional[str] = Field(None, description="Code indicating if EMS was provided.")
|
| 98 |
+
EMSProvidedDescrip: Optional[str] = Field(None, description="Textual description of EMS provided.")
|
| 99 |
+
LocationTypeCode: Optional[str] = Field(None, description="Code for the type of location (e.g., building, street).")
|
| 100 |
+
LocationTypeDescrip: Optional[str] = Field(None, description="Textual description of the location type.")
|
| 101 |
+
fatalfireservicecode: Optional[str] = Field(None, description="Code indicating a firefighter fatality.")
|
| 102 |
+
fatalfireservicedescrip: Optional[str] = Field(None, description="Description of firefighter fatality.")
|
| 103 |
+
fatalciviliancode: Optional[str] = Field(None, description="Code indicating a civilian fatality.")
|
| 104 |
+
fatalciviliandescrip: Optional[str] = Field(None, description="Description of civilian fatality.")
|
| 105 |
+
injuredfireservicecode: Optional[str] = Field(None, description="Code indicating a firefighter injury.")
|
| 106 |
+
injuredfireservicedescrip: Optional[str] = Field(None, description="Description of firefighter injury.")
|
| 107 |
+
injuredciviliancode: Optional[str] = Field(None, description="Code indicating a civilian injury.")
|
| 108 |
+
injuredciviliandescrip: Optional[str] = Field(None, description="Description of civilian injury.")
|
| 109 |
+
casualtiescode: Optional[str] = Field(None, description="Code indicating casualties.")
|
| 110 |
+
casualtiesdescrip: Optional[str] = Field(None, description="Description of casualties.")
|
| 111 |
+
priorityrespcode: Optional[str] = Field(None, description="Code indicating priority of response.")
|
| 112 |
+
priorityrespdescrip: Optional[str] = Field(None, description="Description of priority response.")
|
| 113 |
+
crossstreetprefix: Optional[str] = Field(None, description="Prefix for the nearest cross street.")
|
| 114 |
+
crossstreetname: Optional[str] = Field(None, description="Name of the nearest cross street.")
|
| 115 |
+
crossstreettype: Optional[str] = Field(None, description="Type of the nearest cross street.")
|
| 116 |
+
crossstreetsuffix: Optional[str] = Field(None, description="Suffix for the nearest cross street.")
|
| 117 |
+
CrossStreetComposite: Optional[str] = Field(None, description="Concatenated string of the nearest cross street.")
|
| 118 |
+
directions: Optional[str] = Field(None, description="Special directions to the incident location.")
|
| 119 |
+
county: Optional[str] = Field(None, description="The county of the incident location.")
|
| 120 |
+
mappage: Optional[str] = Field(None, description="Map page or grid reference.")
|
| 121 |
+
hwycalloutrequestby: Optional[str] = Field(None, description="Highway incident: who requested the call out.")
|
| 122 |
+
hwyinvestpolicecode: Optional[str] = Field(None, description="Highway incident: code for police investigation.")
|
| 123 |
+
hwyinvetpolicedescrip: Optional[str] = Field(None, description="Highway incident: description of police investigation.")
|
| 124 |
+
hwyofficer: Optional[str] = Field(None, description="Highway incident: name of the officer.")
|
| 125 |
+
hwybadgenumber: Optional[str] = Field(None, description="Highway incident: badge number of the officer.")
|
| 126 |
+
hwyreportnumber: Optional[str] = Field(None, description="Highway incident: report number.")
|
| 127 |
+
hwycauseemergcode: Optional[str] = Field(None, description="Highway incident: code for the cause of the emergency.")
|
| 128 |
+
hwycauseemergdescrip: Optional[str] = Field(None, description="Highway incident: description of the cause.")
|
| 129 |
+
hwycauseotherdescrip: Optional[str] = Field(None, description="Highway incident: other cause description.")
|
| 130 |
+
hwyloecode: Optional[str] = Field(None, description="Highway incident: code for the location of the emergency.")
|
| 131 |
+
hwyloedescrip: Optional[str] = Field(None, description="Highway incident: description of the location.")
|
| 132 |
+
hwyloeotherdescrip: Optional[str] = Field(None, description="Highway incident: other location description.")
|
| 133 |
+
hwyobstrcutioncode: Optional[str] = Field(None, description="Highway incident: code for obstructions.")
|
| 134 |
+
hwyobstructiondescrip: Optional[str] = Field(None, description="Highway incident: description of obstructions.")
|
| 135 |
+
hwyobstructionotherdescrip: Optional[str] = Field(None, description="Highway incident: other obstruction description.")
|
| 136 |
+
hwynoservicecode: Optional[str] = Field(None, description="Highway incident: code for no service.")
|
| 137 |
+
hwynoservicedescrip: Optional[str] = Field(None, description="Highway incident: description of no service.")
|
| 138 |
+
hwyextinguishcode: Optional[str] = Field(None, description="Highway incident: code for extinguishment.")
|
| 139 |
+
hwyextinguishdescrip: Optional[str] = Field(None, description="Highway incident: description of extinguishment.")
|
| 140 |
+
hwycleanupcode: Optional[str] = Field(None, description="Highway incident: code for cleanup.")
|
| 141 |
+
hwycleanupdescrip: Optional[str] = Field(None, description="Highway incident: description of cleanup.")
|
| 142 |
+
hwyextractioncode: Optional[str] = Field(None, description="Highway incident: code for extraction.")
|
| 143 |
+
hwyextractiodescrip: Optional[str] = Field(None, description="Highway incident: description of extraction.")
|
| 144 |
+
hwyfirstaidcode: Optional[str] = Field(None, description="Highway incident: code for first aid.")
|
| 145 |
+
hwyfirstaidedescrip: Optional[str] = Field(None, description="Highway incident: description of first aid.")
|
| 146 |
+
hwydamagecode: Optional[str] = Field(None, description="Highway incident: code for property damage.")
|
| 147 |
+
hwydamagedescrip: Optional[str] = Field(None, description="Highway incident: description of property damage.")
|
| 148 |
+
hwyprivatedamcode: Optional[str] = Field(None, description="Highway incident: code for private property damage.")
|
| 149 |
+
hwyprivatedescrip: Optional[str] = Field(None, description="Highway incident: description of private damage.")
|
| 150 |
+
hwycitycode: Optional[str] = Field(None, description="Highway incident: code for city property damage.")
|
| 151 |
+
hwycitydescrip: Optional[str] = Field(None, description="Highway incident: description of city damage.")
|
| 152 |
+
hwyothercode: Optional[str] = Field(None, description="Highway incident: code for other actions.")
|
| 153 |
+
hwynotherdescrip: Optional[str] = Field(None, description="Highway incident: description of other actions.")
|
| 154 |
+
hwyothertext: Optional[str] = Field(None, description="Highway incident: other text.")
|
| 155 |
+
water_used: Optional[str] = Field(None, description="Flag indicating if water was used.")
|
| 156 |
+
water_used_quantity: Optional[float] = Field(None, description="Quantity of water used.")
|
| 157 |
+
foam_used: Optional[str] = Field(None, description="Flag indicating if foam was used.")
|
| 158 |
+
foam_used_quantity: Optional[float] = Field(None, description="Quantity of foam used.")
|
| 159 |
+
oilzorb_used: Optional[str] = Field(None, description="Flag indicating if oil/zorb was used.")
|
| 160 |
+
oilzorb_used_quantity: Optional[float] = Field(None, description="Quantity of oil/zorb used.")
|
| 161 |
+
other_used: Optional[str] = Field(None, description="Flag indicating if other agents were used.")
|
| 162 |
+
other_used_quantity: Optional[float] = Field(None, description="Quantity of other agents used.")
|
| 163 |
+
codetectpresentcode: Optional[str] = Field(None, description="Code indicating if a CO detector was present.")
|
| 164 |
+
codetectpresentdescrip: Optional[str] = Field(None, description="Description of CO detector presence.")
|
| 165 |
+
cotypecode: Optional[str] = Field(None, description="Code for the type of CO detector.")
|
| 166 |
+
cotypedescrip: Optional[str] = Field(None, description="Description of the type of CO detector.")
|
| 167 |
+
copowersupplycode: Optional[str] = Field(None, description="Code for the power supply of the CO detector.")
|
| 168 |
+
copowersupplydescrip: Optional[str] = Field(None, description="Description of the power supply.")
|
| 169 |
+
cooperationcode: Optional[str] = Field(None, description="Code indicating if the CO detector was operational.")
|
| 170 |
+
cooperationdescrip: Optional[str] = Field(None, description="Description of CO detector operation.")
|
| 171 |
+
coeffectivecode: Optional[str] = Field(None, description="Code indicating if the CO detector was effective.")
|
| 172 |
+
coeffectivedescrip: Optional[str] = Field(None, description="Description of CO detector effectiveness.")
|
| 173 |
+
cofailurecode: Optional[str] = Field(None, description="Code indicating CO detector failure.")
|
| 174 |
+
cofailuredescrip: Optional[str] = Field(None, description="Description of CO detector failure.")
|
| 175 |
+
codetectormfg: Optional[str] = Field(None, description="Manufacturer of the CO detector.")
|
| 176 |
+
codetectormodel: Optional[str] = Field(None, description="Model of the CO detector.")
|
| 177 |
+
cochildrencount: Optional[int] = Field(None, description="Number of children affected by CO incident.")
|
| 178 |
+
coyouthscount: Optional[int] = Field(None, description="Number of youths affected by CO incident.")
|
| 179 |
+
coadultscount: Optional[int] = Field(None, description="Number of adults affected by CO incident.")
|
| 180 |
+
coseniorscount: Optional[int] = Field(None, description="Number of seniors affected by CO incident.")
|
| 181 |
+
latitude: Optional[float] = Field(None, description="Latitude of the incident location.")
|
| 182 |
+
longitude: Optional[float] = Field(None, description="Longitude of the incident location.")
|
| 183 |
+
changedate: Optional[datetime] = Field(None, description="Timestamp when the record was last changed.")
|
| 184 |
+
IncidentDateTime: Optional[datetime] = Field(None, description="Combined incident date and time.")
|
| 185 |
+
Incidenttime: Optional[str] = Field(None, description="Time portion of the incident timestamp.")
|
| 186 |
+
Incidentdate: Optional[str] = Field(None, description="Date portion of the incident timestamp.")
|
| 187 |
+
memberdescrip: Optional[str] = Field(None, description="The role or description of the crew member who made the report.")
|
| 188 |
+
memberidnumber: Optional[str] = Field(None, description="The unique identifier or employee ID number for the reporting member.")
|
| 189 |
+
membernamelast: Optional[str] = Field(None, description="Last name of the reporting member.")
|
| 190 |
+
membernamefirst: Optional[str] = Field(None, description="First name of the reporting member.")
|
| 191 |
+
membermi: Optional[str] = Field(None, description="Middle initial of the reporting member.")
|
| 192 |
+
memberpositiondescrip: Optional[str] = Field(None, description="The job title or rank of the reporting member.")
|
| 193 |
+
memberassignmentdescrip: Optional[str] = Field(None, description="The crew or unit assignment of the reporting member.")
|
src/entities/auv_incidentpersonnel/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from _model import *
|
| 2 |
+
from _schema import *
|
src/entities/auv_incidentpersonnel/_model.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import Column, String, Integer, Float
|
| 2 |
+
from database import Base
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class IncidentPersonnelModel(Base):
|
| 6 |
+
__tablename__ = "auv_incidentpersonnel"
|
| 7 |
+
|
| 8 |
+
personnelkey = Column(String(14), primary_key=True, index=True)
|
| 9 |
+
namefirst = Column(String(25))
|
| 10 |
+
namemi = Column(String(2))
|
| 11 |
+
namelast = Column(String(25))
|
| 12 |
+
namesuffix = Column(String(5))
|
| 13 |
+
rank = Column(String(10))
|
| 14 |
+
actiontaken1code = Column(String(10))
|
| 15 |
+
actiontaken1descip = Column(String(255))
|
| 16 |
+
actiontaken2code = Column(String(10))
|
| 17 |
+
actiontaken2descip = Column(String(255))
|
| 18 |
+
actiontaken3code = Column(String(10))
|
| 19 |
+
actiontaken3descip = Column(String(255))
|
| 20 |
+
actiontaken4code = Column(String(10))
|
| 21 |
+
actiontaken4descip = Column(String(255))
|
| 22 |
+
amount1 = Column(Float)
|
| 23 |
+
amount2 = Column(Float)
|
| 24 |
+
crole = Column(Integer)
|
| 25 |
+
losapcreditcode = Column(Integer)
|
| 26 |
+
losapcreditdescrip = Column(String(100))
|
| 27 |
+
apparatusid = Column(String(10))
|
| 28 |
+
numberofresponders = Column(Integer)
|
| 29 |
+
responsetimeseconds = Column(Integer)
|
| 30 |
+
dispatchcleardiffseconds = Column(Integer)
|
src/entities/auv_incidentpersonnel/_schema.py
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Optional
|
| 2 |
+
from pydantic import BaseModel, Field
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class IncidentPersonnelSchema(BaseModel):
|
| 6 |
+
"""
|
| 7 |
+
Schema representing personnel assigned to a fire incident.
|
| 8 |
+
This table links firefighters/personnel with apparatus and incidents,
|
| 9 |
+
including their actions, response details, and role during the event.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
personnelkey: str = Field(
|
| 13 |
+
...,
|
| 14 |
+
max_length=14,
|
| 15 |
+
description="Unique system-generated identifier for a personnel assignment record in an incident. "
|
| 16 |
+
"Used as the primary key linking personnel activity within the incident dataset.",
|
| 17 |
+
examples=["_4GR15265W_SMS"]
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
namefirst: Optional[str] = Field(
|
| 21 |
+
None,
|
| 22 |
+
max_length=25,
|
| 23 |
+
description="First name of the firefighter or personnel.",
|
| 24 |
+
examples=["Dale", "Brandon", "Kyle"]
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
namemi: Optional[str] = Field(
|
| 28 |
+
None,
|
| 29 |
+
max_length=2,
|
| 30 |
+
description="Middle initial of the firefighter or personnel.",
|
| 31 |
+
examples=["E", "A", "S"]
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
namelast: Optional[str] = Field(
|
| 35 |
+
None,
|
| 36 |
+
max_length=25,
|
| 37 |
+
description="Last name of the firefighter or personnel.",
|
| 38 |
+
examples=["Bryan", "Davis", "Coles"]
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
namesuffix: Optional[str] = Field(
|
| 42 |
+
None,
|
| 43 |
+
max_length=5,
|
| 44 |
+
description="Name suffix such as Jr., Sr., or III.",
|
| 45 |
+
examples=["Jr", "III"]
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
rank: Optional[str] = Field(
|
| 49 |
+
None,
|
| 50 |
+
max_length=10,
|
| 51 |
+
description="Rank or title of the personnel during service.",
|
| 52 |
+
examples=["CAPT", "FF", "ENG"]
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
actiontaken1code: Optional[str] = Field(
|
| 56 |
+
None,
|
| 57 |
+
max_length=10,
|
| 58 |
+
description="Code representing the primary action taken by the personnel during the incident.",
|
| 59 |
+
examples=["93"]
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
actiontaken1descip: Optional[str] = Field(
|
| 63 |
+
None,
|
| 64 |
+
max_length=255,
|
| 65 |
+
description="Description of the primary action taken.",
|
| 66 |
+
examples=["Cancelled en route"]
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
actiontaken2code: Optional[str] = Field(
|
| 70 |
+
None,
|
| 71 |
+
max_length=10,
|
| 72 |
+
description="Code representing the secondary action taken by personnel."
|
| 73 |
+
)
|
| 74 |
+
|
| 75 |
+
actiontaken2descip: Optional[str] = Field(
|
| 76 |
+
None,
|
| 77 |
+
max_length=255,
|
| 78 |
+
description="Description of the secondary action taken."
|
| 79 |
+
)
|
| 80 |
+
|
| 81 |
+
actiontaken3code: Optional[str] = Field(
|
| 82 |
+
None,
|
| 83 |
+
max_length=10,
|
| 84 |
+
description="Code representing the tertiary action taken by personnel."
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
actiontaken3descip: Optional[str] = Field(
|
| 88 |
+
None,
|
| 89 |
+
max_length=255,
|
| 90 |
+
description="Description of the tertiary action taken."
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
actiontaken4code: Optional[str] = Field(
|
| 94 |
+
None,
|
| 95 |
+
max_length=10,
|
| 96 |
+
description="Code representing the fourth action taken by personnel."
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
actiontaken4descip: Optional[str] = Field(
|
| 100 |
+
None,
|
| 101 |
+
max_length=255,
|
| 102 |
+
description="Description of the fourth action taken."
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
amount1: Optional[float] = Field(
|
| 106 |
+
None,
|
| 107 |
+
description="Generic numeric value related to incident reporting or action measurement."
|
| 108 |
+
)
|
| 109 |
+
|
| 110 |
+
amount2: Optional[float] = Field(
|
| 111 |
+
None,
|
| 112 |
+
description="Secondary numeric value used for reporting metrics."
|
| 113 |
+
)
|
| 114 |
+
|
| 115 |
+
crole: Optional[int] = Field(
|
| 116 |
+
None,
|
| 117 |
+
description="Code indicating the operational role of the personnel during the incident.",
|
| 118 |
+
examples=[1, 2]
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
losapcreditcode: Optional[int] = Field(
|
| 122 |
+
None,
|
| 123 |
+
description="Code indicating whether LOSAP (Length of Service Award Program) credit was awarded.",
|
| 124 |
+
examples=[1]
|
| 125 |
+
)
|
| 126 |
+
|
| 127 |
+
losapcreditdescrip: Optional[str] = Field(
|
| 128 |
+
None,
|
| 129 |
+
max_length=100,
|
| 130 |
+
description="Description indicating LOSAP credit eligibility.",
|
| 131 |
+
examples=["Losap Credit"]
|
| 132 |
+
)
|
| 133 |
+
|
| 134 |
+
apparatusid: Optional[str] = Field(
|
| 135 |
+
None,
|
| 136 |
+
max_length=10,
|
| 137 |
+
description="Human-readable identifier for the responding apparatus or unit.",
|
| 138 |
+
examples=["BE7", "BE6", "BE3"]
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
numberofresponders: Optional[int] = Field(
|
| 142 |
+
None,
|
| 143 |
+
description="Total number of personnel responding on this apparatus."
|
| 144 |
+
)
|
| 145 |
+
|
| 146 |
+
responsetimeseconds: Optional[int] = Field(
|
| 147 |
+
None,
|
| 148 |
+
description="Total time from dispatch to arrival at the scene expressed in seconds.",
|
| 149 |
+
examples=[159, 292]
|
| 150 |
+
)
|
| 151 |
+
|
| 152 |
+
dispatchcleardiffseconds: Optional[int] = Field(
|
| 153 |
+
None,
|
| 154 |
+
description="Total time from dispatch until the unit cleared the incident.",
|
| 155 |
+
examples=[466, 1218]
|
| 156 |
+
)
|
src/entities/base/_model.py
CHANGED
|
@@ -10,12 +10,7 @@ class BaseModel_(Base):
|
|
| 10 |
__abstract__ = True # This model should not be instantiated directly
|
| 11 |
__table_args__ = {"extend_existing": True} # Allow table extension
|
| 12 |
|
| 13 |
-
|
| 14 |
-
created_at = Column(DateTime, server_default=func.now(), nullable=False)
|
| 15 |
-
updated_at = Column(
|
| 16 |
-
DateTime, server_default=func.now(), onupdate=func.now(), nullable=False
|
| 17 |
-
)
|
| 18 |
-
deleted_at = Column(DateTime, nullable=True)
|
| 19 |
|
| 20 |
def to_dict(self, keys_not_to_include: list[str] = []) -> dict:
|
| 21 |
return {
|
|
|
|
| 10 |
__abstract__ = True # This model should not be instantiated directly
|
| 11 |
__table_args__ = {"extend_existing": True} # Allow table extension
|
| 12 |
|
| 13 |
+
created = Column(DateTime, server_default=func.now(), nullable=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
def to_dict(self, keys_not_to_include: list[str] = []) -> dict:
|
| 16 |
return {
|
src/entities/incident/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from _model import *
|
| 2 |
+
from _schema import *
|
src/entities/incident/_model.py
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import Column, String, Integer, Float, Boolean, DateTime, Text, Numeric
|
| 2 |
+
from sqlalchemy.orm import relationship
|
| 3 |
+
from base import BaseModel_
|
| 4 |
+
|
| 5 |
+
class IncidentModel(BaseModel_):
|
| 6 |
+
__tablename__ = "incident"
|
| 7 |
+
|
| 8 |
+
incidentkey = Column(String(14), primary_key=True, index=True)
|
| 9 |
+
incidentdate = Column(DateTime)
|
| 10 |
+
incidentnumber = Column(String(10))
|
| 11 |
+
exposure = Column(String(3))
|
| 12 |
+
incidentstatus = Column(String(20))
|
| 13 |
+
reviewstatusflag = Column(Boolean, nullable=False)
|
| 14 |
+
publicreleaseflag = Column(Boolean, nullable=False)
|
| 15 |
+
completed = Column(Boolean, nullable=False)
|
| 16 |
+
transactiontype = Column(String(4))
|
| 17 |
+
district = Column(String(10))
|
| 18 |
+
station = Column(String(30))
|
| 19 |
+
shift = Column(String(2))
|
| 20 |
+
company = Column(String(64))
|
| 21 |
+
incidenttype = Column(String(4), nullable=False)
|
| 22 |
+
initialdispatchcode = Column(String(25))
|
| 23 |
+
mutualaidcode = Column(String(4), nullable=False)
|
| 24 |
+
alarmdate = Column(DateTime)
|
| 25 |
+
arrivaldate = Column(DateTime)
|
| 26 |
+
didnotarriveflag = Column(Boolean, nullable=False)
|
| 27 |
+
controlleddate = Column(DateTime)
|
| 28 |
+
lastunitcleareddate = Column(DateTime)
|
| 29 |
+
includemutualaidflag = Column(Boolean, nullable=False)
|
| 30 |
+
madepartment = Column(String(30))
|
| 31 |
+
madeptincidentno = Column(String(9))
|
| 32 |
+
alarms = Column(Integer)
|
| 33 |
+
actiontaken1 = Column(String(4))
|
| 34 |
+
actiontaken2 = Column(String(4))
|
| 35 |
+
actiontaken3 = Column(String(4))
|
| 36 |
+
resourceformusedflag = Column(Boolean, nullable=False)
|
| 37 |
+
apparatussuppression = Column(Integer)
|
| 38 |
+
apparatusems = Column(Integer)
|
| 39 |
+
apparatusother = Column(Integer)
|
| 40 |
+
personnelsuppression = Column(Integer)
|
| 41 |
+
personnelems = Column(Integer)
|
| 42 |
+
personnelother = Column(Integer)
|
| 43 |
+
lossproperty = Column(Numeric)
|
| 44 |
+
losscontents = Column(Numeric)
|
| 45 |
+
valueproperty = Column(Numeric)
|
| 46 |
+
valuecontents = Column(Numeric)
|
| 47 |
+
fatalfireservice = Column(Integer)
|
| 48 |
+
fatalother = Column(Integer)
|
| 49 |
+
nonfatalfireservice = Column(Integer)
|
| 50 |
+
nonfatalother = Column(Integer)
|
| 51 |
+
detector = Column(String(4))
|
| 52 |
+
hazardmaterialreleased = Column(String(4))
|
| 53 |
+
mixeduse = Column(String(4))
|
| 54 |
+
propertyuse = Column(String(4))
|
| 55 |
+
emsprovidedflag = Column(Boolean, nullable=False)
|
| 56 |
+
casualtiesflag = Column(Integer)
|
| 57 |
+
priorityresponseflag = Column(Boolean)
|
| 58 |
+
vendorid = Column(String(20))
|
| 59 |
+
locationtype = Column(Float)
|
| 60 |
+
censustract = Column(String(7))
|
| 61 |
+
numberormile = Column(String(8))
|
| 62 |
+
streetprefix = Column(String(2))
|
| 63 |
+
streethighway = Column(String(30))
|
| 64 |
+
streettype = Column(String(4))
|
| 65 |
+
streetsuffix = Column(String(2))
|
| 66 |
+
apartment = Column(String(15))
|
| 67 |
+
city = Column(String(20))
|
| 68 |
+
state = Column(String(2))
|
| 69 |
+
postalcode = Column(String(20))
|
| 70 |
+
directions = Column(Text)
|
| 71 |
+
latitude = Column(String(20))
|
| 72 |
+
longitude = Column(String(20))
|
| 73 |
+
compositeaddress = Column(String(50), nullable=False)
|
| 74 |
+
county = Column(String(20))
|
| 75 |
+
occupancykey = Column(String(14))
|
| 76 |
+
occupancynumber = Column(String(16))
|
| 77 |
+
occupancyname = Column(String(40))
|
| 78 |
+
runcard = Column(String(8))
|
| 79 |
+
mappage = Column(String(20))
|
| 80 |
+
descrip = Column(String(30))
|
| 81 |
+
addressvalidated = Column(Integer)
|
| 82 |
+
CADCompleted = Column(Boolean)
|
| 83 |
+
changedate = Column(DateTime)
|
| 84 |
+
rowguid = Column(String(50))
|
| 85 |
+
LogComments = Column(Text)
|
| 86 |
+
Incident_ID = Column(Integer, nullable=False)
|
| 87 |
+
loss_not_known = Column(Boolean, nullable=False)
|
| 88 |
+
collecteddate = Column(DateTime)
|
| 89 |
+
DispatchIncType = Column(String(80))
|
| 90 |
+
nfscasualtycnt = Column(Integer)
|
| 91 |
+
ncivcasualtycnt = Column(Integer)
|
| 92 |
+
psaptime = Column(DateTime)
|
| 93 |
+
ResponseType = Column(String(10))
|
| 94 |
+
CADText1 = Column(String(50))
|
| 95 |
+
CADText2 = Column(String(50))
|
| 96 |
+
CADText3 = Column(String(50))
|
| 97 |
+
CADCombo1 = Column(String(50))
|
| 98 |
+
CADCombo2 = Column(String(50))
|
| 99 |
+
CADCombo3 = Column(String(50))
|
| 100 |
+
GMTOffSet = Column(String(6))
|
| 101 |
+
CADDate1 = Column(DateTime)
|
| 102 |
+
CADDate2 = Column(DateTime)
|
| 103 |
+
CADDate3 = Column(DateTime)
|
| 104 |
+
responseTime = Column(String(20))
|
| 105 |
+
turnTime = Column(String(20))
|
| 106 |
+
Mapset = Column(String(6))
|
| 107 |
+
Easting = Column(String(5))
|
| 108 |
+
Northing = Column(String(5))
|
| 109 |
+
|
| 110 |
+
# relationships
|
| 111 |
+
apparatus = relationship("Apparatus", back_populates="incident")
|
| 112 |
+
personnel = relationship("Personnel", back_populates="incident")
|
| 113 |
+
incident_apparatus = relationship("IncidentApparatusModel", back_populates="incident")
|
src/entities/incident/_schema.py
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import Field
|
| 2 |
+
from typing import Optional
|
| 3 |
+
from datetime import datetime
|
| 4 |
+
from base import BaseSchema
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class IncidentSchema(BaseSchema):
|
| 8 |
+
|
| 9 |
+
incidentkey: str = Field(..., description="Primary key for the incident record.", example="_48Y00K5I8_SMS")
|
| 10 |
+
|
| 11 |
+
incidentdate: Optional[datetime] = Field(None, description="Date and time when the incident occurred.")
|
| 12 |
+
|
| 13 |
+
incidentnumber: Optional[str] = Field(None, description="Public facing incident number.", example="1500003")
|
| 14 |
+
|
| 15 |
+
exposure: Optional[str] = Field(None, description="Exposure number representing related incidents.", example="0")
|
| 16 |
+
|
| 17 |
+
incidentstatus: Optional[str] = Field(None, description="Status of the incident report.")
|
| 18 |
+
|
| 19 |
+
reviewstatusflag: bool = Field(..., description="Indicates if the incident report has been reviewed.", example=False)
|
| 20 |
+
|
| 21 |
+
publicreleaseflag: bool = Field(..., description="Indicates if the report is approved for public release.")
|
| 22 |
+
|
| 23 |
+
completed: bool = Field(..., description="Indicates whether the incident report is complete.")
|
| 24 |
+
|
| 25 |
+
transactiontype: Optional[str] = Field(None, description="Internal transaction type for database sync.")
|
| 26 |
+
|
| 27 |
+
district: Optional[str] = Field(None, description="Fire district where the incident occurred.", example="B07")
|
| 28 |
+
|
| 29 |
+
station: Optional[str] = Field(None, description="Station responsible for the incident.", example="B7")
|
| 30 |
+
|
| 31 |
+
shift: Optional[str] = Field(None, description="Duty shift active during the incident.", example="B")
|
| 32 |
+
|
| 33 |
+
company: Optional[str] = Field(None, description="Legacy company identifier.")
|
| 34 |
+
|
| 35 |
+
incidenttype: str = Field(..., description="NFIRS classification code for incident type.", example="321")
|
| 36 |
+
|
| 37 |
+
initialdispatchcode: Optional[str] = Field(None, description="Dispatch center code.", example="FWX")
|
| 38 |
+
|
| 39 |
+
mutualaidcode: str = Field(..., description="Mutual aid participation code.", example="N")
|
| 40 |
+
|
| 41 |
+
alarmdate: Optional[datetime] = Field(None, description="Time when the incident alarm was received.")
|
| 42 |
+
|
| 43 |
+
arrivaldate: Optional[datetime] = Field(None, description="Time when the first unit arrived.")
|
| 44 |
+
|
| 45 |
+
didnotarriveflag: bool = Field(..., description="Indicates if units were cancelled before arrival.")
|
| 46 |
+
|
| 47 |
+
controlleddate: Optional[datetime] = Field(None, description="Time when the incident was controlled.")
|
| 48 |
+
|
| 49 |
+
lastunitcleareddate: Optional[datetime] = Field(None, description="Time when the last unit cleared the scene.")
|
| 50 |
+
|
| 51 |
+
includemutualaidflag: bool = Field(..., description="Indicates if mutual aid resources participated.")
|
| 52 |
+
|
| 53 |
+
madepartment: Optional[str] = Field(None, description="Mutual aid department name.")
|
| 54 |
+
|
| 55 |
+
madeptincidentno: Optional[str] = Field(None, description="Mutual aid department incident number.")
|
| 56 |
+
|
| 57 |
+
alarms: Optional[int] = Field(None, description="Number of alarms dispatched.", example=1)
|
| 58 |
+
|
| 59 |
+
actiontaken1: Optional[str] = Field(None, description="Primary action taken.")
|
| 60 |
+
|
| 61 |
+
actiontaken2: Optional[str] = Field(None, description="Secondary action taken.")
|
| 62 |
+
|
| 63 |
+
actiontaken3: Optional[str] = Field(None, description="Tertiary action taken.")
|
| 64 |
+
|
| 65 |
+
resourceformusedflag: bool = Field(..., description="Indicates if resource form was used.")
|
| 66 |
+
|
| 67 |
+
apparatussuppression: Optional[int] = Field(None, description="Number of suppression apparatus.")
|
| 68 |
+
|
| 69 |
+
apparatusems: Optional[int] = Field(None, description="Number of EMS apparatus.")
|
| 70 |
+
|
| 71 |
+
apparatusother: Optional[int] = Field(None, description="Other apparatus responding.")
|
| 72 |
+
|
| 73 |
+
personnelsuppression: Optional[int] = Field(None, description="Suppression personnel count.")
|
| 74 |
+
|
| 75 |
+
personnelems: Optional[int] = Field(None, description="EMS personnel count.")
|
| 76 |
+
|
| 77 |
+
personnelother: Optional[int] = Field(None, description="Other personnel responding.")
|
| 78 |
+
|
| 79 |
+
lossproperty: Optional[float] = Field(None, description="Estimated property loss.")
|
| 80 |
+
|
| 81 |
+
losscontents: Optional[float] = Field(None, description="Estimated contents loss.")
|
| 82 |
+
|
| 83 |
+
valueproperty: Optional[float] = Field(None, description="Estimated property value before incident.")
|
| 84 |
+
|
| 85 |
+
valuecontents: Optional[float] = Field(None, description="Estimated contents value before incident.")
|
| 86 |
+
|
| 87 |
+
fatalfireservice: Optional[int] = Field(None, description="Fire service fatalities.")
|
| 88 |
+
|
| 89 |
+
fatalother: Optional[int] = Field(None, description="Civilian fatalities.")
|
| 90 |
+
|
| 91 |
+
nonfatalfireservice: Optional[int] = Field(None, description="Non fatal injuries to firefighters.")
|
| 92 |
+
|
| 93 |
+
nonfatalother: Optional[int] = Field(None, description="Civilian injuries.")
|
| 94 |
+
|
| 95 |
+
detector: Optional[str] = Field(None, description="Smoke detector presence code.")
|
| 96 |
+
|
| 97 |
+
hazardmaterialreleased: Optional[str] = Field(None, description="Hazardous material release code.")
|
| 98 |
+
|
| 99 |
+
mixeduse: Optional[str] = Field(None, description="Mixed occupancy usage code.")
|
| 100 |
+
|
| 101 |
+
propertyuse: Optional[str] = Field(None, description="NFIRS property use classification.")
|
| 102 |
+
|
| 103 |
+
emsprovidedflag: bool = Field(..., description="Indicates EMS services were provided.")
|
| 104 |
+
|
| 105 |
+
casualtiesflag: Optional[int] = Field(None, description="Indicates casualties occurred.")
|
| 106 |
+
|
| 107 |
+
priorityresponseflag: Optional[bool] = Field(None, description="Indicates priority emergency response.")
|
| 108 |
+
|
| 109 |
+
vendorid: Optional[str] = Field(None, description="Vendor system identifier.")
|
| 110 |
+
|
| 111 |
+
locationtype: Optional[float] = Field(None, description="Location classification type.")
|
| 112 |
+
|
| 113 |
+
censustract: Optional[str] = Field(None, description="Census tract identifier.")
|
| 114 |
+
|
| 115 |
+
numberormile: Optional[str] = Field(None, description="Street number or mile marker.")
|
| 116 |
+
|
| 117 |
+
streetprefix: Optional[str] = Field(None, description="Street directional prefix.")
|
| 118 |
+
|
| 119 |
+
streethighway: Optional[str] = Field(None, description="Street or highway name.")
|
| 120 |
+
|
| 121 |
+
streettype: Optional[str] = Field(None, description="Street type (St, Rd, Ave).")
|
| 122 |
+
|
| 123 |
+
streetsuffix: Optional[str] = Field(None, description="Directional suffix.")
|
| 124 |
+
|
| 125 |
+
apartment: Optional[str] = Field(None, description="Apartment or unit number.")
|
| 126 |
+
|
| 127 |
+
city: Optional[str] = Field(None, description="City of incident.", example="Bakersfield")
|
| 128 |
+
|
| 129 |
+
state: Optional[str] = Field(None, description="State abbreviation.", example="CA")
|
| 130 |
+
|
| 131 |
+
postalcode: Optional[str] = Field(None, description="ZIP code.", example="93309")
|
| 132 |
+
|
| 133 |
+
directions: Optional[str] = Field(None, description="Additional location directions.")
|
| 134 |
+
|
| 135 |
+
latitude: Optional[str] = Field(None, description="Latitude coordinate.")
|
| 136 |
+
|
| 137 |
+
longitude: Optional[str] = Field(None, description="Longitude coordinate.")
|
| 138 |
+
|
| 139 |
+
compositeaddress: str = Field(..., description="Full combined address.", example="2601 S REAL RD 77")
|
| 140 |
+
|
| 141 |
+
county: Optional[str] = Field(None, description="County name.", example="KERN")
|
| 142 |
+
|
| 143 |
+
occupancykey: Optional[str] = Field(None, description="Occupancy identifier.")
|
| 144 |
+
|
| 145 |
+
occupancynumber: Optional[str] = Field(None, description="Occupancy number.")
|
| 146 |
+
|
| 147 |
+
occupancyname: Optional[str] = Field(None, description="Occupancy name.")
|
| 148 |
+
|
| 149 |
+
runcard: Optional[str] = Field(None, description="Dispatch run card.")
|
| 150 |
+
|
| 151 |
+
mappage: Optional[str] = Field(None, description="Map page reference.")
|
| 152 |
+
|
| 153 |
+
descrip: Optional[str] = Field(None, description="Short incident description.")
|
| 154 |
+
|
| 155 |
+
addressvalidated: Optional[int] = Field(None, description="Indicates if address was validated.")
|
| 156 |
+
|
| 157 |
+
CADCompleted: Optional[bool] = Field(None, description="Indicates CAD record completion.")
|
| 158 |
+
|
| 159 |
+
changedate: Optional[datetime] = Field(None, description="Last modified timestamp.")
|
| 160 |
+
|
| 161 |
+
rowguid: Optional[str] = Field(None, description="Row GUID for replication.")
|
| 162 |
+
|
| 163 |
+
LogComments: Optional[str] = Field(None, description="Additional log comments.")
|
| 164 |
+
|
| 165 |
+
Incident_ID: int = Field(..., description="Internal numeric incident identifier.")
|
| 166 |
+
|
| 167 |
+
loss_not_known: bool = Field(..., description="Indicates if loss values are unknown.")
|
| 168 |
+
|
| 169 |
+
collecteddate: Optional[datetime] = Field(None, description="Date when data was collected.")
|
| 170 |
+
|
| 171 |
+
DispatchIncType: Optional[str] = Field(None, description="Dispatch incident type.")
|
| 172 |
+
|
| 173 |
+
nfscasualtycnt: Optional[int] = Field(None, description="Fire service casualty count.")
|
| 174 |
+
|
| 175 |
+
ncivcasualtycnt: Optional[int] = Field(None, description="Civilian casualty count.")
|
| 176 |
+
|
| 177 |
+
psaptime: Optional[datetime] = Field(None, description="Public Safety Answering Point call time.")
|
| 178 |
+
|
| 179 |
+
ResponseType: Optional[str] = Field(None, description="Response classification.")
|
| 180 |
+
|
| 181 |
+
CADText1: Optional[str] = Field(None, description="Custom CAD text field 1.")
|
| 182 |
+
|
| 183 |
+
CADText2: Optional[str] = Field(None, description="Custom CAD text field 2.")
|
| 184 |
+
|
| 185 |
+
CADText3: Optional[str] = Field(None, description="Custom CAD text field 3.")
|
| 186 |
+
|
| 187 |
+
CADCombo1: Optional[str] = Field(None, description="Custom CAD combo field 1.")
|
| 188 |
+
|
| 189 |
+
CADCombo2: Optional[str] = Field(None, description="Custom CAD combo field 2.")
|
| 190 |
+
|
| 191 |
+
CADCombo3: Optional[str] = Field(None, description="Custom CAD combo field 3.")
|
| 192 |
+
|
| 193 |
+
GMTOffSet: Optional[str] = Field(None, description="Time zone offset from GMT.")
|
| 194 |
+
|
| 195 |
+
CADDate1: Optional[datetime] = Field(None, description="Custom CAD date field 1.")
|
| 196 |
+
|
| 197 |
+
CADDate2: Optional[datetime] = Field(None, description="Custom CAD date field 2.")
|
| 198 |
+
|
| 199 |
+
CADDate3: Optional[datetime] = Field(None, description="Custom CAD date field 3.")
|
| 200 |
+
|
| 201 |
+
responseTime: Optional[str] = Field(None, description="Response time benchmark.")
|
| 202 |
+
|
| 203 |
+
turnTime: Optional[str] = Field(None, description="Turnout time from alarm to dispatch.")
|
| 204 |
+
|
| 205 |
+
Mapset: Optional[str] = Field(None, description="Map set identifier.")
|
| 206 |
+
|
| 207 |
+
Easting: Optional[str] = Field(None, description="Grid easting coordinate.")
|
| 208 |
+
|
| 209 |
+
Northing: Optional[str] = Field(None, description="Grid northing coordinate.")
|
src/entities/personnel/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from _model import *
|
| 2 |
+
from _schema import *
|
src/entities/personnel/_model.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sqlalchemy import Column, String, DateTime, Boolean, Integer, Float, ForeignKey
|
| 2 |
+
from sqlalchemy.orm import relationship
|
| 3 |
+
from base import BaseModel_
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class PersonnelModel(BaseModel_):
|
| 7 |
+
__tablename__ = "personnel"
|
| 8 |
+
|
| 9 |
+
personnelkey = Column(String(14), primary_key=True, index=True)
|
| 10 |
+
incidentkey = Column(String(14), ForeignKey("incident.incidentkey"))
|
| 11 |
+
apparatuskey = Column(String(14), ForeignKey("apparatus.incidentkey"))
|
| 12 |
+
pslid = Column(String(14), nullable=True)
|
| 13 |
+
rosid = Column(String(14), nullable=True)
|
| 14 |
+
personnelid = Column(String(9), nullable=True)
|
| 15 |
+
lastname = Column(String(25), nullable=True)
|
| 16 |
+
firstname = Column(String(25), nullable=True)
|
| 17 |
+
middleinitial = Column(String(1), nullable=True)
|
| 18 |
+
namesuffix = Column(String(4), nullable=True)
|
| 19 |
+
rank = Column(String(10), nullable=True)
|
| 20 |
+
actiontaken1 = Column(String(4), nullable=True)
|
| 21 |
+
actiontaken2 = Column(String(4), nullable=True)
|
| 22 |
+
actiontaken3 = Column(String(4), nullable=True)
|
| 23 |
+
actiontaken4 = Column(String(4), nullable=True)
|
| 24 |
+
amount1 = Column(Float, nullable=True)
|
| 25 |
+
amount2 = Column(Float, nullable=True)
|
| 26 |
+
changedate = Column(DateTime, nullable=True)
|
| 27 |
+
rowguid = Column(String, nullable=False)
|
| 28 |
+
crole = Column(String(4), nullable=True)
|
| 29 |
+
lLosap_credit = Column(Boolean, nullable=True)
|
| 30 |
+
MedCert = Column(String(4), nullable=True)
|
| 31 |
+
cAdditionalRole = Column(String(8), nullable=True)
|
| 32 |
+
AgencyID = Column(String(14), nullable=True)
|
| 33 |
+
AgencyDesc = Column(String(40), nullable=True)
|
| 34 |
+
AgencyCode = Column(String(8), nullable=True)
|
| 35 |
+
lNFIRSExported = Column(Boolean, nullable=True)
|
| 36 |
+
NFIRSExportedDate = Column(DateTime, nullable=True)
|
| 37 |
+
iNFIRSSequence = Column(Integer, nullable=True)
|
| 38 |
+
NFIRSTransactiontype = Column(String(1), nullable=True)
|
| 39 |
+
|
| 40 |
+
incident = relationship("Incident", back_populates="personnel")
|
| 41 |
+
apparatus = relationship("Apparatus", back_populates="personnel")
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
src/entities/personnel/_schema.py
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import Field
|
| 2 |
+
from typing import Optional
|
| 3 |
+
from datetime import datetime
|
| 4 |
+
from base import BaseSchema
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class PersonnelSchema(BaseSchema):
|
| 8 |
+
|
| 9 |
+
personnelkey: str = Field(
|
| 10 |
+
...,
|
| 11 |
+
description="Primary key for the personnel table. A unique system-generated identifier for every firefighter or personnel record. Used to link personnel records to apparatus, incidents, and other related tables.",
|
| 12 |
+
examples=["_48Y00K5KE_SMS", "_48Y00K5KF_SMS", "_48Y00K5KG_SMS"]
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
incidentkey: str = Field(
|
| 16 |
+
...,
|
| 17 |
+
description="Unique identifier of the incident associated with this personnel record. Links this personnel entry to a specific incident in the incident table.",
|
| 18 |
+
examples=["_48Y00K5I8_SMS", "_48Y00K5IA_SMS", "_48Y00JH1N_SMS"]
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
apparatuskey: Optional[str] = Field(
|
| 22 |
+
...,
|
| 23 |
+
description="Identifier of the apparatus assigned to the personnel for the incident. Links personnel to a specific equipment or response unit.",
|
| 24 |
+
examples=["_48Y00K5JZ_SMS", "_48Y00K5J4_SMS"]
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
pslid: Optional[str] = Field(
|
| 28 |
+
...,
|
| 29 |
+
description="Personnel shift or assignment identifier. Represents a unique combination of a person and their station or apparatus assignment for a shift.",
|
| 30 |
+
examples=["_1XL0VELG6DEFA", "_1XL0Y55W0DEFA"]
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
rosid: Optional[str] = Field(
|
| 34 |
+
...,
|
| 35 |
+
description="Legacy or rarely used identifier possibly representing a 'Report of Service' reference. Often null in data.",
|
| 36 |
+
examples=[None]
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
personnelid: Optional[str] = Field(
|
| 40 |
+
...,
|
| 41 |
+
description="Human-readable personnel identifier such as an employee number or badge number used internally.",
|
| 42 |
+
examples=["359", "326", "436"]
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
lastname: Optional[str] = Field(
|
| 46 |
+
...,
|
| 47 |
+
description="Last name of the firefighter or personnel member.",
|
| 48 |
+
examples=["Woodard", "Taylor", "Topete"]
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
firstname: Optional[str] = Field(
|
| 52 |
+
...,
|
| 53 |
+
description="First name of the firefighter or personnel member.",
|
| 54 |
+
examples=["Randall", "Michael", "Adrian"]
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
middleinitial: Optional[str] = Field(
|
| 58 |
+
...,
|
| 59 |
+
description="Middle initial of the firefighter or personnel member.",
|
| 60 |
+
examples=["E", "D", "T"]
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
namesuffix: Optional[str] = Field(
|
| 64 |
+
...,
|
| 65 |
+
description="Suffix used in the person's name such as Jr., Sr., or III.",
|
| 66 |
+
examples=["Jr", "Sr"]
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
rank: Optional[str] = Field(
|
| 70 |
+
...,
|
| 71 |
+
description="Rank or title of the firefighter within the department.",
|
| 72 |
+
examples=["ENG", "CAPT", "FF"]
|
| 73 |
+
)
|
| 74 |
+
|
| 75 |
+
actiontaken1: Optional[str] = Field(
|
| 76 |
+
...,
|
| 77 |
+
description="Primary action performed by the personnel member during the incident. Usually represented by standardized codes such as NFIRS action codes.",
|
| 78 |
+
examples=["93", "86"]
|
| 79 |
+
)
|
| 80 |
+
|
| 81 |
+
actiontaken2: Optional[str] = Field(
|
| 82 |
+
...,
|
| 83 |
+
description="Secondary action performed during the incident.",
|
| 84 |
+
examples=[None]
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
actiontaken3: Optional[str] = Field(
|
| 88 |
+
...,
|
| 89 |
+
description="Third action performed during the incident.",
|
| 90 |
+
examples=[None]
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
actiontaken4: Optional[str] = Field(
|
| 94 |
+
...,
|
| 95 |
+
description="Fourth action performed during the incident.",
|
| 96 |
+
examples=[None]
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
amount1: Optional[float] = Field(
|
| 100 |
+
...,
|
| 101 |
+
description="Monetary amount associated with the personnel such as overtime pay, stipend, or incident-related compensation.",
|
| 102 |
+
examples=[150.00]
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
amount2: Optional[float] = Field(
|
| 106 |
+
...,
|
| 107 |
+
description="Second monetary value associated with the personnel.",
|
| 108 |
+
examples=[75.00]
|
| 109 |
+
)
|
| 110 |
+
|
| 111 |
+
changedate: Optional[datetime] = Field(
|
| 112 |
+
...,
|
| 113 |
+
description="Timestamp representing when the personnel record was last updated.",
|
| 114 |
+
)
|
| 115 |
+
|
| 116 |
+
rowguid: str = Field(
|
| 117 |
+
...,
|
| 118 |
+
description="Globally unique identifier (GUID) used by SQL Server for replication and system tracking.",
|
| 119 |
+
examples=[
|
| 120 |
+
"A58628E4-154E-4369-AA48-B6AA569CABEA",
|
| 121 |
+
"66660C59-3899-463F-8268-C09209928414"
|
| 122 |
+
]
|
| 123 |
+
)
|
| 124 |
+
|
| 125 |
+
crole: Optional[str] = Field(
|
| 126 |
+
...,
|
| 127 |
+
description="Special role played by the personnel during the incident such as Safety Officer or Incident Commander.",
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
+
lLosap_credit: Optional[bool] = Field(
|
| 131 |
+
...,
|
| 132 |
+
description="Boolean indicator showing whether the personnel earns LOSAP (Length of Service Award Program) credit for the incident.",
|
| 133 |
+
examples=[True, False]
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
MedCert: Optional[str] = Field(
|
| 137 |
+
...,
|
| 138 |
+
description="Medical certification level of the personnel such as EMT or Paramedic.",
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
cAdditionalRole: Optional[str] = Field(
|
| 142 |
+
...,
|
| 143 |
+
description="Additional role performed by the personnel that may not be captured by standard role codes.",
|
| 144 |
+
)
|
| 145 |
+
|
| 146 |
+
AgencyID: Optional[str] = Field(
|
| 147 |
+
...,
|
| 148 |
+
description="Identifier of the external agency associated with the personnel during mutual aid incidents.",
|
| 149 |
+
)
|
| 150 |
+
|
| 151 |
+
AgencyDesc: Optional[str] = Field(
|
| 152 |
+
...,
|
| 153 |
+
description="Description of the agency associated with AgencyID.",
|
| 154 |
+
)
|
| 155 |
+
|
| 156 |
+
AgencyCode: Optional[str] = Field(
|
| 157 |
+
...,
|
| 158 |
+
description="Short code representing the agency.",
|
| 159 |
+
)
|
| 160 |
+
|
| 161 |
+
lNFIRSExported: Optional[bool] = Field(
|
| 162 |
+
...,
|
| 163 |
+
description="Flag indicating whether the record has been exported to the NFIRS reporting system.",
|
| 164 |
+
examples=[True, False]
|
| 165 |
+
)
|
| 166 |
+
|
| 167 |
+
NFIRSExportedDate: Optional[datetime] = Field(
|
| 168 |
+
...,
|
| 169 |
+
description="Date and time when the record was exported to NFIRS."
|
| 170 |
+
)
|
| 171 |
+
|
| 172 |
+
iNFIRSSequence: Optional[int] = Field(
|
| 173 |
+
...,
|
| 174 |
+
description="Sequence number used when multiple records are exported in a single NFIRS batch.",
|
| 175 |
+
examples=[1, 2, 3]
|
| 176 |
+
)
|
| 177 |
+
|
| 178 |
+
NFIRSTransactiontype: Optional[str] = Field(
|
| 179 |
+
...,
|
| 180 |
+
description="Type of NFIRS transaction such as Insert (A), Update (U), or Delete (D).",
|
| 181 |
+
examples=["A", "U", "D"]
|
| 182 |
+
)
|