Skip to content

Conversation

@bgeorge0
Copy link

Mosaiq interface added for payer, episode of care.
Some bug fixes in other code paths
Added mosaiq database field to connection

@dicom
Copy link
Owner

dicom commented Jan 22, 2026

Thank you, Ben, for this nice contribution to the mosaiq interface!

May I ask you what version of Mosaiq you have in your clinic?

We are currently at 2.64, but we are upgrading to 2.86 this weekend actually.

Best regards,
Christoffer

@bgeorge0
Copy link
Author

We're on v2.83 about going to update to v3.2.3 within the next few months. Not sure whether that upgrade will break anything. There are a few other interfaces I'm going to put together as well to support what I need.

@dicom
Copy link
Owner

dicom commented Jan 22, 2026

Thanks for the info, Ben. I will look further into this next week after we are done with our Mosiq upgrade, and try to merge your pull request then.

For the original mosaiq interface, I've only implemented support for the database objects I actually use myself, so naturally there are many left out that other people might have use for. It is of course excellent if you will implement support for other missing database objects as well!

@bgeorge0
Copy link
Author

There seem to be some implementation details which may be institution-specific, interesting to see how this works across other centres. I'm keen to try and access data from Assessments, but I'm working somewhat blind on this and haven't yet figured how that is stored - any ideas?

@dicom
Copy link
Owner

dicom commented Jan 23, 2026

We actually cracked the code for how Mosaiq's pdf documents are stored on the Mosaiq file share a few months ago. We're using it to display the pdf's in a Ruby on Rails web application at our clinic. We dont use assessments in our clinic (I believe), so I have no I have no experience with that, but it could be they are stored by the same logic. If so this might help you along. I havent converted it to python code yet, but here is how we implemented it in Ruby:

# The relative path to the pdf document on network storage.
# The path is constructed by 3 parts of information:
# -A binary determined by the second last digit in the patient_id being odd or even.
# -The last digit of the patient_id.
# -The patient_id converted to hexadecimal (padded with zeroes in front).
# -The file number.
# Example:
# 16\0000DD2A.003\
def path
  # Binary and last digit part:
  next_last_digit = @patient_id.to_s[-2].to_i
  last_digit = @patient_id.to_s[-1]
  bin = next_last_digit.odd? ? "1" : "0"
  # Patient ID hexadecimal part:
  hex = @patient_id.to_s(16).upcase
  hex_padding = "0" * (8 - hex.length)
  # Document number part:
  file_nr_length = @file_number.to_s.length
  file_nr_padding = "0" * (3 - file_nr_length)
  doc_path = bin + last_digit + "\\" + hex_padding + hex + "." + file_nr_padding + @file_number.to_s + "\\"
  return doc_path
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants