Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04b "Jack Jackrum". upgrade now! [54.2] (what's this?)
Hotfix release available: 2023-04-04a "Jack Jackrum". upgrade now! [54.1] (what's this?)
New release available: 2023-04-04 "Jack Jackrum". upgrade now! [54] (what's this?)
Hotfix release available: 2022-07-31b "Igor". upgrade now! [53.1] (what's this?)
Hotfix release available: 2022-07-31a "Igor". upgrade now! [53] (what's this?)
New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
New release candidate 2 available: rc2022-06-26 "Igor". upgrade now! [52.1] (what's this?)
New release candidate available: 2022-06-26 "Igor". upgrade now! [52] (what's this?)
Hotfix release available: 2020-07-29a "Hogfather". upgrade now! [51.4] (what's this?)
sql_commands_-_search_logs_-_sundhedsjournal

Find ID's of "Handleplan" or "Handlinger" marked as ended on a specific customer and time interval

SELECT array_agg(params->'opts'->'0'->>'s_e_id' ORDER BY START) FROM [LOG_TABLE] WHERE customer_id=[CUSTOMER_ID] AND START > '[START_TIME]' AND START < '[END_TIME]' AND params::text LIKE '%afsluttet%' AND action = 'save_field';

Show information about the ID's found

SELECT et.name,fd.id,fd.alias,fd.name,f.entity_id,
       CASE WHEN fd.alias='handleplan' THEN get_name((SELECT reference_id FROM FIELDS f2 JOIN field_descriptors fd2 ON (fd2.id=f2.field_descriptor_id) WHERE fd2.alias='person' AND f2.entity_id=f.reference_id LIMIT 1))
       ELSE COALESCE(get_name(f.reference_id),f.value_text) END
FROM FIELDS f JOIN field_descriptors fd ON (fd.id=f.field_descriptor_id)
JOIN entities e ON (e.id=f.entity_id)
JOIN entity_types et ON (et.id=e.entity_type_id)
WHERE f.entity_id IN ([IDS_FROM_PREVIOUS_QUERY])
ORDER BY f.entity_id, fd.position;
sql_commands_-_search_logs_-_sundhedsjournal.txt · Last modified: 2025/10/21 14:04 by 20.171.207.78