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

Updating the _validateRequiredSelectors method #4115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sofien-Sellami
Copy link
Contributor

Context

Certain custom attributes require additional data.

Changes & Results

Updated the _validateRequiredSelectors method in the HangingProtocolService to pass additional props to the findMatch function, allowing for better handling of custom attributes.

Testing

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • OS:
  • Node version:
  • Browser:

Copy link

netlify bot commented May 9, 2024

Deploy Preview for ohif-platform-docs ready!

Name Link
🔨 Latest commit e09e263
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/663cdebf2f5e1a0008aaafc0
😎 Deploy Preview https://deploy-preview-4115--ohif-platform-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 9, 2024

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit e09e263
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/663cdebf3407200008450560
😎 Deploy Preview https://deploy-preview-4115--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@salimkanoun
Copy link
Contributor

@sedghi finally it is not a regression, just never been working before

@sedghi
Copy link
Member

sedghi commented May 9, 2024

How can we test it? what was not working that is now after this PR working?

@salimkanoun
Copy link
Contributor

Here is a sample of one of our custom rule :

`import { utils } from '@ohif/core/src';

const { formatDate } = utils;

export default function (displaySet, options) {
const { constraint } = this;
const constraintValue = constraint[Object.keys(constraint)[0]];
if (!options) {
return getTestValue(constraintValue);
}

const { studies } = options;

if (studies.length <= 1) {
return getTestValue(constraintValue);
}

let result = 0;
studies.forEach((study) => {
if (study.StudyInstanceUID !== displaySet.StudyInstanceUID) {
const difference =
getTimeStamp(displaySet.instance['StudyDate']) -
getTimeStamp(study.series[0].instances[0]['StudyDate']);
result = difference;
}
});
return result;
}

const getTimeStamp = (dateString: string) => {
const timestamp = new Date(formatDate(dateString)).getTime() / 1000;
return Math.floor(timestamp);
};
const getTestValue = (options) => {
if (Array.isArray(options)) {
return options.map((option) => option?.value ?? option);
} else {
return options?.value ?? options;
}
};
`

The idea of this custom role is to have a rule in our HP saying "this viewport shall display a displayset that is earlier than the other known display set
This way we can have a HP in which we make sure the viewport in a particular location displays prior studies and other viewport display the current study.

To do so we need to get the studies candidate so we can compute the timestamp difference and then apply a rule on this timestamp difference.
Also Instance make possible to access the first instance metadata, such as special tags like CorrectedImage in PET that are not available otherwise

@sedghi sedghi requested a review from IbrahimCSAE May 24, 2024 16:28
@sedghi
Copy link
Member

sedghi commented May 29, 2024

Are we moving to shadcn components? If so, can we hold off on this? Or do you need it?

@salimkanoun
Copy link
Contributor

I don't think there is a relation with the UI, it is usefull to apply custom matching rule relative to another display set candidate

@sedghi sedghi removed the request for review from IbrahimCSAE May 29, 2024 15:53
@sedghi
Copy link
Member

sedghi commented Jun 5, 2024

@salimkanoun I want to test this before merging. Could you please let me know where to add your code? Is it like a custom attribute? Can you perhaps provide me with the code for the full hanging protocol that I can run with studies that have priors?

@sedghi
Copy link
Member

sedghi commented Nov 6, 2024

Do you guys still need this?

@salimkanoun
Copy link
Contributor

Yes but didn't get the time to give you a minimal HP to reproduce why we need it, will do ASAP

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.

4 participants