Ga naar inhoud

SelectDiagnose form

Synopsis

Form to allow the user to select a diagnosis to train on.

Route URL

#/selectdiagnose

Old form in legacy FMX application

choose_diag.pas in the old application.

GUI

On form create, execute action StartUp

Left half of screen

  • Top

    • Label name lblDiagnoses fixed text: Diagnoses
    • Label name lblDiagnoseCount display count of diagnoses in grid
  • Center:

  • Bottom:

    • Label (name: lblSearchTerm)
    • Label (name: lblSearchTermHint, text: "Type some letters for quick searching - correct with BckSpc or Esc"
    • Radio group (name: rgMethod):
      • Choose (name: rbChoose)
      • Random (name: rbRandom)
      • Load saved consultation (name: rbLoad) On value change, execute action SelectChange.

Right half of screen

  • Label: (name: lblMethod), initially empty.
  • Button: (name: btnStart) vertically centered with arrow pointing right and text 'Consultation', initially disabled on click, execute action StartConsultation
  • Button: (name: btnExit) vertically centered with arrow pointing right and text 'Exit' on click, execute action Exit

Actions

Startup

  • Initialize string variable searchterm
  • Construct a list of diagnoses alldiagnoses:
  • Get [Diagnoses] where the following conditions hold:
    • if Parameters.Continent = 'GP' then
      • StartupGp is true
    • else (Parameters.Continent <> 'GP')
      • if Parameter.Level='nurse' then
        • (Startup>0) and (Startup<2) and (PC.Continent>=Parameter.nurseLimit)
      • if Parameter.Level='Junios' then
        • (Startup>0) and (Startup<3)
      • if Parameter.Level='Senior' then
        • (Startup>0) and (Startup<4)
  • Order list by Diagnose.sortnr.Language
  • In grid grdDiagnoses, display the Diagnose.Name.Language

FilterDiagnoses

  • Adapt *searchterm depending on key.
  • Display searchterm in lblSearchTerm*
  • Filter alldiagnoses: only show records which contain search term, order by match position.
  • In grid cell, display matched substring in red.

SelectChange

  • Update lblMethod text with selected option text.
  • if the selected option is not rbChoose then:
    • Disable grid.
    • Make lblSearchHint invisible.
    • Make lblSearchTerm invisible.
    • Disable button btnStart
  • if the selected option not rbChoose then:
    • enable grid.
    • Make lblSearchHint visible.
    • Make lblSearchTerm visible.
    • Enable button btnStart

SelectDiagnose

  • set lblMethod text to selected Diagnosis.Name.Language;
  • save selected diagnosis in SelectedDiagnose
  • Enable button btnStart

StartConsultation

StartConsultationChoose

  • navigate to route for the StartConsultation form:
    /startconsultation/{{SelectedDiagnosis.id}}
    

StartConsultationRandom

  • select a random diagnosis from the alldiagnoses array. save this diagnosis in SelectedDiagnose
  • Initialize an empty Symptom array in selectedSymptoms.
  • Create an empty temporary list of symptoms: tmpList
  • select all Association objects where diagId matches the selected diagnosis.id and (sym.ttype=0)
    • If any symId in [136, 81, 110, 98] is in the list of Associatons, add the corresponding symptom to tmpList
    • Let genderSymptom be a random symptom from tmpList
  • Clear tmpList
  • select all Association objects where diagId matches the selected diagnosis.id and (sym.ttype=1)
  • If any symId [112,104,8,98] is in the list of associations, add the corresponding symptom to tmpList
  • Let acuteSymptom be a random symptom from tmpList
  • select all Association objects where
    • diagId matches the selected diagnosis.id
    • Symptom(symId).ttype>1
    • Symptom.startUp is true.
    • symId is not in excludes of genderSymptom add the associated symptoms to selectedSymptoms.
  • From selectedSymptoms pick a random symptom RandSym1.
  • Remove the selected symptom SRand1. from the list, as well as all excludes of the symptom RandSym1.
  • From selectedSymptoms pick a random symptom RandSym2.
  • Remove the selected symptom SRand2. from the list, as well as all excludes of the symptom RandSym2.
  • Display a message
    [Your patient is a] GenderSymptom.Name.Language [with a] AcuteSymptom.Name.Language  [Disease]
    
    (string ids 218,410,433)
  • Display a message
    [The complaints are] RandSym1.Name.Language [and] RandSym2.Name.Language
    
    (string ids 411,412,433)
  • Navigate to route for the Consultation form dialog, passing the parameters
    #/consultation/random/{{SelectedDiagnosis.id}}/{{gendersym.id}}/{{AcuteSymptom.id}}/{{RandSym1.id}}/{{RandSym2.id}}
    

StartConsultationLoad

  • Present a modal dialog with a list of simulation names
  • Allow user to select a simulation.
  • Call consultation dialog, passing the selected simulation ID
    #/consultation/simulation/{{simulationid}}
    

Exit

  • Return to menu form.