## 3 Design and Implementation of the Solution
The object defines on which bus the communication takes place between the NFC reader and the ESP8266. The next step was to create an object of class PN532. The object was named NFC. The defined NFC contains all the attributes and methods needed to control the used NFC counter and takes over the PN532_I2C object. Then, the NFC counter is initialized using the \"begin\" method. The initialization performed is checked, so the firmware version of the module is required. A positive control response allows the program to continue running. A negative control response will cause the initialization to repeat until the communication is successful. The NFC module is connected to the Wi-Fi network, which is set up using ESP. The advantage of connecting to Wi-Fi is that most hospitals have Internet connections these days. WIFI_SSID and WIFI_PASSWORD must be defined to connect to a specific Wi-Fi network. The defined variables are then used to set up Wi-Fi. The NFC module evaluates and displays information on the correct or incorrect data transfer from the mobile device to  
Figure 4: Block diagram of the designed NFC module. Figure 5: Realization of the designed NFC module: hardware components and final encapsulation. the database in real-time using the display. The display is terminated by showing either a green (OK) or red (NOK) screen. When the NFC module does not analyze the received data, the text \"Waiting for phone\" will appear on the display. The display is also used to demonstrate that the device is connected to verify proper functionality. Thanks to the possibility of powering via USB, the NFC module can be powered from an external source. This option benefits health professionals who use several clinics as part of their work. System architecture: The designed system is to create a multifunctional mobile application that will assist in the treatment of oncology patients and subsequently make the work of medical personnel easier, Figure 6. The mobile application should be provided explicitly to patients of a specific department. First, attention is focused on the launch of NFC patients queuing in waiting rooms. Upon arrival at the department, the patient receives a specific link to download the mobile application. An ID is created for the patient in the department with the data that the ambulance needs to be hidden under a specific ID. The patient receives a short instruction on using the mobile application and a brochure that he can study at home in peace. The mobile application enables monitoring of the patient's health status, online ordering, medication registration, and other functionalities. Android application: the entire process of registering a patient in the database in the implemented application is called \"Arrival\". The arrival activity is associated with the use of the NFC module. The activity contains the patient's identification number and a space for selecting the operation for which the patient came to the department. After selecting an action, the patient has the selected values recorded and is redirected to the \"Card emulation\" activity, which displays a virtual card with an ID number and sent actions, Figure 7. The created ID is processed in the application as SELECT_APDU. Use of this service is conditional on card emulation using HCE settings. The AID is set in the mobile application, which must match the AID of the NFC module. An important fact in communication is that the AIDs must match. If the AIDs are different, the communication between the devices will not start. If they are identical, communication is initiated, and the device sends the generated SELECT_APDU. In the identification of the communication, parameters are also set for reporting when the communication did not proceed correctly. In this case, the mobile device sends a different code to the NFC reader than the generated APDU from the ID and action. Connection of the NFC module and the mobile application: the use of the NFC module is connected to the \"Arrival\" activity.