|
| 1 | +# Sequence diagram |
| 2 | + |
| 3 | +## Questions |
| 4 | + |
| 5 | +- 1. Should we validate the CommunicationRequest schema? |
| 6 | +- 2. (&14) This would result in two separate PDS hits |
| 7 | +- 3. Should Notify virus check the payload given that files >10MB don't go to PDM/NDR |
| 8 | +- 7. When does Notify delete its local copy? |
| 9 | +- 11. Duration and interval of polling |
| 10 | +- 21. Can NHSApp read callback go to notify-letters when the message request originated from notify-core? |
| 11 | + |
| 12 | +```mermaid |
| 13 | +
|
| 14 | +sequenceDiagram |
| 15 | + actor trust as Trust |
| 16 | + participant notify-letters as Notify: Digital Letters |
| 17 | + participant notify-core as Notify: Core |
| 18 | + participant notify-supplier as Notify: Supplier API |
| 19 | + participant pds as PDS |
| 20 | + participant nhsapp as NHSApp |
| 21 | + participant pdm as PDM |
| 22 | + participant ndr as NDR |
| 23 | +
|
| 24 | + autonumber |
| 25 | + trust -> notify-letters: MESH (CommunicationRequest) |
| 26 | + notify-letters -> notify-letters: validate(schema, pdf)? |
| 27 | + notify-letters -> notify-letters: virus-check? |
| 28 | + opt Optionally check PDS |
| 29 | + notify-letters ->> pds: GetPatient (NHSNumber) |
| 30 | + pds -->> notify-letters: 200 OK (Patient) |
| 31 | + notify-letters -> notify-letters: validate(death,sflag, rfr) |
| 32 | + end |
| 33 | + notify-letters ->> notify-letters: Store CommunicationRequest (S3) |
| 34 | + notify-letters ->> pdm: POST /CommunicationRequest |
| 35 | + activate pdm |
| 36 | + pdm -) ndr: SFTP |
| 37 | + pdm -->> notify-letters: 200 OK |
| 38 | + deactivate pdm |
| 39 | + Loop Interval & Duration TBC |
| 40 | + notify-letters ->> pdm: GET /CommunicationRequest/<id> |
| 41 | + pdm ->> notify-letters: 200 OK (CommunicationRequest) |
| 42 | + end |
| 43 | + rect rgb(204, 223, 241) |
| 44 | + note over notify-letters,nhsapp: Existing Notify behaviour |
| 45 | + notify-letters ->> notify-core: post /v1/messages (NHSApp) |
| 46 | + activate notify-core |
| 47 | + notify-core ->> pds: GetPatient(NHSNumber) |
| 48 | + activate pds |
| 49 | + pds -->> notify-core: 200 OK (Patient) |
| 50 | + deactivate pds |
| 51 | + notify-core -> notify-core: validate(death,sflag, rfr) |
| 52 | + notify-core ->> nhsapp: sendMessage |
| 53 | + nhsapp -->> notify-core: 201 CREATED |
| 54 | + notify-core ->> notify-letters: 201 CREATED |
| 55 | + deactivate notify-core |
| 56 | + end |
| 57 | +
|
| 58 | + notify-letters ->> notify-letters: Create SendLetter TTL |
| 59 | + alt Letter is read in NHS App |
| 60 | + nhsapp ->> notify-letters: Callback(status: read) |
| 61 | + notify-letters ->> notify-letters: Delete TTL |
| 62 | + else Letter is not read after fallback wait time |
| 63 | + notify-letters ->> notify-letters: SendLetter TTL expires |
| 64 | + notify-letters ->> notify-supplier: SendLetter(PDF) |
| 65 | + end |
| 66 | +``` |
0 commit comments