Evaluate button - #111
Conversation
map posted ID to local test data Update comment
elsaperelli
left a comment
There was a problem hiding this comment.
Tested with CMS506 with abacus-demo deqm-test-server and the bellese server and it looks good to me!
Some small comments that can definitely be addressed at a later time, just wanted to make note of it now!
| const trustMetaProfile = useRecoilValue(trustMetaProfileState); | ||
| const [reportTypeValue, setReportTypeValue] = useState('population'); | ||
| const [subjectValue, setSubjectValue] = useState<string | null>(''); | ||
| const [subjectData, setSubjectData] = useState<{ value: string; label: string }[]>([]); |
There was a problem hiding this comment.
For future- we may want to put this in a type to pass into this (like we do with LabeledDetailedResult on line 43).
There was a problem hiding this comment.
This should be simpler than LabeledDetailedResult since it's literally just the Select structure. In mantine v8 there's a built in type for this (ComboboxItem), but I was having trouble finding an equivalent in v6. We could do a custom type, but because it would just be for the component structure, part of me just wants to update mantine at some point instead. One can dream... heh
| }); | ||
| }; | ||
|
|
||
| const sendEvaluate = async (): Promise<fhir4.Bundle | undefined> => { |
There was a problem hiding this comment.
I think we may want to change these output types since I believe it can be Bundle, Parameters (technically this is the correct output LOL), or OperationOutcome
There was a problem hiding this comment.
I will change this to bundle or parameters. Ideally in the future, it would just be Parameters. For now, it doesn't matter because we're just spitting it out to a string, but in the future, we might actually want to do something with the structure.
| }, | ||
| { | ||
| name: 'periodStart', | ||
| valueString: measurementPeriodFormatted?.start.split('T')[0] |
There was a problem hiding this comment.
This may not matter, but I have used valueDate instead of valueString
There was a problem hiding this comment.
Huh- I think I've used valueString generally for testing in the past (ala https://github.com/projecttacoma/deqm-test-server?tab=readme-ov-file#evaluate example). I agree valueDate probably makes more sense though.
| if (reportTypeValue === 'subject' && subjectValue) { | ||
| parameters.parameter?.push({ | ||
| name: 'subject', | ||
| valueString: `Patient/${subjectValue}` |
There was a problem hiding this comment.
I also think I was able to just send in the patient id on its own, not sure if having Patient/ is a problem I think its fine, just wanted to mention
There was a problem hiding this comment.
I think since it's a reference, the Patient/ is more correct. Especially if there's potential for the subject to be of a different type. For deqm-test-server, our individual evaluate seems to be able to handle it either way, but our population evaluate expects any specified subject to be a group reference.
Summary
Modal that gives options and results of sending an evaluate request to the evaluation service.
Probably not a perfect UI/UX but hopefully good enough for now.
New Behavior
Evaluate button pops a modal that gives options for report type and if subject type, also gives options to select a subject. When the user selects "Evaluate", the application sends an $evaluate request to the evaluation service with the selected parameters.
Code Changes
Testing Guidance
npm run checknpm run dev