# Implementation of a Blood Cold Chain System Using Blockchain Technology
## 4 Implementation of the New Blood Cold Chain System
### Implementation in General Situations  
The participants in the blood cold chain system network are defined in the model file. One is the participant registry list and another is the asset registry list. Both lists are composed of ID and data. The participant types in this network are blood banks, inspection centers, transportation vehicles, and hospitals. To add more participants, the ID and data are defined using \"create new participant\". As noted earlier, blood is a temperature-sensitive resource, and so temperature information must be obtainable in real time. In the proposed system, therefore, we implemented a temperature verification transaction as shown in Figure 6.  
Initial temperature information is optional. Then, when a temperature verification transaction occurs, a time stamp is recorded to indicate when the temperature was confirmed. Collected blood should be stored at 1 to 6 degrees Celsius, which means that any blood outside the storage reference temperature should be discarded after a temperature verification transaction. Discarding of blood requires a separate transaction and function. A transaction is specified in the model file, and a script file is written to apply the function to the transaction. Scripts in Hyperledger Composer are useful for executing developer-defined code or specific commands, and can be interpreted as spaces that define some sort of transaction execution function. This corresponds to the business logic of the blockchain network and is written in JavaScript (js). In addition, it uses the Query Language supported by Hyperledger Composer to find specific blood that is outside of the standard temperature range. When the network is configured, a separate query  
Figure 6: After running of temperature-check transaction. file (.qry) is created. In this case, the conditions are set using the SELECT and WHERE operators. Events can be specified separately for details after a transaction to discard blood has taken place. In the left of Figure 7, the blood information shows that the current temperature is outside the whole blood storage temperature range of 0 degrees Celsius to 8 degrees Celsius. Event details can be specified separately after a transaction to discard blood has taken place. This is specified in the model file along with the transaction. Detailed logic can be specified through a function in the script file. As shown in the right of Figure 7, there are three events that occurred at the time the transaction was executed. This information can be used to determine which blood was discarded and when. The event shows that Blood0007 and Blood0008, blood outside of the storage reference temperature shown in the left of Figure 7, were discarded. Additionally, blood may be discarded for reasons such as turbidity and discoloration. To manage this, we defined properties that indicate the state of storage in the blood information. This attribute is required and should be entered when all of the initial blood assets are created. In addition, participants in the blood cold chain update the cause when the current blood storage status changes. At this time, the blood whose revised storage condition is not normal is removed through a blood disposal transaction by the storage condition. A query was defined as shown in Figure 8 to search for blood whose status is to be \"discarded\". Figure 7: Events for blood discard transaction by temperature condition. Blood is characterized by a specific shelf life depending on its ingredient formulation. Therefore, in addition to the temperature and storage conditions, it is necessary to continuously check the storage period and dispose of it after that period. After one day in the system, the retention period of the entire blood asset is reduced by one day. As with the temperature and storage conditions, we designed a transaction that discards blood when the retention period reaches zero days. It also allows the user to view the quantity of blood assets that have a retention period of about one day.