# Privacy-Aware Cloud Architecture for Collaborative Use of Patients' Health Information
## 3 Proposed Architecture
### Architecture Implementation
#### 3.4.1 Implementation Setup  
For the implementation of the proposed architecture, a virtual private cloud (VPC) was created using AWS, as seen in Figure 7. The VPC represents an important visualization tool in our research, showcasing valuable insights; it represents the entire proposed system architecture, and it is completely isolated from the Internet. The VPC has two subnets: the first subnet does not allow access from the Internet; it is only accessed locally. The second subnet enables Internet access to allow communication with the user application. The public subnet has limited access and could be communicated through the Internet; however, only registered IP addresses can communicate with it. The EC2 represents the RA in the proposed design. Access to it happens only through a particular port. Moreover, the database in the implemented design only accepts SQL traffic. Patients' documents and their associated trapdoors are stored in two different places that are not accessible through the Internet, as seen in Figure 8. Access to them can only happen locally. Access to patients' documents can only happen through requests from the CSR, while the trapdoors can only be accessed through the SKA. Documents stored on the cloud are all encrypted. Figure 9 presents doc-1, which was downloaded directly from the cloud in the implemented system, highlighting the inability to learn the content of the document without going through SKA and CSR. **Accessing Patientinformation--Scenario**  
For the purpose of testing the architecture, dummy information about three patients was used. Each patient had three documents in the system. Documents were all encrypted and stored in the cloud database. Encrypted documents were stored on one database (CSP) and their trapdoors were stored on a different database (SKA). The illustration  
Figure 7: Isolated virtual private cloud. involved a patient ([PERSON]) who walked into the hospital for urgent medical treatment. The nurse wishes to access [PERSON]'s information to update information regarding his visit and current medication. The nurse needs to login to the system for authentication purposes. The user is required to have username and password which are entered through the standard user application. Access to the system only happens through the user application. When the RA receives the user credentials (username and password), it searches for the user information in the list of registered users. The RA in the implemented architecture had a database that contains names of registered users, this database was used for authenticating users. When the user is found, authentication is confirmed. **User authorization**  
When the user is authenticated by the RA, another window pops up on the user application for entering [PERSON]'s basic information. [PERSON]'s information is used by the RA to identify him in the system. When information is entered by the nurse and forwarded to the RA, the RA searches for the patient in the list of the registered patients in the system. The RA in the implemented system had another database that contains information about all patients enrolled in the system. When the patient is found, the CSR is called for authorization. The RA sends [PERSON]'s information to the CSR along with the users' information. Figure 10 presents the code which was used in the implementation of the authorization process. The CSR searches for the user in the list and finds out that the user is a nurse and is allowed to access Doc-1 and Doc-2 of patients' information. Table 7 is the table used by CSR to authorize users. The CSR confirms to the RA that the user is allowed to access Doc-1 and Doc-2 of [PERSON]'s information. The assumption made here was that [PERSON] has received a text message from the CSR and has granted consent for the nurse to access his information. Figure 8: Separation of information stored on the cloud. Figure 9: Encrypted document downloaded directly from the cloud.