@startuml CreateRx 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 tuypes ' TD -> SW: MSG: Message ' SW -> TD: MSG: Message ' SW -> UI: CMD: command ' UI -> SW: ACT: Action ' US -> UI: User actions are: ' ENT: User enters a value or string ' TCH: User touches a button (RadioButton, CheckBox, ...) ' SET: User sets/slides a slider ' SCL: User scrolls a flipable area ' 'Messages conventions: '[x \n ,] '[x \n ,# certain amount of parameters according to the content] '[x \n ,X The rest of the parameters do not matter.] == Normal Bootup == TD -> SW: MSG: [x12: 3,1] \n OpMode - Standby Dat SW -> UI: CMD: MainHome Screen UI ->o Wait_Retry: ⟲: MainHome Screen == Create Rx - Simplified == TD -> UI: [x12] OpMode - Standby UI -> TD: [x45] Create Treatment Req TD -> UI: [x46] Create Treatment Rsp UI -> TD: [x3F] Prameters Validation Req TD -> UI: [x40] Prameters Validation Rsp UI -> TD: [x44] Prameters Confirmation Req TD -> UI: [x12] OpMode - Pre-Tx == Create Rx - Detailed == US -> UI: TCH: Create Treatment Button UI -> SW: ACT: Create Treatment SW -> TD: MSG: [x45: 1] Req \n Initiate Treatment alt Accepted: Initiate Treatment TD -> SW: MSG: [x46: 1,X] Rsp \n Initiate Treatment TD -> SW: MSG: [x12: 4,1] Dat \n OpMode - Parameters SW -> UI: CMD: Create Rx Screen UI ->o Wait_Retry: ⟲: Create Rx Screen 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 else #Pink Rejected x46: Initiate Treatment TD -> SW: MSG: [x46: 0,RR] SW -> UI: CMD: Rejection Reason (RR) Notification UI ->o Wait_Retry: ⟲: MainHome Screen end alt Back US -> UI: TCH: Back Button UI -> SW: ACT: Back alt Is Validated? SW -> TD: MSG: [x44: 0] Req \n Prescription Parameters Confirmations: Back SW -> UI: ACT: Set to not validated UI -> UI: ACT: Enable Fields UI ->o Wait_Retry: ⟲: Create Rx Screen else UI -> UI: ACT: Clear Create Rx Screen SW -> TD: MSG: [x45: 0] Req \n Initiate Treatment Cancel TD -> SW: MSG: [x12: 3,1] Dat \n OpMode - Standby SW -> UI: CMD: MainHome Screen UI ->o Wait_Retry: ⟲: MainHome Screen end end @enduml