Menu form
Synopsis
Lecture form: training.
Route URL
2 urls:
#/lecture
#/lecture/return/expert
#/lecture/return/consultation
Old form in legacy FMX application
lecture2.pas in the old application.
GUI
- Title at top: 'Kabisa LECTURE'
- 4 grids, arranged in 4 quadrants:
- grdTopDiagnosis (northwest quadrant, TMSFMXgrid1 in old app)
- One column
- on row select (click) execute action SelectDiagnose
- on key down: execute action HighlightDiagnose
- grdTopSymptom (northeast quadrant, TMSFMXgrid2 in old app)
- Two columns.
- On row select, execute ShowSymptomToast action
- grdBottomSymptom (southeast quadrant, TMSFMXgrid20 in old app)
- on row select (click) execute action SelectSymptom
- on key down: execute action FilterSymptom
- grdBottomDiagnose (southwest quadrant, TMSFMXgrid10 in old app)
- label (name: lblSearchDiagnose), Below grdTopDiagnosis centered
- label (name: lblSearchDiagnoseText), Below lblSearchDiagnose centered, with text:
()
Type some letters for quick searching - label (name: lblSearchSymptom), Below grdBottomSource centered
- label (name: lblSearchDiagnoseText), Below lblSearchSymptom* centered, with text:
Type some letters for quick searching - 2 arrow images: arrTop points from grdTopSource to grdTopDest. arrBottom points from grdTopSource to grdTopDest
-
Button (btnExit), centered. On click, action: Exit
-
On form show, execute Start action.
Actions
Start
- Fill grid grdTopDiagnosis with name field in user language of all Diagnosis records.
- Initialize diagnosesearch to empty string
- Initialize symptomsearch to emty string.
- Initialize integer variable selectedtopdiagnose to -1
- Initialize integer variable selectedbottomsymptom to -1
SelectDiagnose
- Set selectedtopdiagnose to id of selected record.
- Fetch all associated Symptom for the selected diagnosis. (use the Association object to find the needed Symptom records)
- In grid grdTopSymptom display
- Column 1 : name field in user language of selected records.
- Column 2 : Display Bitmap number ID from the correct BitmapInfo object: The correct object is the first object that matches the limits set by testing the upper and lower bounds of the Association cons and excl fields.
HighlightDiagnose
- Add selected letter to search term diagnosesearch
- Display search term in label lblSearchDiagnose
- In grdTopDiagnosis highlight (in red) all parts of words that match the current diagnosesearch
FilterSymptom
- Add selected letter to search term symptomsearch
- Display search term in label lblSearchSymptom
- In grdBottomSymptom show Symptom records for which the name (current language) matches the current symptomsearch. The items are first ordered by double key:
- position of search string match (i.e. pos(search,Symptom.name.LANG))
- Symptom.sortNR field.
- In grdBottomSymptom display highlighted in red all parts of words that match the current symptomsearch
ShowSymptomToast
- Find Association object that matches selected symptom from grid grdTopSymptom and selectedtopdiagnose diagnose.
- Display a toast with text:
(the [] means using a resource string with that name)
Diag: {{Diag.name.Lang}} Symptom: {{Symptom.name.Lang}} {{[Sensory]}}: {{Association.sens}} {{[Confirm]}}: {{Association.conf.CONT}} {{[Exclude]}}: {{Association.excl.CONT}}
SelectSymptom
- Fetch all associated Diagnose for the selected symptom. (use the Association object to find the needed Diagnosis records)
- In grid grdTopSymptom display
- Column 1 : name field in user language of selected records.
- Column 2 : Display Bitmap number ID from the correct BitmapInfo object: The correct object is the first object that matches the limits set by testing the upper and lower bounds of the Association cons and excl fields.
Exit
- if the incoming URL was
/lecture/return/expertnavigate to Expert/expert - if the incoming URL was
/lecture/return/consultationnavigate to Consultation/consultation - if the incoming URL was
/lecture/, Navigate to menu/menu