It has been identified that in Mosaic versions 22.2.4.0 and later there is a problem with viewing case notes that may result in case notes not displaying in the order expected. It can also mean that one of the case notes is not shown in the viewing window.
None of the information is lost and the table of case notes on the main case notes screen is still correct, however, the change to code in 22.2.4.0 designed to improve case note loading times has resulted in the removal of the expected ordering when viewing case notes via the 'view' button in the case notes screen.
There is a workaround available, by selecting 'Print multiple case notes' instead of 'View' and then selecting a case note to review from there, or by viewing all the case notes together using the print option, to output to PDF.
We have agreed that this is a high priority issue and should be patched to restore the correct ordering, so we will be including this in the patches (22.2.4.3 and 22.2.5.1) which are due to be released this week.
Existing issue
During our investigation we also identified an existing issue in the same area of the system. This occurs only where a record has a person and group case note with the exact same ID number. As this is a legacy issue that we expect will be an extremely rare occurrence, we do not plan to fix this in the patches, as we are still investigating and don't want to delay the release.
If this were to occur, the case notes table appears correctly in the case notes screen, but, for example if I had group case note 123 and later individual case note 123, if I selected to view the first one to occur in the list, group case note 123, it would appear fine, however if I selected to view the second in the list, individual case note 123, I would be shown group case note 123 instead.
This issue also affects printing case notes, where there are clashing case notes IDs, both case notes will be automatically omitted from the print output without warning.
You can use the below script to identify whether you have any records with this issue in your instances of Mosaic:
/*
* NAME: report_on_overlapping_case_notes.sql
* DESCRIPTION: Script to report on case notes where the same ID is used for single case notes
* and group case notes belonging to the same person or the group a person belongs to.
* Ignores logically deleted case notes and includes group notes where the individual is no longer
* a member of the group
* HISTORY: 1.0 gk 23/04/2024 Initial version
* 1.1 gk 02/05/2024 Adding check between Case notes and groups notes on relatives
*/
select
distinct
mcn.case_note_id,
mcn.subgroup_id,
mgs.group_id,
mss.subject_compound_id,
mgs.is_current_member,
mcn.created_datetime grp_case_note_created_on,
cn.created_on indvidual_case_note_created_on,
null related_to_person_id
from mo_case_notes mcn
inner join mo_subgroup_subjects mss
on mcn.subgroup_id = mss.subgroup_id
inner join mo_group_subjects mgs
on mss.group_id = mgs.group_id
inner join case_notes cn -- case notes share same ID
on cn.id = mcn.case_note_id
and cn.person_id = mss.subject_compound_id
where mss.subject_type_code = 'PER'
and cn.state = 'ACTIVE'
union all
select
distinct
mcn.case_note_id,
mcn.subgroup_id,
mgs.group_id,
mss.subject_compound_id,
mgs.is_current_member,
mcn.created_datetime grp_case_note_created_on,
cn.created_on indvidual_case_note_created_on,
mpr.PERSON_RELATED_TO_ID related_to_person_id
from mo_case_notes mcn
inner join mo_subgroup_subjects mss
on mcn.subgroup_id = mss.subgroup_id
inner join mo_group_subjects mgs
on mss.group_id = mgs.group_id
inner join MO_PERSON_RELATIONSHIPS mpr
on mss.subject_compound_id = mpr.PERSON_ID
inner join case_notes cn -- case notes share same ID
on cn.id = mcn.case_note_id
and cn.person_id = mpr.PERSON_RELATED_TO_ID
where mss.subject_type_code = 'PER'
and cn.state = 'ACTIVE'
We hope to include a fix for this in the next Mosaic release.
