@startuml CreateRxCommon(id=CreateRxCommon) participant TD as TD participant SW as SW participant UI as UI control Wait_Retry as Wait_Retry actor USER as US collections Pre_Tx as Pre_Tx 'Possible actions and interaction types ' External on CANBus ' TD -> SW: MSG: Message ' SW -> TD: MSG: Message ' Internal to the application ' XX -> YY: CMD: Command ' XX -> XX: ACT: Action ' External on OS/FS ' SW -> Script: ACT: Command ' Script -> OS: CMD: Command ' Script -> SW: MSG: Message ' OS -> Script: MSG: Message ' US -> UI: User actions are: ' ASK: Display a ' ENT: User enters a value or string ' TCH: User touches a button (RadioButton, CheckBox, ...) ' SCL: User scrolls a flip-able area US -> UI: ENT: Patient ID Text US -> UI: TCH: Touch each parameter to set value alt Validate US -> UI: TCH: Validate Button UI -> SW: ACT: Prescription Parameters SW -> TD: MSG: [x3F: #(all the Rx Params)] Req \n Prescription Parameters: Validation alt Accepted TD -> SW: MSG: [x40: 1,X] Rsp \n Prescription Parameters: Validation SW -> UI: ACT: Notify UI: Parameters validation \n\t(Generate QR Code) UI -> UI: ACT: Lock all editable fields\n\tShow QR Code\n\tShow Confirm Button alt Confirm US -> UI: TCH: Confirm Button UI -> SW: ACT: Prescription Parameters Confimation SW -> TD: MSD: [x44: 1] Req \n Prescription Parameters Confimation alt Accepted TD -> SW: MSG: [x12: 4,1] Dat \n OpMode - Pre-Treatment SW -> UI: CMD: Pre-Treatment Stack UI -[#Green]>o Pre_Tx end end else #Pink TD -> SW: MSG: [x40: 0,#RR] Rsp \n Prescription Parameters: Validation SW -> UI: CMD: Highlight Rejected Parameters UI ->o Wait_Retry: ⟲: Prescription Parameters Screen end end @enduml