# OptimizedDrugDistributionforPharmaciesoftheNationalOrderofPharmacistsinDRCongousingaMultiAgentEngineering Approach # Strictly as per the compliance and regulations of: Type: Double Blind Peer Reviewed International Research Journal Publisher: Global Journals Online ISSN: 0975-4172 & Print ISSN: 0975-4350 Introduction owadays, the field of Distributed Artificial Intelligence provides Software Agents with cognitive capabilities comparable to those of human beings (reasoning, thinking, learning, and deciding). The conquest of the power of this science and the evolution of technology is forcing the standalone or pre-programmed software development process to emancipate itself from the silo for distributed systems where each application is endowed with the ability to learn and use the distributed intelligence across the network. Each software agent distributed in the network is specialized in a given domain and interacts with other agents to solve complex problems in an environment. The DRC's pharmacy domain is no exception as the skills of each pharmacist must be put together to produce knowledge bases. This field is experiencing a proliferation of pharmaceutical dispensaries commonly called "death boxes", coupled with the increase in the counterfeiting of pharmaceutical products which endangers the health of the populations. The consumer of Congolese pharmaceutical products is faced with a total opacity to distinguish a licensed pharmacy from a "death box", notwithstanding the rules enacted by the PCOP. Our study wants to bring an answer to this problem by developing a Multi-Agent System made up of intelligent agents able to identify each pharmacist, his pharmaceutical activities in order to make it public to consumers. Each pharmacist registered with the PCOP will obtain exclusive authorization to practice pharmacy, which will undoubtedly limit the proliferation of unlicensed pharmacies. The consumer can now search for a drug in the MAS and the intelligent agent will contact qualified vendors (pharmacists) to obtain the drug safely. The pharmacy domain being complex in its broad spectrum, the agents, their interactions and sociability are also complex as confirmed by the theory of AMAS (Adaptive Multi-agent Systems) which proposes to solve complex problems by self-organization for which no algorithmic solution is known [1], [2]. Moreover, the autonomous agents of our MAS will be subject to ethical rules and pharmacists' deontology to make decisions which are perceived as locks, or design problems according to an agent-centered perspective. This implies the use of formal rules to collective ethical issues in multi-agent systems proposed in [3], [4], for the achievement of the primary goal of protecting the health of the population. Several methodologies, allowing the development of this kind of system have been proposed. Our choice is oriented towards the O-MaSE approach to develop our MAS. This methodology is selected for its conceptual richness and simplicity. Our study is structured around the following three points excluding the introduction: ? The related works: this part will allow us to present the related works; ? The design of the MAS for the adherence and regulation of the sale of pharmaceutical procedures in the market; ? ADM implementation and simulation. We implement under the JADE platform (Java Agent Development Framework) a sales negotiation capability between intelligent agents. II. # Related Works Membership of the national order of pharmacists and pharmaceutical vigilance have been the subject of previous studies. The result produced in [5] proves that the period of hospitalization or discharge of the patient, constitutes a critical stage for the drug risk and the notion of drug quality must be a priority because only a limited number of patients know how to access the accredited pharmacies. This result confirms that access to medications requires an intelligent system to guide the acquisition of medications. In addition, the current technological evolution pushes the profession of pharmacy mutation including all professionals and pharmacy students who must grasp the advances [6]. The research conducted by Benhajji [7] have led to a satisfactory result of using a patientcentered and agent-based approach that minimizes waiting times, length of stay, and therefore costs of care, while ensuring quality care for all patients. With regard to drug safety and the proliferation of unlicensed pharmacies, research has been carried out to dissuade offenders B. Allenet and his team [8], [9]. According to G. Rousset [10], the distribution of medicines online has indirect and negative consequences for patients and public health and generates major risks related to the difficulty for pharmacists to fulfil their obligations and ethics. Other studies deal with the management of patients in hospitals. This is notably the case of the work of Chuan-Jun and his teammate [11] and others in 2018 [12]. Other studies have focused their research on the ethical and deontological compliance of agents with respect to a domain [3], [4]. The problem with all the works is that the emphasis has been on reminding the agents of the rules established at the domain level even if this is not enforced. The literature review previosly cited shows the interest given to pharmaceutical activities whose consequences are incalculable in human health. On the other hand, we did not find any papers that addressed the issue of pharmacists' membership, pharmaceutical vigilance and the practice of pharmacy using the Multi-Agent approach. Multiagent systems (MAS) require interactions between agents [13], [14], [15]. These interactions drive learning to achieve the common goal [16]. Scott and Wooldridge have used agent-oriented methodologies such as MaSE [17] ASEME [12] and other appropriate modeling techniques. It has been found that some projects use multi-agent systems to develop their approach in the field of such as industry, tourism, decentralized control policies, decision making and coordination. The methodology "MaSE" is a seven-step process in two phases [18]. In the analysis phase, the identification of goals, the application of use cases through sequence diagrams and the definition of roles with their required competencies. As for the design phase, it defines the agent diagram, the protocol diagram (sequences) or conversation diagram between classes and deployment diagram [18], [19]. In 2012, M. Fethi with his research team [20] applied the "O-MaSE" (Organization based Multi-agents System Engineering) methodology to solve the vehicle touring problem. O-MaSE is an extension to the MaSE methodology and completes it with the organization dimension. It considers a multi-agent system as a social organization. Each agent is a member of this organization and plays a specific role according to its capacity. In 2019, Hanane E. Adil Haddi and H. Allali [13] used the "MaSE" methodology to design a system to support metacognitive skills to learners. Other research works have focused on the MaSE methodology as in [21], [12]. This literature on MaSE methodology is matched with three main families that exist when designing MAS [20]: functional, object and agent. The functional approach is generally applied to the domain of enterprise information systems by treating both the data and processing point of view and the aspects going from design to implementation. In the object approach, modeling a system consists of breaking it down into independent units, each unit having its own characteristics (attributes) and operations that it can perform (methods). Unlike an agent, an object only reacts to a method call and all the situations it will face must be taken into account by the designer [22]. Moreover, objects cannot have goals nor seek satisfaction and the mechanism of sending messages is summarized in a simple call of the methods of the class. There is no communication language as such between the objects in an application. The interaction mechanisms are the responsibility of the programmer. In turn, the agents have goals that give them autonomy of decision with respect to the messages received. In [23], it is clearly stated that the MAS reorganizes itself continuously according to different scales thanks to the movements in the life cycle of the agents. The global behavior of the MAS depends on the links between its different agents. The behavior will sometimes be regular, sometimes chaotic, in all cases non-linear. The behavioral model must therefore take into account the possibility of non-regularity of the system. This distinguishes the agent-based approach from those used with functional and object models. In conclusion, the functional and object models are not sufficient to design the systems of membership to the National Order of Pharmacists and the regulation of the sale of medicines. Because they do not take into account the characteristics of autonomy, learning and sociability of each component of this system as well as their characteristics of complexity and evolution. To design our ADM, in the following section 3 we will use the O-MaSE methodology [24], [23]. # III. # Design of Our MAS The process of joining the national order of pharmacists and the process of selling pharmaceutical products discussed in this article is very similar to the technology of distributed intelligent agents, whose centrifugal points are as follows The Provincial Council of the Order of Pharmacists is the only body empowered to assign a unique national order number to a pharmacist to practice pharmacy. Once registered, a pharmacist can manufacture molecules and submit them to the Congolese Control Office (O.C.C). for quality control and conformity. Once certified, the molecule is exposed on the market to sellers for consumption. Sometimes some drugs are recalled for ineffectiveness or for complications that they cause in patients. It is up to the competent authority to decide on the withdrawal of these. Whenever a buyer wants to purchase any pharmaceutical product, he/she is usually faced with a plethora of sellers offering the same product at different prices and with different characteristics. Since this system is made up of several actors at different levels of responsibility, we reaffirm that it fits well with the distributed paradigm. In the following we will model the process of procurement, quality control and compliance, and the sale of pharmaceutical products, in this case drugs, in a distributed environment. The methodologies for modeling computer systems can be classified into three main families: functional, object and agent [20]. The functional approach is generally applied to the field of enterprise information systems by treating both the data and processing point of view and the aspects ranging from design to implementation [20] [25]. In the object approach, modeling a system consists in decomposing it into independent units, each unit having its own characteristics (attributes) and operations that it can perform (methods). Unlike an agent, an object only reacts to a method call and all the situations it will face must be taken into account by the designer. Moreover, objects cannot have goals nor seek satisfaction and the mechanism of sending messages is summarized in a simple call of the methods of the class. There is no communication language as such between the objects in an application. The interaction mechanisms are the responsibility of the programmer. In turn, the agents have goals that give them autonomy of decision with respect to the messages received [21]. In [20], it is clearly stated that the MAS reorganizes itself continuously according to different scales thanks to the movements in the life cycle of the agents. The overall behavior of the MAS depends on the links between its different agents. The behavior will sometimes be regular, sometimes chaotic, in all cases non-linear. The behavioral model must therefore take into account the possibility of non-regularity of the system. This distinguishes the agent-based approach from those used with functional and object models. In conclusion, the functional and object models are not sufficient to model the systems of membership to the National Order of Pharmacists and the regulation of the sale of medicines. This is because they do not take into account the autonomy, learning and sociability characteristics of each component of this system as well as their complexity and evolution characteristics. To model our ADM, we used the O-MaSE methodology [24], [23]. O-MaSE (Organization based Muti-agents System Engineering) is an extension to the MASE methodology that completes it by the organization dimension. O-MaSE considers a multi-agent system as a social organization. Our methodology has thus pursued the following approach: each agent is a member of this organization and plays a specific role according to its capacity. It is mainly composed of models (Goal, Organization, Roles, Ontology, Agent, Protocol and Agent State). In the following paragraphs we present the main diagrams, namely the goal diagram, the role diagram, the agent diagram, the plan diagrams and the protocol diagrams. # a) Development of the Congolese Pharmaceutical Universe Goal Map The goal diagram of the MaSE methodology is an acyclic directed graph where the nodes represent the goals and the arcs define a sub-goal relationship [26]. Following the problematic of the present article exposed previously, the main goal is to protect the health of the population by regulating the registration to the PCOP for each candidate wishing to practice pharmacy, the quality control of medicines intended for sale. This primary objective constitutes the overall goal, noted Goal 0. Goal 0 is dependent on the achievement of four sub-goals which are: -Managing the enrollment of new pharmacy graduates in PCOP (Goal 1), -Management of the supply of medicines in stock (Goal2), -Consumption of drug products (Goal3), -And the application of pharmaceutical vigilance to decide whether or not to use the drug (Goal 4). Goal1 is dependent on meeting the objectives of several sub goals. Indeed, to enroll a new graduate in PCOP, one must first adjudicate the application to examine whether the conditions for membership are met (Goal1.1). Then, the applicant is identified for enrollment in the PCOP (Goal1.2). Goal1.1 depends on the achievement of two sub goals, the first of which is to select the application for enrollment noted (Goal1.1.1). And the second goal is the automatic rejection of the application by the PCOP noted (Goal1.1.2). Goal 1.2, which concerns «identification of a new pharmacist", is dependent on the child goal (Goal 1.2.1) of "accessing professional data", the academic curriculum. Goal 1.1.1 is only achieved if all the elements of the file are accepted, i.e. verified, validated by the PCOP noted (Goal 1.1.1.1) and also if the notification of the interested party of his national order number has taken place noted (Goal 1.1.1.2). In addition, Goal 2, "To make medicines available on the market», depends on several sub goals. In general, the marketing of a drug requires prior authorization from the health authorities noted (Goal 2.1). This is followed by the distribution of medicines through pharmacies (Goal 2.2) and the submission of a complete file to the PCOP to obtain a license to practice pharmacy (Goal 2.3). The (Goal2.1) which consists in "authorizing the marketing of a drug" entails de facto quality controls of this drug noted (Goal2.1.1). And also to consult t h e conformity information on the noted drugs (Goal 2.1.2). Goal 2.1.1 related to "Quality control of medicines" is only achieved when the compliance of health specificities is proven noted (Goal2.1.1.2) and also when the analysis result "prepare notice" has been published, noted (Goal2.1.1.1). Goal 2.1.2 "to consult data on medicinal products" depends on two sub goals: To consult data (technical details) on the medicinal product, this entails the extraction of data noted (Goal2.1.2.1) as well as the prior identification of the medicinal product concerned before it is placed on the market (Goal2.1.2.2). Goal 2.2 on "Distribution of medicinal products" is achieved if its several sub goals are met. The marketing of a batch of medicines requires the dissemination of information (publish package leaflets and labels) about the medicine noted (Goal2.2.1). Then apply the sales policy noted (Goal2.2.2). Goal 2.2.2 "Process medicine sales" is achieved if quotations have been issued to applicants, noted (Goal2.2.2.1) and then if issuing the invoice to conclude a sale has taken place, scored (Bu2.2.2.2). The Goal3 representing "Consumption of medicines" is decomposed into two sub-goals. Indeed, the purchase of a drug requires the consultation of the list of pharmacists (sellers) available at the PCOP, noted (Goal3.1). Then one must be able to carry out the drug purchase operation, noted (Goal3.2). Goal3.2 "buy product" depends in turn on two child goals. Indeed, the purchase of a drug requires the choice of a better offer among many others, noted (Goal3.2.1) and, the request for quotation from the sellers affiliated to the PCOP noted (Goal3.2.2). The goal4 related to "pharmaceutical vigilance" depends on several sub-goals. Specifically, it starts with the patient experiencing adverse events (complications) related to medication and reporting the information to the health care professional for appropriate action, noted (Goal4.1). Next comes the recording of information to decide whether the is harmful or not (Goal4.2). Goal 4.2 is achieved if the decision to withdraw or not to withdraw the problem drug from the market is issued, noted (Goal 4.2.1). And also if recommendations have been issued to pharmacists, decision makers, consumers, noted (Goal4.2.2). To illustrate this textual description, the goal diagram thus constructed is presented in Fig. 1. # b) Application of the use cases of our SMA The use case application step of the MaSE methodology is crucial to translate the goals (objectives) into associated roles and tasks [18], [12]. To build the use cases of our MAS, we will refer to the requirements described above. The use cases are full of exchanges that will become the communication elements of our MAS; they must then be converted into sequence diagrams to describe sequences of events between roles and to define the communications between the agents that will play these roles (Fig. 2). The roles thus identified in this step form the initial set of roles used to completely define the system roles in the next step [18]. In this sequence diagram the boxes at the top of the diagram represent the system roles and the arrows between the lines represent the events that occur between the roles. Time is assumed to flow from the top of the diagram to the bottom. # Fig. 2: Pharmacist Enrollment Process Sequence Diagram # Role diagram The transformation of goals into roles generally follows a sequential logic. However, there are situations where it is useful to have one role to be responsible for several goals. For each goal/sub-goal identified earlier, we will have to create a role to realize it. A role can in this case achieve two goals at the same time. In order to achieve a goal, a role must have at its disposal one (or more) "Capabilities". To identify the roles of our AMASDM, we based ourselves on the application of use cases and diagrams of the previous section (3.2). Thus eleven roles have been identified with goal mapping as follows: Health Reporter completes goal4. 2). We have mapped goals to individual roles with two exceptions. Goals, 1, 2, 3 and 4 were not mapped to roles because they were partitioned. The role diagram is given in Fig. 3. # d) Role capacity In the following Table 1, the objective is to specify the knowledge and skills "Capabilities" or "competencies" required for each role. A capability or skill is a know-how, a mastery of business rules that an agent must have before playing a given role; generally this "know-how" is translated into execution plans that will be translated into (state-transition) diagrams (section 3.5) describing the way an agent must behave. The following Table 1 describes each role and its capabilities required to achieve the goals assigned to it: Table I: Role Table # Goals Roles Capabilities # Process health information Health reporter He/she must be able to "communicate cases": identify medications, enter health reports, and transmit complicated cases to the decision maker. # Reporting adverse events Consumer of medicines The consumer must be able to "report adverse events": enter the adverse events, enter the medication taken, the date, the time taken, the source of the medication. # Notify reasoned decision Order Number Notifier He is responsible for "informing the decision of file processing" more precisely: enter the answer (negative or positive), enter the date, place, and motivation of the decision taken by the PCOP. Reject Registration request # Identify pharmacist PCOP Registration Validator He must be able to "update the membership roster": enter administrative, academic, Galen's oath, type of pharmacy to practice. In this diagram (Fig. 5) we want to mod el classes of agents capable of possessing all the necessary capabilities to play each role. Each class represents a model for a type of agent that can be instantiated several times according to the needs of the system. Indeed, these agent classes describe the global organization of the MAS composed of agent classes and the conversations between them. An agent class is a model for a type of agent in the system and is defined in terms of the roles they will play and the conversations in which they can participate. If roles are the basis of MAS design, agent classes are the building blocks used to implement this MAS [4]. # Ruling on application For the functioning of our system, we have retained seven classes of agents that work simultaneously: a first agent named "PCOP" having the capacities and know-how to play the roles: Validator of registration request, Notifier of answers and national order numbers of pharmacists and the role of Locator of pharmacists. The second class of agent selected is the "OCC" agent, having as roles: quality control of pharmaceutical products. This agent must have all the necessary capabilities to play these roles. The third agent used is the "Pharmacist", whose role is to file with the PCOP and to dispense drugs. He/she must have the necessary skills to play these roles. The fourth agent needed is the "Salesperson" whose roles are: Sales Management. The sales agent must have all the required capabilities to perform these roles. The fifth agent used is the "Buyer" agent having the roles: Buying Negotiator. He must also have the necessary capabilities to perform this role. The sixth agent used is the "Patient" agent whose only role is to report fake drugs. Finally, the "Health Professional" agent whose role is to decide on the withdrawal of medication and to process health alerts. This agent must have the capabilities to perform this role. Agent classes are similar to object-oriented class diagrams with two main differences. First, agent classes are defined by the roles they play, not by attributes and methods. Second, all relationships between agents classes are captured as conversations. The agent class diagram of our ADM is also shown in Fig. 5. The rectangles of indicate the agent classes and contain the class name and the set of roles that each agent plays. The lines with arrows identify the conversations and point from the conversation initiator to the responder. # Fig. 3: Role diagram To consolidate the textual description in Table I, the diagram in the following Fig. 4 illustrates the roles and capabilities of our MAS. The creation of roles followed by the identification of tasks previously performed requires us to specify the behavior of the role by defining the algorithmic details of the individual tasks. A role can be composed of several tasks that, taken together, define the required behavior of that role. Each task runs in its own control thread, but can communicate with each other. Concurrent tasks are defined in the plan diagrams in the following paragraphs and are specified as finite state automata, which consist of states and transitions. The states encompass the processing that takes place internally to the agent while the transitions allow communication between agents or between tasks. In this section, we detail the capability plan diagrams identified earlier, including: PCOP application validation, pharmacist location plan, sales management, drug control and certification plan, drug purchase negotiation plan finally the drug withdrawal plan on the market. # i. Application Validation» flowchart Following the reception of a PCOP membership application containing elements to be validated one by one of the type receive(validate(elts, condit)) where elts represents the elements of the file each of which describes the identity of the applicant (candidate) and other administrative information, condit designates the conditions required for the validation of the application the PCOP agent must verify the presence of each element, verify the conditions required to satisfy this application among other things (nationality, Galien's certificate of oath dating back to two months, diplomas,.) in order to register the pharmacist in the membership table by assigning him a number. Upon satisfaction of the request, a report from the PCOP is sent to the CNOP (Fig. 6) Following the reception of a "receive (select Pharmacis())" message requesting the selection of the pharmacist, the agent sets itself to the initialization state, then retrieves the input search parameter by executing the relevant thread. At the end of the execution, the agent sends the list of results found according to the criterion, otherwise a null result will be sent to indicate the absence of the pharmacist. To consolidate this description we give below the corresponding plan diagram (Fig. 7) When a receive(CFP, AID) message is received, where CFP represents the call for proposal of the drugs, AID represents the identifier of the buying agent in order to facilitate the communication between the two agents. The agent goes to the state "In this report, the agent goes to "Wait" for the approval or not of the quote by the requester and checks the buyer's answer which can be a refusal "REFUSE" or an approval "CONFIRM". In the case of acceptance, the agent sends the invoice back to the buyer for payment. The following diagram (Fig. 8) illustrates the sales management plan. The compliance and quality control process starts when the agent receives a receive (analyze (medi, AID)) message where medi represents the drug sample data to be analyzed and AID represents the requesting agent who can be a pharmacist who submits a molecule to the control or a seller who wants to expose on the market the medicines ordered outside the country. Everything starts with the analysis of the quality of the drug if it requires all the qualities, it passes to the state of verification of compliance, if it is also compliant, the drug is added to the list already on the market otherwise the product is quarantined for destruction. This algorithm will run as long as there are drugs or molecules to be controlled (Fig. 9). When the Buyer agent container is launched, it passes through the initialization state where it communicates certain technical parameters such as the type of service sought, the name of the service, the ontology of the service sought and listens to events. When it receives a message containing the drug services, it switches to the "create call for proposal" state while looking for the list of potential sellers of these drugs to submit the request. The agent switches to the "waiting" state until it receives a sales proposal that will be submitted for selection before confirming the purchase (Fig. 10). At the launch of the Health Professional agent container, this service starts to contact the Patient agents to get feedback on the drugs administered to him, a series of questions is sent to the existing or created patient agents. Upon receipt of a response and after the selection of the patient agents involved, the Health Professional agent decides whether to withdraw a given drug from the market and creates recommendations to be made public. The objective is to identify ineffective drugs or drugs that create adverse effects on the health of the population (Fig. 11). In this section the objective is to define the details of conversations according to the internal details of concurrent tasks. A conversation defines a coordination protocol between two agents and is documented using two communication sequence diagrams where we find the initiator a n d the responder [27]. Cooperation is necessary when an agent cannot achieve its goals without the help of other agents. This situation is common even in primitive species. The goals requiring cooperation can be coordination, negotiation, communication between agents. These conversations are defined according to rules called "cooperation protocols" or "Conversation protocols", which indicate the allowed sequences of messages. A wide variety of protocols exist. Examples are the "Contract Net Protocol" for bidding and the generic protocols proposed by FIPA [28], such as "Dutch auction protocol" and "Iterated Contract Net Protocol". In our approach we use the "Contract Net Protocol" for interagent negotiation [28] with the FIPA 2002 extension consisting of successive rounds of proposal confirmations and refusals [27]. The "Contract Net Protocol" is a negotiation mechanism between two types of agents: contractor and manager. It allows a manager, after some exchanges with a group of agents, to retain the services of an agent called contractor for the execution of a contract task. This protocol is qualified as a "mutual selection" type since to sign a contract, the chosen agent must commit to the manager for the execution of the task and the manager selects only the agent having provided the most advantageous proposal. The original version of the protocol has three main steps: the call for bids, the submission of proposals and the award of the contract. A protocol linking two agents is described by a sequence diagram that represents the different interactions between the entities by indicating the order of messages exchanged. In our case, we have five types of communication between the different agents. The first concerns the processing of a new PCOP registration request. The second deals with the identification of pharmacists, the third deals with the control of drugs, the fourth deals with the negotiation of purchases and finally the fifth deals with pharmacovigilance. Global # i. "PCOP Application Processing" Protocol Diagram After receiving a new application for registration D, CG, ID, AID, where D represents the university degrees obtained, CG means the certificate of Galen, ID means the identity document of the applicant and AID represents the unique identifier of the agent and its location, the PCOP agent sends a response to the applicant which can be a refusal in case the conditions are not met otherwise an acceptance of the application for registration. At the same time, a report is sent to the CNOP for a possible attribution of a national order number in case of an acceptance, otherwise a simple information report of the rejection. Acceptance of the application results in the assignment of a national order number to the pharmacist: transmit national number (NN), the PCOP agent notifies the pharmacist concerned of his registration with the national order of pharmacists confirm registration (NN) (Figure 12). After the PCOP agent approves the requests, the PCOP agent updates the table of skills, services, and locations of each registered pharmacist's pharmacy (Fig. 13). The request for publication of services promotes their services (S, AID) where S designates the services offered (drugs) by this pharmacist and AID indicates the location, address of the requesting agent. Following the reception of an alert of a medical prescription (M, Q) where M indicates the drugs to be bought and Q, the prescribed quantity of a Consumer agent who informs the Buyer agent by this prescription. The Buyer agent has to look for a potential pharmacist (seller) to buy these drugs safely. Upon this, the Buyer agent issues a query to the PCOP to find sellers who have these drugs (S, AID) where S denotes the type of service that will be used as a pharmacist selection criterion and AID denotes the location and ID of the Buyer agent. The PCOP agent provides the latter with a list of potential sellers found. The Buyer Agent now issues a call for proposal (request for quote) to the sellers received for a possible proposal or refusal. In case of a proposal, the buyer must choose one of the best offers (accept proposal) or reject the proposal (Fig. 15) Fig. 15: "Drug purchase negotiation" protocol diagram v. Pharmaceutical vigilance management" protocol diagram Following the receipt of an alert or complication due to the use of a drug or ineffectiveness or adverse reactions from a patient agent, the health professional agent must inform the agents: Vendor, Pharmacist and Consumer of the withdrawal of a problem drug from circulation (Fig. 16). # Fig. 16: Pharmaceutical vigilance Management protocol diagram h) Agent architecture of our MAS Starting from the agent class diagram described above, we will present the agent architecture of our SMA. It is worth recalling that our ADM allows us to identify the pharmacist before practicing his profession, to control his products to ensure that they comply with the standards, to negotiate the sale between the buyer and the seller. This results in a permanent "pharmaceutical vigilance" control of the effects of drugs on the market. The proposed solution also makes it possible to manage unforeseen events that may occur, such as the arrival of a new pharmacy graduate or the appearance of a complication due to the use of a drug. The architecture defined (Fig. 17 This paragraph defines the deployment of our ADM before its implementation because agents usually need information on the deployment diagram, such as a host name or an address, for communications that usually incur a cost in the network. Fig. 18 shows a deployment diagram for the National Order of Pharmacists membership and drug sales system. The cube nodes represent the agents while the connection lines represent the actual conversations between agents. Agents are identified by their class name in the form name-instance: class. The dotted boxes define the processing platforms. To reduce the communication load, we preferred to deploy the Buyer agents as well as the consumer on the same machine and the Seller, Pharmacist agents on the same machine. The rest of the agents are each deployed in a machine connected to the network in order to guarantee the advantages of the distribution obtained by using the multi-agent paradigm. We can see the message leaving from the consumer to the buyer, from the buyer agent to DF and vice versa. Note also that a click on the link of a message gives the details on the content of the message. # Conclusion This paper aimed at designing a Multi-Agent System for the regulation of drug sales in order to secure the health of the population. Indeed, the designed MAS allows the registration of pharmacists in the Provincial Council of Pharmacists, the control of the quality and conformity of drugs before their exposure on the market, the negotiation of sales between agents and the follow-up of pharmaceutical vigilance. Our MAS is composed of seven classes of agents: Pharmacist, Vendor, Buyer, OCC, PCOP, Healthcare Professional and Patient who communicate with each other using the "Contract Net Protocol" with the FIPA 2002 extension. The modeling of the system was done according to the O-MaSe methodology. The implementation of the agents as well as the interactions between them were carried out under the JADE platform. In the near future, it would be imperative to address issues of quality control and drug design, certification of pharmacy degrees to ensure the health of the population. # ( ) C Year 2021 1![Fig. 1: Goal diagram of our (MAS)](image-2.png "Fig. 1 :") 45![Fig. 4: Detailed role-capability diagram](image-3.png "Fig. 4 :Fig. 5 :") 6![Fig. 6: "Validation of registration request" plan diagram ii. Pharmacist Location MapFollowing the reception of a "receive (select Pharmacis())" message requesting the selection of the pharmacist, the agent sets itself to the initialization state, then retrieves the input search parameter by executing the relevant thread. At the end of the](image-4.png "Fig. 6 :") 7![Fig. 7: 'Pharmacist location' plan diagram iii. Drug sales management planWhen a receive(CFP, AID) message is received, where CFP represents the call for proposal of the drugs, AID represents the identifier of the buying agent in order to facilitate the communication between the two agents. The agent goes to the state "In this report, the](image-5.png "Fig. 7 :") 8![Fig. 8: "Drug Sales Management" Plan Diagram](image-6.png "Fig. 8 :") ![Drug compliance and quality control plan](image-7.png "") 9![Fig. 9: Medicines Quality and Compliance Control Plan Diagram v. Drug Purchase Negotiation PlanWhen the Buyer agent container is launched, it passes through the initialization state where it communicates certain technical parameters such as the type of service sought, the name of the service, the ontology of the service sought and listens to events. When it receives a message containing the drug](image-8.png "Fig. 9 :") 10![Fig. 10: Drug Purchase Negotiation Plan Diagram](image-9.png "Fig. 10 :") 11![Fig. 11: "Drug on the market" plan diagram g) Protocol diagramIn this section the objective is to define the details of conversations according to the internal details of concurrent tasks. A conversation defines a coordination protocol between two agents and is documented using two communication sequence diagrams where we find the initiator a n d the responder[27]. Cooperation is necessary when an agent cannot achieve its goals without the help of other agents. This situation is common even in primitive species. The goals requiring cooperation can be coordination, negotiation, communication between agents. These conversations are defined according to rules called "cooperation protocols" or "Conversation protocols", which indicate the allowed sequences of messages. A wide variety of protocols exist. Examples are the "Contract Net Protocol" for bidding and the generic protocols proposed by FIPA[28], such as "Dutch auction protocol" and "Iterated Contract Net Protocol". In our approach we use the "Contract Net Protocol" for interagent negotiation[28] with the FIPA 2002 extension consisting of successive rounds of proposal confirmations and refusals[27]. The "Contract Net Protocol" is a negotiation mechanism between two types of agents: contractor and manager. It allows a manager, after some exchanges with a group of agents, to retain the services of an agent called contractor for the execution of a contract task. This protocol is qualified as a "mutual selection" type since to sign a contract, the chosen agent must commit to the manager for the execution of the task and the manager selects only the agent having provided the most advantageous proposal. The original version of the protocol has three main steps: the call for bids, the submission of](image-10.png "Fig. 11 :") 12![Fig. 12: Protocol diagram "Processing of the PCOP registration request ii. Protocol Diagram "Identification of Pharmacist ServicesAfter the PCOP agent approves the requests, the PCOP agent updates the table of skills, services, and locations of each registered pharmacist's pharmacy](image-11.png "Fig. 12 :") 1314![Fig. 13: Protocol diagram "identification of pharmacist services" iii. Quality control protocol diagramFollowing the reception of a drug sample to be analyzed (E, Q, AID) where E represents the sample to be analyzed, Q designates the drug and AID represents the address and identifier of the pharmacist agent. The OCC agent authorizes or does not authorize the market exposure of the drug according to the analysis result (Fig.14)](image-12.png "Fig. 13 :Fig. 14 :") ![) provides for the use of seven agents: PCOP agent, Pharmacist agent, OCC agent, Sales agent, Buyer agent, Patient agent, and Healthcare Professional agent.](image-13.png "") 17![Fig. 17: Architecture diagram of our MASDeployment architecture of our MASThis paragraph defines the deployment of our ADM before its implementation because agents usually need information on the deployment diagram, such as a host name or an address, for communications that usually incur a cost in the network. Fig.18shows a deployment diagram for the National Order of Pharmacists membership and drug sales system. The cube nodes represent the agents while the connection lines represent the actual conversations](image-14.png "Fig. 17 :") 1820![Fig. 18: Deployment architecture of our MAS](image-15.png "Fig. 18 :Fig. 20 :") 21![Fig. 21: Interface de l'agent Sniffer de notre MAS](image-16.png "Fig. 21 :") ![](image-17.png "") ![](image-18.png "") © 2021 Global Journals ( ) C © 2021 Global Journals Year 2021 IV. Implementation of the Proposed Solution under Jade Given this multitude of multi-agent development tools, we chose the JADE Framework. JADE (Java Agent Development Framework) is a multi-agent platform developed in Java by CSELT (Gruppo Telecom Research Group, Italy) a n d which aims at facilitating the development of multi-agent applications in compliance with FIPA specifications [29], [27]. The JADE agent platform includes all mandatory components that control an ADM. These components are: the Agent Communication Channel (ACC) which provides the route for basic interactions between agents inside and outside the platform, the Agent Management System (AMS) which is the agent management system, and the Directory Facilitator (DF) which provides a yellow page service to the multi-agent platform. All communication between agents is performed by FIPA-ACL messages [27]. The agent platform can be distributed over several servers. A single Java application, and thus a single Java Virtual Machine (JVM), is executed on each server. Each JVM is an agent container that provides a complete environment for agent execution and allows multiple agents to run in parallel on the same server. The communication architecture provides flexible and efficient message passing. JADE creates and controls a queue of incoming messages for each agent. It should also be noted that each platform launched and all the agents that make it up are controlled by the RMA (Remote Management Agent). The choice of JADE is justified by the fact that the agents can communicate dynamically with each other, which is consistent with the multi-agent orthodoxy. For the sake of simplicity, we will limit ourselves in this paper to the implementation of the "Negotiation of the purchase of drugs" capability in our MAS. Fig. 19: JADE platform software architecture [27] a) The "Negotiate Drug Purchases" Capacity Additional programming platforms were used JADE [11], NetBeans [30], a jade.jar API [31]. The purchase of drugs in our MAS involves interaction requires a negotiation capability between the buyer and sellers. The buying agent is placed in a different container than the seller or the consumer. Note that there can be as many agents on the same container depending on the needs. In the detailed protocol diagram (Figure 20) where each agent is located in a single container with the possibility of migrating from one container to another without losing its capabilities. The main container "MainContainer" contains the main modules AMS and DF respectively the identifier of the agents and the facilitator in the search for services; we also find two containers: Container 0 which contains the first salesman (pharmacist1) and Container 1 for the second pharmacist. Containers 2 and 3 are reserved for the buyer and the seller respectively. Each selling agent publishes his services to the DF and listens for buyer events; the buying agent simply contacts the DF to find potential sellers for his needs. * Prévision de production de parcs éoliens par systèmes multi-agents auto-adaptatifs TanguyEsteoule 2019 Universite Toulouse III -Paul Sabatier PhD thesis * Analyse dynamique de grandes masses de données par Systèmes Multi-Agents Adaptatifs ElhadiBelghache 2019 Université Toulouse III -Paul Sabatier PhD Thesis * Jugement éthique pour la décision et la coopération dans les systèmes multi-agents NicolasCointe December 2017 Université de Lyon PhD thesis * Éthique collective dans les systèmes multiagents. Revue d'intel ligence artificiel le CointeNicolas BonnetGrégory BoissierOlivier 2017 * Interface pharmacien ville-hôpital : analyse des forces et des faiblesses à partir de l'expérience dans une unité de chirurgie d'un hôpital non universitaire MJeanpierre LDiaz TBerod Le Pharmacien Hospitalier et Clinicien 50 3 322 2015 * Le pharmacien de 2019, un acteur social ÉlisabethAdenot 2020 * Système multi-agents de pilotage réactif des parcours patients au sein des systèmes hospitaliers. Theses NouraBenhajji November 2017 Université de Lorraine * Le plan pharmaceutique personnalisé et le nouveau modèle de pharmacie clinique BAllenet DCabelguenne ALepelletier SProt-Labarthe CMouchoux RColomb PBedouch TBé-Rod Le Pharmacien Hospitalier et Clinicien 52 3 2017 * Étude des interventions pharmaceutiques à l'hôpital AToumi GBelhabib OGloulou OKhemili HBettayeb NChouchane Le Pharmacien Hospitalier et Clinicien 52 3 2017 * Numérique et inégalités territoriales de santé: la vente en ligne de médicaments, nouvel outil face à une pénurie éventuelle de pharmacies ? Ethics GRousset Medicine and Public Health 15 100594 2020 * Jade implemented mobile multi-agent based, distributed information platform for pervasive health care monitoring Chuan-JunSu Chia-YingWu Applied Soft Computing 11 1 2011 * Using agent-based methodologies in healthcare information systems AbdallaReem MishraAlok Cybernetics and Information Technologies 2018 * Design of a multi-agent system using the "mase" method for learners' metacognitive help HananeElbasri Hakim Allali AdilHaddi International Journal of Electrical and Computer Engineering (IJECE) 2019 * Connectivité hydro-sédimentaire dans un petit bassin versant agricole du nord-ouest de la France: de l'expertise de terrain à la modélisation par Système Multi-Agent VincentViel Robert Davidson Romain DanielReulier Delahaye Connectivité hydrosédimentaire 2017 * Système Multi-Agents pour la modélisation du volume englobant solaire BenAbdelkader RaboudiSaci Khaoula AliaBelkaïd Connectivité hydrosédimentaire 2011 * Environnement Multi-agent pour la Multi-modélisation et Simulation des Systèmes Complexes BenjaminCamus November 2015 Université de Lorraine PhD thesis * équipe systèmes multi-agents du liris Afia Laboratoire LIRIS 2019 Université Lyon 1 Technical report * A detailed approach to the analysis and design of multi agent system (mas) using multi agent system engineering (mase) methodology ChinecheremOmankwu Obinnaya ChikezieNwagu HycientKenneth Inyiama International Journal of Computer Science and Information Security 2017 IJCSIS * Génération des diagrammes auml à partir de programme jade ZinaMecibah FaridMokhati 2012 Université Oum El Bouaghi * Modélisation d'un Système Multi-Agent pour la résolution d'un Problème de Tournées de Véhicule dans une situation d'urgence FethiMguis KamelZidi KhaledGhedira PierreBorne 9th International Conference on Modeling, Optimization & SIMulation, page 7 pages Bordeaux, France 2012 * Developpement D'un Systeme Multi Agents Pour La Negocia-Tion Des Prix Approche Basee Sur Les Agents Mobiles SaciHoussam Eddine 2017 * Billot Romain, and El Faouzi Nour-Eddin. Apprentissage constructiviste à base de systems multiagents GuériauMaxime ArmettaFrédéric HassasSalima 2018 Revue d'intel ligence artificielle * Un système multiagent pour la mo-délisation des écoulements de surface sur un petit bassin versant viticole du Layon Cyril Fleurant Audrey Amiot Aziz Ballouche Pierre-Yves Communal Alain Jadas-Hécart Isabelle La Jeunesse1 David Landry1 Théodore Razakamanana Mahefa, Mamy Rakotoarisoa1 2014 Revue Internationale de Géomatique * Ontologie pour un système multi-agents dédié à une mémoire d'entreprise FabienGandon RoseDieng IC'2001, Ingénierie des Connaissances, plateforme AFIA Grenoble, France 2001. June 2001 * Une approche formelle le basée BRS pour la spécification et la vérification des architec-tures des systèmes Multi-Agents AhmedTaki Eddine Dib October 2017 Université constantine 2 PhD thesis * Joco 0.1: Conteneur d'application modulaire a base des agents bdi de la plateforme jadex suivant la méthodologie o-mase BerrichJamal BouchentoufToumi BenazziAbdelhamid Journal of Engineering Research and Application 127 8 2013. 2016 Optik * Conception et Développement d'un Système Multi-Agents d'Aide à la Décision pour la gestion de production dynamique Taghezout Noria 2012 Université Toulouse III -Paul Sabatier PhD thesis * A novel task optimal allocation approach based on contract net protocol for agent-oriented uuv swarm system modeling HongtaoLiang FengjuKang Optik 127 8 2016 * Communication multi-niveau pour des IoT-a. Interactions autour d'un mur d'écrans connectés AlexandreSchmitt FlorentCarlier ValérieRenault PascalLeroux Rencontres des Jeunes Chercheurs en Intel ligence Artificiel le Caen, France July 2017 RJCIA 2017 * Bienvenue à netbeans et www.net beans.org Netbeans * Java agent development framework 2020