Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Updated equipment and outcome codes #114

Merged
merged 4 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/src/equipment_code/equipment_code.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export class EquipmentCodeService {
active_ind: true,
is_trap_ind: true,
},
orderBy: {
display_order: "asc",
},
});

const equipmentCodes: EquipmentCode[] = prismaEquipmentCodes.map((prismaEquipmentCodes) => ({
Expand Down
121 changes: 121 additions & 0 deletions migrations/sql/R__code-table-data.sql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5488,6 +5488,127 @@ set
where
hwcr_outcome_code = 'DESTRYOTH';

--------------------------
-- Equipment code updates
-------------------------
update case_management.equipment_code
set
active_ind = 'N'
where
equipment_code IN ('BRSNR', 'BRLTR', 'CRFTR', 'CRLTR');

insert into equipment_code (equipment_code, short_description, long_description, display_order, active_ind, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp, is_trap_ind)
values
('FTRAP', 'Foothold trap', 'Foothold trap', 10, true, 'FLYWAY', now(), 'FLYWAY', now(), 'Y'),
('LTRAP', 'Live trap', 'Live trap', 20, true, 'FLYWAY', now(), 'FLYWAY', now(), 'Y'),
('LLTHL', 'Less lethal', 'Less lethal', 60, true, 'FLYWAY', now(), 'FLYWAY', now(), 'N'),
('K9UNT', 'K9 unit', 'K9 unit', 70, true, 'FLYWAY', now(), 'FLYWAY', now(), 'N')
on conflict do nothing;

update case_management.equipment_code
set
display_order = 30
where
equipment_code = 'NKSNR';

update case_management.equipment_code
set
display_order = 40
where
equipment_code = 'SIGNG';

update case_management.equipment_code
set
display_order = 50
where
equipment_code = 'TRCAM';


--------------------------
-- Outcome code updates
-------------------------

update case_management.hwcr_outcome_code
set
short_description = 'Relocated - within home range',
long_description = 'Relocated - within home range'
where
hwcr_outcome_code = 'SHRTRELOC';

update case_management.hwcr_outcome_code
set
short_description = 'Translocated - outside home range',
long_description = 'Translocated - outside home range'
where
hwcr_outcome_code = 'TRANSLCTD';

update case_management.hwcr_outcome_code
set
short_description = 'Euthanized by other',
long_description = 'Euthanized by other'
where
hwcr_outcome_code = 'EUTHOTH';

update case_management.hwcr_outcome_code
set
short_description = 'Dispatched by other',
long_description = 'Dispatched by other'
where
hwcr_outcome_code = 'DESTRYOTH';

insert into
case_management.hwcr_outcome_code (
hwcr_outcome_code,
short_description,
long_description,
display_order,
active_ind,
create_user_id,
create_utc_timestamp,
update_user_id,
update_utc_timestamp
)
values
(
'RELSITE',
'Released on-site',
'Released on-site',
65,
true,
'FLYWAY',
now (),
'FLYWAY',
now ()
),
(
'NOTRCVD',
'Not recovered',
'Not recovered',
55,
true,
'FLYWAY',
now (),
'FLYWAY',
now ()
)
on conflict do nothing;

update case_management.hwcr_outcome_code
set
active_ind = 'N'
where
hwcr_outcome_code = 'LESSLETHAL';

-------------------------
-- Action Code Updates
-------------------------
update case_management.action_code
set
short_description = 'Explained/directed livestock owner to the Wildlife Act',
long_description = 'Explained/directed livestock owner to the Wildlife Act'
where
action_code = 'DIRLOWLACT';

--------------------------
-- New Changes above this line
-------------------------
Expand Down