Skip to content

Commit 71cc802

Browse files
committed
CCM-12397: Add sequence and flow diagram
1 parent 5c551de commit 71cc802

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Flow diagram
2+
3+
```mermaid
4+
5+
flowchart TD
6+
Start(["Start"])
7+
Start --> Mesh[Receive MESH file]
8+
Mesh --> S3@{shape: disk, label: "Save to S3"}
9+
S3 --> FileSize{"PDF < 8MB?"}
10+
FileSize -->|Yes| PDM["Upload to PDM"]
11+
FileSize -->|No| SupplierAPI@{shape: doc, label:"Send to SupplierAPI"}
12+
PDM --> NHSApp["Send NHSApp msg"]
13+
NHSApp --> PDFRead{"PDF Read?"}
14+
PDFRead -->|Yes| End(["End"])
15+
PDFRead -->|No| SupplierAPI
16+
SupplierAPI --> End
17+
```
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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

Comments
 (0)