Project Report of Medical Information System
Report of Medical Information System
Page - 1
Project Report of Medical Information System Introduction of the Project Medical Information System: The "Medical Information System" has been developed to override the problems prevailing in the practicing manual system. This software is supported to eliminate and in some cases reduce the hardships faced by this existing system. Moreover this system is designed for the particular need of the company to carry out operations in a smooth and effective manner. The application is reduced as much as possible to avoid errors while entering the data. It also provides error message while entering invalid data. No formal knowledge is needed for the user to use this system. Thus by this all it proves it is user-friendly. Medical Information System , as described above, can lead to error free, secure, reliable and fast management system. It can assist the user to concentrate on their other activities rather to concentrate on the record keeping. Thus it will help organization in better utilization of resources. Every organization, whether big or small, has challenges to overcome and managing the information of Patient, Doctor, Patient Test, Doctor Schedule, Patient Test. Every Medical Information System has different Doctor needs, therefore we design exclusive employee management systems that are adapted to your managerial requirements. This is designed to assist in strategic planning, and will help you ensure that your organization is equipped with the right level of information and details for your future goals. Also, for those busy executive who are always on the go, our systems come with remote access features, which will allow you to manage your workforce anytime, at all times. These systems will ultimately allow you to better manage resources.
Page - 2
Project Report of Medical Information System Abstract of the Project Medical Information System: The purpose of Medical Information System is to automate the existing manual system by the help of computerized equipments and full-fledged computer software, fulfilling their requirements, so that their valuable data/information can be stored for a longer period with easy accessing and manipulation of the same. The required software and hardware are easily available and easy to work with.
Medical Information System, as described above, can lead to error free, secure, reliable and fast management system. It can assist the user to concentrate on their other activities rather to concentrate on the record keeping. Thus it will help organization in better utilization of resources. The organization can maintain computerized records without redundant entries. That means that one need not be distracted by information that is not relevant, while being able to reach the information. The aim is to automate its existing manual system by the help of computerized equipments and full-fledged computer software, fulfilling their requirements, so that their valuable data/information can be stored for a longer period with easy accessing and manipulation of the same. Basically the project describes how to manage for good performance and better services for the clients.
Page - 3
Project Report of Medical Information System Objective of Project on Medical Information System: The main objective of the Project on Medical Information System is to manage the details of Doctor, Patient, Patient Medicine, Patient Test, Patient Test. It manages all the information about Doctor, Doctor Schedule, Patient Test, Doctor. The project is totally built at administrative end and thus only the administrator is guaranteed the access. The purpose of the project is to build an application program to reduce the manual work for managing the Doctor, Patient, Doctor Schedule, Patient Medicine. It tracks all the details about the Patient Medicine, Patient Test, Patient Test. Functionalities provided by Medical Information System are as follows:
Provides the searching facilities based on various factors. Such as Doctor, Patient Medicine, Patient Test, Patient Test
Medical Information System also manage the Doctor Schedule details online for Patient Test details, Patient Test details, Doctor.
It tracks all the information of Patient, Doctor Schedule, Patient Test etc.
Manage the information of Patient
Shows the information and description of the Doctor, Patient Medicine
To increase efficiency of managing the Doctor, Patient
It deals with monitoring the information and transactions of Patient Test.
Manage the information of Doctor
Editing, adding and updating of Records is improved which results in proper resource management of Doctor data.
Manage the information of Patient Test
Integration of all records of Patient Test.
Page - 4
Project Report of Medical Information System Scope of the project Medical Information System It may help collecting perfect management in details. In a very short time, the collection will be obvious, simple and sensible. It will help a person to know the management of passed year perfectly and vividly. It also helps in current all works relative to Medical Information System. It will be also reduced the cost of collecting the management & collection procedure will go on smoothly. Our project aims at Business process automation, i.e. we have tried to computerize various processes of Medical Information System.
In computer system the person has to fill the various forms & number of copies of the forms can be easily generated at a time.
In computer system, it is not necessary to create the manifest but we can directly print it, which saves our time.
To assist the staff in capturing the effort spent on their respective working areas.
To utilize resources in an efficient manner by increasing their productivity through automation.
The system generates types of information that can be used for various purposes.
It satisfy the user requirement
Be easy to understand by the user and operator
Be easy to operate
Have a good user interface
Be expandable
Delivered on schedule within the budget.
Page - 5
Project Report of Medical Information System Reports of Medical Information System:
It generates the report on Doctor, Patient, Doctor Schedule
Provide filter reports on Patient Medicine, Patient Test, Patient Test
You can easily export PDF for the Doctor, Doctor Schedule, Patient Test
Application also provides excel export for Patient, Patient Medicine, Patient Test
You can also export the report into csv format for Doctor, Patient, Patient Test
Modules of Medical Information System:
Doctor Management Module: Used for managing the Doctor details.
Patient Test Module : Used for managing the details of Patient Test
Doctor Schedule Module : Used for managing the details of Doctor Schedule
Patient Management Module: Used for managing the information and details of the Patient.
Patient Medicine Module : Used for managing the Patient Medicine details
Patient Test Module : Used for managing the Patient Test informations
Login Module: Used for managing the login details
Users Module : Used for managing the users of the system
Page - 6
Project Report of Medical Information System Input Data and Validation of Project on Medical Information System
All the fields such as Doctor, Patient Medicine, Patient Test are validated and does not take invalid values
Each form for Doctor, Patient, Doctor Schedule can not accept blank value fields
Avoiding errors in data
Controlling amount of input
Integration of all the modules/forms in the system.
Preparation of the test cases.
Preparation of the possible test data with all the validation checks.
Actual testing done manually.
Recording of all the reproduced errors.
Modifications done for the errors found during testing.
Prepared the test result scripts after rectification of the errors.
Functionality of the entire module/forms.
Validations for user input.
Checking of the Coding standards to be maintained during coding.
Testing the module with all the possible test data.
Testing of the functionality involving all type of calculations etc.
Commenting standard in the source files.
The software quality plan we will use the following SQA Strategy:
In the first step, we will select the test factors and rank them. The selected test factors such as reliability, maintainability, portability or etc, will be placed in the matrix according to their ranks.
The second step is for identifying the phases of the development process. The phase should be recorded in the matrix.
The third step is that identifying the business risks of the software deliverables. The risks will be ranked into three ranks such as high, medium and low.
Page - 7
Project Report of Medical Information System Features of the project Medical Information System:
Product and Component based
Creating & Changing Issues at ease
Query Issue List to any depth
Reporting & Charting in more comprehensive way
User Accounts to control the access and maintain security
Simple Status & Resolutions
Multi-level Priorities & Severities.
Targets & Milestones for guiding the programmers
Attachments & Additional Comments for more information
Robust database back-end
Various level of reports available with a lot of filter criteria’s
It contain better storage capacity.
Accuracy in work.
Easy & fast retrieval of information.
Well designed reports.
Decrease the load of the person involve in existing manual system.
Access of any information individually.
Work becomes very speedy.
Easy to update information
Page - 8
Project Report of Medical Information System Software Requirement Specification The Software Requirements Specification is produced at the culmination of the analysis task. The function and performance allocated to software as part of system engineering are refined by establishing a complete information description, a detailed functional and behavioral description, an indication of performance requirements and design constraints, appropriate validation criteria, and other data pertinent to requirements.
The proposed system has the following requirements:
System needs store information about new entry of Doctor.
System needs to help the internal staff to keep information of Patient and find them as per various queries.
System need to maintain quantity record.
System need to keep the record of Patient Medicine.
System need to update and delete the record.
System also needs a search area.
It also needs a security system to prevent data.
Page - 9
Project Report of Medical Information System Identification of need: The old manual system was suffering from a series of drawbacks. Since whole of the system was to be maintained with hands the process of keeping, maintaining and retrieving the information was very tedious and lengthy. The records were never used to be in a systematic order. there used to be lots of difficulties in associating any particular transaction with a particular context. If any information was to be found it was required to go through the different registers, documents there would never exist anything like report generation. There would always be unnecessary consumption of time while entering records and retrieving records. One more problem was that it was very difficult to find errors while entering the records. Once the records were entered it was very difficult to update these records. The reason behind it is that there is lot of information to be maintained and have to be kept in mind while running the business .For this reason we have provided features Present system is partially automated (computerized), actually existing system is quite laborious as one has to enter same information at three different places. Following points should be well considered:
Documents and reports that must be provided by the new system: there can also be few reports, which can help management in decision-making and cost controlling, but since these reports do not get required attention, such kind of reports and information were also identified and given required attention.
Details of the information needed for each document and report.
The required frequency and distribution for each document.
Probable sources of information for each document and report.
With the implementation of computerized system, the task of keeping records in an organized manner will be solved. The greatest of all is the retrieval of information, which will be at the click of the mouse. So the proposed system helps in saving the time in different operations and making information flow easy giving valuable reports.
Page - 10
Project Report of Medical Information System Feasibility Study: After doing the project Medical Information System, study and analyzing all the existing or required functionalities of the system, the next task is to do the feasibility study for the project. All projects are feasible - given unlimited resources and infinite time. Feasibility study includes consideration of all the possible ways to provide a solution to the given problem. The proposed solution should satisfy all the user requirements and should be flexible enough so that future changes can be easily done based on the future upcoming requirements. A. Economical Feasibility This is a very important aspect to be considered while developing a project. We decided the technology based on minimum possible cost factor.
All hardware and software cost has to be borne by the organization.
Overall we have estimated that the benefits the organization is going to receive from the proposed system will surely overcome the initial costs and the later on running cost for system.
B. Technical Feasibility This included the study of function, performance and constraints that may affect the ability to achieve an acceptable system. For this feasibility study, we studied complete functionality to be provided in the system, as described in the System Requirement Specification (SRS), and checked if everything was possible using different type of frontend and backend plaformst.
C. Operational Feasibility No doubt the proposed system is fully GUI based that is very user friendly and all inputs to be taken all self-explanatory even to a layman. Besides, a proper training has been conducted to let know the essence of the system to the users so that they feel comfortable with new system. As far our study is concerned the clients are comfortable and happy as the system has cut down their loads and doing.
Page - 11
Project Report of Medical Information System System Design of Medical Information System In this phase, a logical system is built which fulfils the given requirements. Design phase of software development deals with transforming the clients’s requirements into a logically working system. Normally, design is performed in the following in the following two steps: 1. Primary Design Phase: In this phase, the system is designed at block level. The blocks are created on the basis of analysis done in the problem identification phase. Different blocks are created for different functions emphasis is put on minimising the information flow between blocks. Thus, all activities which require more interaction are kept in one block. 2. Secondary Design Phase: In the secondary phase the detailed design of every block is performed.
The general tasks involved in the design process are the following: 1. Design various blocks for overall system processes. 2. Design smaller, compact and workable modules in each block. 3. Design various database structures. 4. Specify details of programs to achieve desired functionality. 5. Design the form of inputs, and outputs of the system. 6. Perform documentation of the design. 7. System reviews.
Page - 12
Project Report of Medical Information System User Interface Design User Interface Design is concerned with the dialogue between a user and the computer. It is concerned with everything from starting the system or logging into the system to the eventually presentation of desired inputs and outputs. The overall flow of screens and messages is called a dialogue. The following steps are various guidelines for User Interface Design: 1. The system user should always be aware of what to do next. 2. The screen should be formatted so that various types of information, instructions and messages always appear in the same general display area. 3. Message, instructions or information should be displayed long enough to allow the system user to read them. 4. Use display attributes sparingly. 5. Default values for fields and answers to be entered by the user should be specified. 6. A user should not be allowed to proceed without correcting an error. 7. The system user should never get an operating system message or fatal error.
Page - 13
Project Report of Medical Information System Preliminary Product Description: The first step in the system development life cycle is the preliminary investigation to determine the feasibility of the system. The purpose of the preliminary investigation is to evaluate project requests. It is not a design study nor does it include the collection of details to describe the business system in all respect. Rather, it is the collecting of information that helps committee members to evaluate the merits of the project request and make an informed judgment about the feasibility of the proposed project. Analysts working on the preliminary investigation should accomplish the following objectives:
Clarify and understand the project request
Determine the size of the project.
Assess costs and benefits of alternative approaches.
Determine the technical and operational feasibility of alternative approaches.
Report the findings to management, with recommendations outlining the acceptance or rejection of the proposal.
Benefit to Organization The organization will obviously be able to gain benefits such as savings in
operating cost, reduction in paperwork, better utilization of human resources and more presentable image increasing goodwill.
The Initial Cost The initial cost of setting up the system will include the cost of hardware software
(OS, add-on software, utilities) & labour (setup & maintenance). The same has to bear by the organization.
Page - 14
Project Report of Medical Information System
Running Cost Besides, the initial cost the long term cost will include the running cost for the
system including the AMC, stationary charges, cost for human resources, cost for update/renewal of various related software.
Need for Training The users along with the administrator need to be trained at the time of
implementation of the system for smooth running of the system. The client will provide the training site. We talked to the management people who were managing a the financial issues of the center, the staff who were keeping the records in lots of registers and the reporting manager regarding their existing system, their requirements and their expectations from the new proposed system. Then, we did the system study of the entire system based on their requirements and the additional features they wanted to incorporate in this system. Reliable, accurate and secure data was also considered to be a complex task without this proposed system. Because there was no such record for keeping track of all the activities, which was done by the Medical Information System on the daily basis. The new system proposed and then developed by me will ease the task of the organization in consideration. It will be helpful in generating the required reports by the staff, which will help them to track their progress and services. Thus, it will ease the task of Management to a great extent as all the major activities to be performed, are computerized through this system.
Page - 15
Project Report of Medical Information System Project Category Relational Database Management System (RDBMS) : This is an RDBMS based project which is currently using MySQL for all the transaction statements. MySQL is an opensource RDBMS System. Brief Introduction about RDBSM : A relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as invented by E. F. Codd, of IBM's San Jose Research Laboratory. Many popular databases currently in use are based on the relational database model. RDBMSs have become a predominant choice for the storage of information in new databases used for financial records, manufacturing and logistical information, personnel data, and much more since the 1980s. Relational databases have often replaced legacy hierarchical databases and network databases because they are easier to understand and use. However, relational databases have been challenged by object databases, which were introduced in an attempt to address the object-relational impedance mismatch in relational database, and XML databases.
Page - 16
Project Report of Medical Information System Implementation Methodology: Model View Controller or MVC as it is popularly called, is a software design pattern for developing web applications. A Model View Controller pattern is made up of the following three parts:
Model - The lowest level of the pattern which is responsible for maintaining data.
View - This is responsible for displaying all or a portion of the data to the user.
Controller - Software Code that controls the interactions between the Model and View.
MVC is popular as it isolates the application logic from the user interface layer and supports separation of concerns. Here the Controller receives all requests for the application and then works with the Model to prepare any data needed by the View. The View then uses the data prepared by the Controller to generate a final presentable response. The MVC abstraction can be graphically represented as follows. MVC (Model View Controller Flow) Diagram DATA FLOW DIAGRAMS
Page - 17
Project Report of Medical Information System Project Planning: Software project plan can be viewed as the following: 1) Within the organization: How the project is to be implemented? What are various constraints (time, cost, staff)? What is market strategy? 2) With respect to the customer: Weekly or timely meetings with the customer with presentation on status reports. Customers feedback is also taken and further modification and developments are done. Project milestones and deliverables are also presented to the customer. For a successful software project, the following steps can be followed:
Select a project o Identifying project’s aims and objectives o Understanding requirements and specification o Methods of analysis, design and implementation o Testing techniques o Documentation
Project milestones and deliverables
Budget allocation o Exceeding limits within control
Project Estimates o Cost o Time o Size of code
Page - 18
Project Report of Medical Information System o Duration
Resource Allocation o Hardware o Software o Previous relevant project information o Digital Library
Risk Management o Risk avoidance o Risk detection
Page - 19
Project Report of Medical Information System Project Scheduling: An elementary Gantt chart or Timeline chart for the development plan is given below. The plan explains the tasks versus the time (in weeks) they will take to complete.
January
February
March
Requirement Gathering Analysis Design Coding Testing Implement W1 W2 W3 W4 W1 W2 W3 W4 W1 W2 W3 W4
Wi‘s are weeks of the months, for i =1, 2, 3, 4
Page - 20
Project Report of Medical Information System Cost estimation of the project: Software cost comprises a small percentage of overall computer-based system cost. There are a number of factors, which are considered, that can affect the ultimate cost of the software such as - human, technical, Hardware and Software availability etc. The main point that was considered during the cost estimation of project was its sizing. In spite of complete software sizing, function point and approximate lines of code were also used to "size" each element of the Software and their costing. The cost estimation done by me for Project also depend upon the baseline metrics collected from past projects and these were used in conjunction with estimation variables to develop cost and effort projections. We have basically estimated this project mainly on two bases 1) Effort Estimation - This refers to the total man-hours required for the development of the project. It even includes the time required for doing documentation and user manual. 2) Hardware Required Estimation - This includes the cost of the PCs and the hardware cost required for development of this project.
Page - 21
Project Report of Medical Information System Tools/Platform, Hardware and Software Requirement specifications:
Software Requirements: Name of component
Specification
Operating System
Windows 98, Windows XP, Windows7, Linux
Language
Java 2 Runtime Environment
Database
MySQL Server
Browser
Any of Mozilla, Opera, Chrome etc
Web Server
Tomcat 7
Software Development Kit
Java JDK 1.7 or Above
Scripting Language Enable
JSP (Java Server Pages)
Database JDBC Driver
MySQL Jconnector
Hardware Requirements: Name of component
Specification
Processor
Pentium III 630MHz
RAM
128 MB
Hard disk
20 GB
Monitor
15” color monitor
Keyboard
122 keys
Page - 22
Project Report of Medical Information System Project Profile There has been continuous effort to develop tools, which can ease the process of software development. But, with the evolving trend of different programming paradigms today’s software developers are really challenged to deal with the changing technology. Among other issues, software re-engineering is being regarded as an important process in the software development industry. One of the major tasks here is to understand software systems that are already developed and to transform them to a different software environment. Generally, this requires a lot of manual effort in going through a program that might have been developed by another programmer. This project makes a novel attempt to address the issued of program analysis and generation of diagrams, which can depict the structure of a program in a better way. Today, UML is being considered as an industrial standard for software engineering design process.
It
essential provides several diagramming tools that can express different aspects/ characteristics of program such as Use cases: Elicit requirement from users in meaningful chunks. Construction planning is built around delivering some use cases n each interaction basis for system testing. Class diagrams: shows static structure of concepts, types and class. Concepts how users think about the world; type shows interfaces of software components; classes shows implementation of software components. Interaction diagrams: shows how several objects collaborate in single use case. Package diagram: show group of classes and dependencies among them. State diagram: show how single object behaves across many use cases. Activity diagram: shows behavior with control structure. Can show many objects over many uses, many object in single use case, or implementations methods encourage parallel behavior, etc.
Page - 23
Project Report of Medical Information System The end-product of this project is a comprehensive tool that can parse any vb.net program and extract most of the object oriented features inherent in the program such as polymorphism, inheritance, encapsulation and abstraction. What is UML? UML stands for Unified Modeling Language is the successor to the wave of Object Oriented Analysis and Design (OOA&D) methods that appeared in the late 80’s. It most directly unifies the methods of Booch, Rumbaugh (OMT) and Jacobson. The UML is called a modeling language, not a method. Most methods consist at least in principle, of both a modeling language and a process. The Modeling language is that notation that methods used to express design. Notations and meta-models: The notation is the graphical stuff; it is the syntax of the modeling language. For instance, class diagram notation defines how items are concepts such as class, association, and multiplicity is represented. These are: Class Diagram: The class diagram technique has become truly central within objectoriented methods. Virtually every method has included some variation on this technique. Class diagram is also subject to the greatest range of modeling concept. Although the basic elements are needed by everyone, advanced concepts are used less often. A class diagram describes the types of objects in the system and the various kinds of static relationship that exist among them.
There are two principal kinds of static
relationship:
Association
Subtype
Class diagram also show the attributes and operations of a class and the constraints that apply to the way objects are connected.
Page - 24
Project Report of Medical Information System Association: Association represent between instances of class. From the conceptual perspective, association represents conceptual relations between classes. Each association has two roles. Each role is a direction on the association. A role also has multiplicity, which is a indication of how many object may participate in the given relationship. Generalization: A typical example of generalization evolves the personal and corporate customer of a business. They have differences but also many similarity. The similarities can be placed in generalization with personal customer and corporate customer sub type. Aggregation: aggregation is the part of relationship. It is like saying a car has engine and wheels as its parts. This sounds good, but difficult thing is considering, what is the difference is aggregation and association. Interaction: interaction diagrams are models that describes how groups of objects collaboration in some behavior. Typically, an interaction diagram captures the behavior a single use cases. The diagram shows a number of example objects and the messages that are passed between these objects in use cases. These are following approaches with simple use case that exhibits the following behavior. Objects can send a message to another. Each message is checks with given stock item. There are two diagrams: Sequence and Collaboration diagram. Package Diagram: One of the oldest questions in software methods is: how do you break down a large system into smaller systems? It becomes difficult to understand and the changes we make to them. Structured methods used functional decomposition in which the overall system was mapped as a function broken down into sub function, which is further broken down into sub function and so forth. The separation of process data is gone, functional decomposition is gone, but the old question is still remains. One idea is to group the classes together into higher-level unit. This idea, applied very loosely, appears in many
Page - 25
Project Report of Medical Information System objects. In UML, this grouping mechanism is package. The term package diagram for a diagram that shows packages of classes and the dependencies among them. A dependency exists between two elements if changes to the definition of one element may cause to other. With classes, dependencies exist for various reasons: one class sends a message to another; one class has another as part of its data; one class mentions another as a parameter to an operation. A dependency between two packages exists; and any dependencies exist between any two classes in the package. State diagram: State diagram are a familiar technique to describe the behavior of a system. They describe all the possible states a particular object can get into and how the objects state changes as a result of events that reach the objects. In most OO technique, state diagrams are drawn for a single class to show the lifetime behavior of a singe object. There are many form of state diagram, each with slightly different semantics. The most popular one used in OO technique is based on David Harel’s state chart.
Page - 26
Project Report of Medical Information System PERT CHART (Program Evaluation Review Technique) PERT chart is organized for events, activities or tasks. It is a scheduling device that shows graphically the order of the tasks to be performed. It enables the calculation of the critical path. The time and cost associated along a path is calculated and the path requires the greatest amount of elapsed time in critical path.
Specification
Design Database Part
Code database Part
Design GUI part
Code GUI Part
Integrate and Test
Implementation Write User Manual
PERT Chart representation
Page - 27
Project Report of Medical Information System GANTT CHART It is also known as Bar chart is used exclusively for scheduling purpose. It is a project controlling technique. It is used for scheduling. Budgeting and resourcing planning. A Gantt is a bar chart with each bar representing activity. The bars are drawn against a time line. The length of time planned for the activity. The Gantt chart in the figure shows the Gray parts is slack time that is the latest by which a task has been finished.
1-19 MAY 10 20-3 JUNE 10 6-25 JUNE 10 26-15 JULY 10 JULY 16 AUG 31 Specification Design Database Part
Design GUI Part
Modulation
CODE DATABASE PART
CODE GUI
BLACK BOX TESTING
PART INTEGRATE AND TEST
IMPLEMENTATION
WRITE USER MANUAL
GANTT CHART REPRESENTATION
Page - 28
Project Report of Medical Information System Use Case Model of the Project: The use case model for any system consists of “use cases”. Use cases represent different ways in which the system can be used by the user. A simple way to find all the use case of a system is to ask the questions “What the user can do using the system?” The use cases partition the system behavior into transactions such that each transaction performs some useful action from the users’ point of view. The purpose of the use case to define a piece of coherent behavior without reveling the internal structure of the system. An use case typically represents a sequence of interaction between the user and the system. These interactions consists of one main line sequence is represent the normal interaction between the user and the system. The use case model is an important analysis and design artifact (task).Use cases can be represented by drawing a use case diagram and writing an accompany text elaborating the drawing. In the use case diagram each use case is represented by an ellipse with the name of use case written inside the ellipse. All the ellipses of the system are enclosed with in a rectangle which represents the system boundary. The name of the system being moduled appears inside the rectangle. The different users of the system are represented by using stick person icon. The stick person icon is normally referred to as an Actor. The line connecting the actor and the use cases is called the communication relationship. When a stick person icon represents an external system it is annotated by the stereo type<
>.
Page - 29
Project Report of Medical Information System Dataflow Diagram: Data flow diagram is the starting point of the design phase that functionally decomposes the requirements specification. A DFD consists of a series of bubbles joined by lines. The bubbles represent data transformation and the lines represent data flows in the system. A DFD describes what data flow rather than how they are processed, so it does not hardware, software and data structure. A data-flow diagram (DFD) is a graphical representation of the "flow" of data through an information system. DFDs can also be used for the visualization of data processing (structured design). A data flow diagram (DFD) is a significant modeling technique for analyzing and constructing information processes. DFD literally means an illustration that explains the course or movement of information in a process. DFD illustrates this flow of information in a process based on the inputs and outputs. A DFD can be referred to as a Process Model. The data flow diagram is a graphical description of a system’s data and how to Process transform the data is known as Data Flow Diagram (DFD). Unlike details flow chart, DFDs don’t supply detail descriptions of modules that graphically describe a system’s data and how the data interact with the system. Data flow diagram number of symbols and the following symbols are of by DeMarco.
process
Data store
Source/sink Data Flow DeMarco & Yourdon symbols
Gane & Sarson symbols
Page - 30
Project Report of Medical Information System There are seven rules for construct a data flow diagram. i) Arrows should not cross each other. ii) Squares, circles and files must wears names. iii) Decomposed data flows must be balanced. iv) No two data flows, squares or circles can be the same names. v) Draw all data flows around the outside of the diagram. vi) Choose meaningful names for data flows, processes & data stores. vii) Control information such as record units, password and validation requirements are not penitent to a data flow diagram. Additionally, a DFD can be utilized to visualize data processing or a structured design. This basic DFD can be then disintegrated to a lower level diagram demonstrating smaller steps exhibiting details of the system that is being modeled. On a DFD, data items flow from an external data source or an internal data store to an internal data store or an external data sink, via an internal process. It is common practice to draw a context-level data flow diagram first, which shows the interaction between the system and external agents, which act as data sources and data sinks. On the context diagram (also known as the Level 0 DFD’), the system's interactions with the outside world are modeled purely in terms of data flows across the system boundary. The context diagram shows the entire system as a single process, and gives no clues as to its internal organization. This context-level DFD is next "exploded", to produce a Level 1 DFD that shows some of the detail of the system being modeled. The Level 1 DFD shows how the system is divided into sub-systems (processes), each of which deals with one or more of the data flows to or from an external agent, and which together provide all of the functionality of the system as a whole. The level 1 DFD is further spreaded and split into more descriptive and detailed description about the project as level 2 DFD.The level 2 DFD can be a number of data flows which will finally show the entire description of the software project.
Page - 31
Project Report of Medical Information System About ER Diagram: Entity Relationship Diagram E-R Model is a popular high level conceptual data model. This model and its variations are frequently used for the conceptual design of database application and many database design tools employ its concept. A database that confirms to an E-R diagram can be represented by a collecton of tables in the relational system. The mapping of E-R diagram to the entities are:
Attributes
Relations o Many-to-many o Many-to-one o One-to-many o One-to-one
Weak entities
Sub-type and super-type
The entities and their relationshops between them are shown using the following conventions.
An entity is shown in rectangle.
A diamond represent the relationship among number of entities.
The attributes shown as ovals are connected to the entities or relationship by lines.
Diamond,oval and relationships are labeled.
Page - 32
Project Report of Medical Information System
Model is an abstraction process that hides super details while highlighting details relation to application at end.
A data model is a mechanism that provides this abstraction for database application.
Data modeling is used for representing entities and their relationship in the database.
Entities are the basic units used in modeling database entities can have concrete existence or constitute ideas or concepts.
Entity type or entity set is a group of similar objects concern to an organization for which it maintain data,
Properties are characteristics of an entity also called as attributes.
A key is a single attribute or combination of 2 or more attributes of an entity set is used to identify one or more instances of the set.
In relational model we represent the entity by a relation and use tuples to represent an instance of the entity.
Relationship is used in data modeling to represent in association between an entity set.
An association between two attributes indicates that the values of the associated attributes are independent.
Page - 33
Project Report of Medical Information System Security Testing of the Project Testing is vital for the success of any software. no system design is ever perfect. Testing is also carried in two phases. first phase is during the software engineering that is during the module creation. second phase is after the completion of software. this is system testing which verifies that the whole set of programs hanged together. White Box Testing: In this technique, the close examination of the logical parts through the software are tested by cases that exercise species sets of conditions or loops. all logical parts of the software checked once. errors that can be corrected using this technique are typographical errors, logical expressions which should be executed once may be getting executed more than once and error resulting by using wrong controls and loops. When the box testing tests all the independent part within a module a logical decisions on their true and the false side are exercised , all loops and bounds within their operational bounds were exercised and internal data structure to ensure their validity were exercised once. Black Box Testing: This method enables the software engineer to device sets of input techniques that fully exercise all functional requirements for a program. black box testing tests the input, the output and the external data. it checks whether the input data is correct and whether we are getting the desired output. Alpha Testing: Acceptance testing is also sometimes called alpha testing. Be spoke systems are developed for a single customer. The alpha testing proceeds until the system developer and the customer agree that the provided system is an acceptable implementation of the system requirements. Beta Testing: On the other hand, when a system isto be marked as a software product, another process called beta testing is often conducted. During beta testing, a system is delivered among a number of potential users who agree to use it. The customers then report problems to the
Page - 34
Project Report of Medical Information System developers. This provides the product for real use and detects errors which may not have been anticipated by the system developers. Unit Testing: Each module is considered independently. it focuses on each unit of software as implemented in the source code. it is white box testing. Integration Testing: Integration testing aims at constructing the program structure while at the same constructing tests to uncover errors associated with interfacing the modules. modules are integrated by using the top down approach. Validation Testing: Validation testing was performed to ensure that all the functional and performance requirements are met. System Testing: It is executing programs to check logical changes made in it with intention of finding errors. a system is tested for online response, volume of transaction, recovery from failure etc. System testing is done to ensure that the system satisfies all the user requirements.
Page - 35
Project Report of Medical Information System Implementation and Software Specification Testings Detailed Design of Implementation This phase of the systems development life cycle refines hardware and software specifications, establishes programming plans, trains users and implements extensive testing procedures, to evaluate design and operating specifications and/or provide the basis for further modification. Technical Design This activity builds upon specifications produced during new system design, adding detailed technical specifications and documentation. Test Specifications and Planning This activity prepares detailed test specifications for individual modules and programs, job streams, subsystems, and for the system as a whole. Programming and Testing This activity encompasses actual development, writing, and testing of program units or modules. User Training This activity encompasses writing user procedure manuals, preparation of user training materials, conducting training programs, and testing procedures. Acceptance Test A final procedural review to demonstrate a system and secure user approval before a system becomes operational.
Installation Phase In this phase the new Computerized system is installed, the conversion to new procedures is fully implemented, and the potential of the new system is explored.
Page - 36
Project Report of Medical Information System System Installation The process of starting the actual use of a system and training user personnel in its operation. Review Phase This phase evaluates the successes and failures during a systems development project, and to measure the results of a new Computerized Transystem in terms of benefits and savings projected at the start of the project. Development Recap A review of a project immediately after completion to find successes and potential problems in future work. Post-Implementation Review A review, conducted after a new system has been in operation for some time, to evaluate actual system
performance
against
original
expectations
and
projections
for
cost-benefit
improvements. Also identifies maintenance projects to enhance or improve the system. THE STEPS IN THE SOFTWARE TESTING The steps involved during Unit testing are as follows: a. Preparation of the test cases. b. Preparation of the possible test data with all the validation checks. c. Complete code review of the module. d. Actual testing done manually. e. Modifications done for the errors found during testing. f.
Prepared the test result scripts.
The unit testing done included the testing of the following items: 1. Functionality of the entire module/forms. 2. Validations for user input. 3. Checking of the Coding standards to be maintained during coding.
Page - 37
Project Report of Medical Information System 4.
Testing the module with all the possible test data.
5.
Testing of the functionality involving all type of calculations etc.
6. Commenting standard in the source files. After completing the Unit testing of all the modules, the whole system is integrated with all its dependencies in that module. While System Integration, We integrated the modules one by one and tested the system at each step. This helped in reduction of errors at the time of the system testing. The steps involved during System testing are as follows:
Integration of all the modules/forms in the system.
Preparation of the test cases.
Preparation of the possible test data with all the validation checks.
Actual testing done manually.
Recording of all the reproduced errors.
Modifications done for the errors found during testing.
Prepared the test result scripts after rectification of the errors.
The System Testing done included the testing of the following items: 1. Functionality of the entire system as a whole. 2. User Interface of the system. 3. Testing the dependent modules together with all the possible test data scripts. 4. Verification and Validation testing. 5. Testing the reports with all its functionality. After the completion of system testing, the next following phase was the Acceptance Testing. Clients at their end did this and accepted the system with appreciation. Thus, we reached the final phase of the project delivery. There are other six tests, which fall under special category. They are described below:
Peak Load Test: It determines whether the system will handle the volume of activities that occur when the system is at the peak of its processing demand. For example, test the system by activating all terminals at the same time.
Page - 38
Project Report of Medical Information System
Storage Testing: It determines the capacity of the system to store transaction data on a disk or in other files.
Performance Time Testing: it determines the length of time system used by the system to process transaction data. This test is conducted prior to implementation to determine how long it takes to get a response to an inquiry, make a backup copy of a file, or send a transmission and get a response.
Recovery Testing: This testing determines the ability of user to recover data or re-start system after failure. For example, load backup copy of data and resume processing without data or integrity loss.
Procedure Testing: It determines the clarity of documentation on operation and uses of system by having users do exactly what manuals request. For example, powering down system at the end of week or responding to paper-out light on printer.
Human Factors Testing: It determines how users will use the system when processing data or preparing reports.
Page - 39
Project Report of Medical Information System System Analysis: System analysis is a process of gathering and interpreting facts, diagnosing problems and the information about the Medical Information System to recommend improvements on the system. It is a problem solving activity that requires intensive communication between the system users and system developers. System analysis or study is an important phase of any system development process. The system is studied to the minutest detail and analyzed. The system analyst plays the role of the interrogator and dwells deep into the working of the present system. The system is viewed as a whole and the input to the system are identified. The outputs from the organizations are traced to the various processes. System analysis is concerned with becoming aware of the problem, identifying the relevant and decisional variables, analyzing and synthesizing the various factors and determining an optimal or at least a satisfactory solution or program of action. A detailed study of the process must be made by various techniques like interviews, questionnaires etc. The data collected by these sources must be scrutinized to arrive to a conclusion. The conclusion is an understanding of how the system functions. This system is called the existing system. Now the existing system is subjected to close study and problem areas are identified. The designer now functions as a problem solver and tries to sort out the difficulties that the enterprise faces. The solutions are given as proposals. The proposal is then weighed with the existing system analytically and the best one is selected. The proposal is presented to the user for an endorsement by the user. The proposal is reviewed on user request and suitable changes are made. This is loop that ends as soon as the user is satisfied with proposal. Preliminary study is the process of gathering and interpreting facts, using the information for further studies on the system. Preliminary study is problem solving activity that requires intensive communication between the system users and system developers. It does various feasibility studies. In these studies a rough figure of the system activities can be obtained, from which the decision about the strategies to be followed for effective system study and analysis can be taken.
Page - 40
Project Report of Medical Information System
Existing System of Medical Information System: In the existing system the exams are done only manually but in proposed system we have to computerize the exams using this application.
Lack of security of data.
More man power.
Time consuming.
Consumes large volume of pare work.
Needs manual calculations.
No direct role for the higher officials
Proposed System of Medical Information System: The aim of proposed system is to develop a system of improved facilities. The proposed system can overcome all the limitations of the existing system. The system provides proper security and reduces the manual work.
Security of data.
Ensure data accuracy’s.
Proper control of the higher officials.
Minimize manual data entry.
Minimum time needed for the various processing.
Greater efficiency.
Better service.
User friendliness and interactive.
Minimum time required.
Page - 41
Project Report of Medical Information System Data Dictionary: This is normally represented as the data about data. It is also termed as metadata some times which gives the data about the data stored in the database. It defines each data term encountered during the analysis and design of a new system. Data elements can describe files or the processes. Following are some major symbols used in the data dictionary
= equivalent to
+ and
[] either/ or
() Optional entry
Following are some rules, which defines the construction of data dictionary entries: 1. Words should be defined to understand for what they need and not the variable need by which they may be described in the program . 2. Each word must be unique. We cannot have two definition of the same client. 3. Aliases or synonyms are allowed when two or more enters shows the same meaning. For example a vendor number may also be called as customer number. 4. A self-defining word should not be decomposed. It means that the reduction of any information in to subpart should be done only if it is really required that is it is not easy to understand directly. Data dictionary includes information such as the number of records in file, the frequency a process will run, security factor like pass word which user must enter to get excess to the information.
Page - 42
Project Report of Medical Information System
Screenshot of the Project Medical Information System
Page - 43
Project Report of Medical Information System
Page - 44
Project Report of Medical Information System
Page - 45
Project Report of Medical Information System
Page - 46
Project Report of Medical Information System
Page - 47
Project Report of Medical Information System
Page - 48
Project Report of Medical Information System
Page - 49
Project Report of Medical Information System
Page - 50
Project Report of Medical Information System
Page - 51
Project Report of Medical Information System
Page - 52
Project Report of Medical Information System
Page - 53
Project Report of Medical Information System
Page - 54
Project Report of Medical Information System
Page - 55
Project Report of Medical Information System
Page - 56
Project Report of Medical Information System
Page - 57
Project Report of Medical Information System
Page - 58
Project Report of Medical Information System
Page - 59
Project Report of Medical Information System
Page - 60
Project Report of Medical Information System
Page - 61
Project Report of Medical Information System
Page - 62
Project Report of Medical Information System
Page - 63
Project Report of Medical Information System
Page - 64
Project Report of Medical Information System
Coding of the Project Medical Information System
Page - 65
Project Report of Medical Information System Coding for Action.php
/** * @file * This is the actions engine for executing stored actions. */
/** * @defgroup actions Actions * @{ * Functions that perform an action on a certain system object. * * Action functions are declared by modules by implementing hook_action_info(). * Modules can cause action functions to run by calling actions_do(), and * trigger.module provides a user interface that lets administrators define * events that cause action functions to run. * * Each action function takes two to four arguments: * - $entity: The object that the action acts on, such as a node, comment, or * user. * - $context: Array of additional information about what triggered the action. * - $a1, $a2: Optional additional information, which can be passed into * actions_do() and will be passed along to the action function.
Page - 66
Project Report of Medical Information System * * @} */
/** * Performs a given list of actions by executing their callback functions. * * Given the IDs of actions to perform, this function finds out what the * callback functions for the actions are by querying the database. Then * it calls each callback using the function call $function($object, $context, * $a1, $a2), passing the input arguments of this function (see below) to the * action function. * * @param $action_ids * The IDs of the actions to perform. Can be a single action ID or an array * of IDs. IDs of configurable actions must be given as numeric action IDs; * IDs of non-configurable actions may be given as action function names. * @param $object * The object that the action will act on: a node, user, or comment object. * @param $context * Associative array containing extra information about what triggered * the action call, with $context['hook'] giving the name of the hook * that resulted in this call to actions_do(). * @param $a1 * Passed along to the callback.
Page - 67
Project Report of Medical Information System * @param $a2 * Passed along to the callback. * * @return * An associative array containing the results of the functions that * perform the actions, keyed on action ID. * * @ingroup actions */ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a2 = NULL) { // $stack tracks the number of recursive calls. static $stack; $stack++; if ($stack > variable_get('actions_max_stack', 35)) { watchdog('actions', 'Stack overflow: too many calls to actions_do(). Aborting to prevent infinite recursion.', array(), WATCHDOG_ERROR); return; } $actions = array(); $available_actions = actions_list(); $actions_result = array(); if (is_array($action_ids)) { $conditions = array(); foreach ($action_ids as $action_id) { if (is_numeric($action_id)) { $conditions[] = $action_id;
Page - 68
Project Report of Medical Information System } elseif (isset($available_actions[$action_id])) { $actions[$action_id] = $available_actions[$action_id]; } }
// When we have action instances we must go to the database to retrieve // instance data. if (!empty($conditions)) { $query = db_select('actions'); $query->addField('actions', 'aid'); $query->addField('actions', 'type'); $query->addField('actions', 'callback'); $query->addField('actions', 'parameters'); $query->condition('aid', $conditions, 'IN'); $result = $query->execute(); foreach ($result as $action) { $actions[$action->aid] = $action->parameters ? unserialize($action->parameters) : array(); $actions[$action->aid]['callback'] = $action->callback; $actions[$action->aid]['type'] = $action->type; } }
// Fire actions, in no particular order. foreach ($actions as $action_id => $params) {
Page - 69
Project Report of Medical Information System // Configurable actions need parameters. if (is_numeric($action_id)) { $function = $params['callback']; if (function_exists($function)) { $context = array_merge($context, $params); $actions_result[$action_id] = $function($object, $context, $a1, $a2); } else { $actions_result[$action_id] = FALSE; } } // Singleton action; $action_id is the function name. else { $actions_result[$action_id] = $action_id($object, $context, $a1, $a2); } } } // Optimized execution of a single action. else { // If it's a configurable action, retrieve stored parameters. if (is_numeric($action_ids)) { $action = db_query("SELECT callback, parameters FROM {actions} WHERE aid = :aid", array(':aid' => $action_ids))->fetchObject(); $function = $action->callback; if (function_exists($function)) { $context = array_merge($context, unserialize($action->parameters));
Page - 70
Project Report of Medical Information System $actions_result[$action_ids] = $function($object, $context, $a1, $a2); } else { $actions_result[$action_ids] = FALSE; } } // Singleton action; $action_ids is the function name. else { if (function_exists($action_ids)) { $actions_result[$action_ids] = $action_ids($object, $context, $a1, $a2); } else { // Set to avoid undefined index error messages later. $actions_result[$action_ids] = FALSE; } } } $stack--; return $actions_result; }
/** * Discovers all available actions by invoking hook_action_info(). * * This function contrasts with actions_get_all_actions(); see the
Page - 71
Project Report of Medical Information System * documentation of actions_get_all_actions() for an explanation. * * @param $reset * Reset the action info static cache. * * @return * An associative array keyed on action function name, with the same format * as the return value of hook_action_info(), containing all * modules' hook_action_info() return values as modified by any * hook_action_info_alter() implementations. * * @see hook_action_info() */ function actions_list($reset = FALSE) { $actions = &drupal_static(__FUNCTION__); if (!isset($actions) || $reset) { $actions = module_invoke_all('action_info'); drupal_alter('action_info', $actions); }
// See module_implements() for an explanation of this cast. return (array) $actions; }
/**
Page - 72
Project Report of Medical Information System * Retrieves all action instances from the database. * * This function differs from the actions_list() function, which gathers * actions by invoking hook_action_info(). The actions returned by this * function and the actions returned by actions_list() are partially * synchronized. Non-configurable actions from hook_action_info() * implementations are put into the database when actions_synchronize() is * called, which happens when admin/config/system/actions is visited. * Configurable actions are not added to the database until they are configured * in the user interface, in which case a database row is created for each * configuration of each action. * * @return * Associative array keyed by numeric action ID. Each value is an associative * array with keys 'callback', 'label', 'type' and 'configurable'. */ function actions_get_all_actions() { $actions = db_query("SELECT aid, type, callback, parameters, label FROM {actions}")>fetchAllAssoc('aid', PDO::FETCH_ASSOC); foreach ($actions as &$action) { $action['configurable'] = (bool) $action['parameters']; unset($action['parameters']); unset($action['aid']); } return $actions; }
Page - 73
Project Report of Medical Information System
/** * Creates an associative array keyed by hashes of function names or IDs. * * Hashes are used to prevent actual function names from going out into HTML * forms and coming back. * * @param $actions * An associative array with function names or action IDs as keys * and associative arrays with keys 'label', 'type', etc. as values. * This is usually the output of actions_list() or actions_get_all_actions(). * * @return * An associative array whose keys are hashes of the input array keys, and * whose corresponding values are associative arrays with components * 'callback', 'label', 'type', and 'configurable' from the input array. */ function actions_actions_map($actions) { $actions_map = array(); foreach ($actions as $callback => $array) { $key = drupal_hash_base64($callback); $actions_map[$key]['callback']
= isset($array['callback']) ? $array['callback'] : $callback;
$actions_map[$key]['label']
= $array['label'];
$actions_map[$key]['type']
= $array['type'];
$actions_map[$key]['configurable'] = $array['configurable'];
Page - 74
Project Report of Medical Information System } return $actions_map; }
/** * Returns an action array key (function or ID), given its hash. * * Faster than actions_actions_map() when you only need the function name or ID. * * @param $hash * Hash of a function name or action ID array key. The array key * is a key into the return value of actions_list() (array key is the action * function name) or actions_get_all_actions() (array key is the action ID). * * @return * The corresponding array key, or FALSE if no match is found. */ function actions_function_lookup($hash) { // Check for a function name match. $actions_list = actions_list(); foreach ($actions_list as $function => $array) { if (drupal_hash_base64($function) == $hash) { return $function; } }
Page - 75
Project Report of Medical Information System $aid = FALSE; // Must be a configurable action; check database. $result = db_query("SELECT aid FROM {actions} WHERE parameters <> ''")>fetchAll(PDO::FETCH_ASSOC); foreach ($result as $row) { if (drupal_hash_base64($row['aid']) == $hash) { $aid = $row['aid']; break; } } return $aid; }
/** * Synchronizes actions that are provided by modules in hook_action_info(). * * Actions provided by modules in hook_action_info() implementations are * synchronized with actions that are stored in the actions database table. * This is necessary so that actions that do not require configuration can * receive action IDs. * * @param $delete_orphans * If TRUE, any actions that exist in the database but are no longer * found in the code (for example, because the module that provides them has * been disabled) will be deleted. */
Page - 76
Project Report of Medical Information System function actions_synchronize($delete_orphans = FALSE) { $actions_in_code = actions_list(TRUE); $actions_in_db = db_query("SELECT aid, callback, label FROM {actions} WHERE parameters = ''")>fetchAllAssoc('callback', PDO::FETCH_ASSOC);
// Go through all the actions provided by modules. foreach ($actions_in_code as $callback => $array) { // Ignore configurable actions since their instances get put in when the // user adds the action. if (!$array['configurable']) { // If we already have an action ID for this action, no need to assign aid. if (isset($actions_in_db[$callback])) { unset($actions_in_db[$callback]); } else { // This is a new singleton that we don't have an aid for; assign one. db_insert('actions') ->fields(array( 'aid' => $callback, 'type' => $array['type'], 'callback' => $callback, 'parameters' => '', 'label' => $array['label'], )) ->execute(); watchdog('actions', "Action '%action' added.", array('%action' => $array['label']));
Page - 77
Project Report of Medical Information System } } }
// Any actions that we have left in $actions_in_db are orphaned. if ($actions_in_db) { $orphaned = array_keys($actions_in_db);
if ($delete_orphans) { $actions = db_query('SELECT aid, label FROM {actions} WHERE callback IN (:orphaned)', array(':orphaned' => $orphaned))->fetchAll(); foreach ($actions as $action) { actions_delete($action->aid); watchdog('actions', "Removed orphaned action '%action' from database.", array('%action' => $action->label)); } } else { $link = l(t('Remove orphaned actions'), 'admin/config/system/actions/orphan'); $count = count($actions_in_db); $orphans = implode(', ', $orphaned); watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO); } } }
Page - 78
Project Report of Medical Information System /** * Saves an action and its user-supplied parameter values to the database. * * @param $function * The name of the function to be called when this action is performed. * @param $type * The type of action, to describe grouping and/or context, e.g., 'node', * 'user', 'comment', or 'system'. * @param $params * An associative array with parameter names as keys and parameter values as * values. * @param $label * A user-supplied label of this particular action, e.g., 'Send e-mail * to Jim'. * @param $aid * The ID of this action. If omitted, a new action is created. * * @return * The ID of the action. */ function actions_save($function, $type, $params, $label, $aid = NULL) { // aid is the callback for singleton actions so we need to keep a separate // table for numeric aids. if (!$aid) { $aid = db_next_id();
Page - 79
Project Report of Medical Information System }
db_merge('actions') ->key(array('aid' => $aid)) ->fields(array( 'callback' => $function, 'type' => $type, 'parameters' => serialize($params), 'label' => $label, )) ->execute();
watchdog('actions', 'Action %action saved.', array('%action' => $label)); return $aid; }
/** * Retrieves a single action from the database. * * @param $aid * The ID of the action to retrieve. * * @return * The appropriate action row from the database as an object. */
Page - 80
Project Report of Medical Information System function actions_load($aid) { return db_query("SELECT aid, type, callback, parameters, label FROM {actions} WHERE aid = :aid", array(':aid' => $aid))->fetchObject(); }
/** * Deletes a single action from the database. * * @param $aid * The ID of the action to delete. */ function actions_delete($aid) { db_delete('actions') ->condition('aid', $aid) ->execute(); module_invoke_all('actions_delete', $aid); }
Page - 81
Project Report of Medical Information System Coding for Ajax.php
/** * @file * Functions for use with Drupal's Ajax framework. */
/** * @defgroup ajax Ajax framework * @{ * Functions for Drupal's Ajax framework. * * Drupal's Ajax framework is used to dynamically update parts of a page's HTML * based on data from the server. Upon a specified event, such as a button * click, a callback function is triggered which performs server-side logic and * may return updated markup, which is then replaced on-the-fly with no page * refresh necessary. * * This framework creates a PHP macro language that allows the server to * instruct JavaScript to perform actions on the client browser. When using * forms, it can be used with the #ajax property. * The #ajax property can be used to bind events to the Ajax framework. By * default, #ajax uses 'system/ajax' as its path for submission and thus calls
Page - 82
Project Report of Medical Information System * ajax_form_callback() and a defined #ajax['callback'] function. * However, you may optionally specify a different path to request or a * different callback function to invoke, which can return updated HTML or can * also return a richer set of * @link ajax_commands Ajax framework commands @endlink. * * Standard form handling is as follows: * - A form element has a #ajax property that includes #ajax['callback'] and *
omits #ajax['path']. See below about using #ajax['path'] to implement
*
advanced use-cases that require something other than standard form
*
handling.
* - On the specified element, Ajax processing is triggered by a change to *
that element.
* - The browser submits an HTTP POST request to the 'system/ajax' Drupal *
path.
* - The menu page callback for 'system/ajax', ajax_form_callback(), calls *
drupal_process_form() to process the form submission and rebuild the
*
form if necessary. The form is processed in much the same way as if it
*
were submitted without Ajax, with the same #process functions and
*
validation and submission handlers called in either case, making it easy
*
to create Ajax-enabled forms that degrade gracefully when JavaScript is
*
disabled.
* - After form processing is complete, ajax_form_callback() calls the *
function named by #ajax['callback'], which returns the form element that
*
has been updated and needs to be returned to the browser, or
Page - 83
Project Report of Medical Information System *
alternatively, an array of custom Ajax commands.
* - The page delivery callback for 'system/ajax', ajax_deliver(), renders the *
element returned by #ajax['callback'], and returns the JSON string
*
created by ajax_render() to the browser.
* - The browser unserializes the returned JSON string into an array of *
command objects and executes each command, resulting in the old page
*
content within and including the HTML element specified by
*
#ajax['wrapper'] being replaced by the new content returned by
*
#ajax['callback'], using a JavaScript animation effect specified by
*
#ajax['effect'].
* * A simple example of basic Ajax use from the * @link http://drupal.org/project/examples Examples module @endlink follows: * @code * function main_page() { * return drupal_get_form('ajax_example_simplest'); *} * * function ajax_example_simplest($form, &$form_state) { * $form = array(); * $form['changethis'] = array( *
'#type' => 'select',
*
'#options' => array(
*
'one' => 'one',
*
'two' => 'two',
Page - 84
Project Report of Medical Information System *
'three' => 'three',
*
),
*
'#ajax' => array(
*
'callback' => 'ajax_example_simplest_callback',
*
'wrapper' => 'replace_textfield_div',
*
),
* );
* // This entire form element will be replaced with an updated value. * $form['replace_textfield'] = array( *
'#type' => 'textfield',
*
'#title' => t("The default value will be changed"),
*
'#description' => t("Say something about why you chose") . "'" .
*
(!empty($form_state['values']['changethis'])
*
? $form_state['values']['changethis'] : t("Not changed yet")) . "'",
*
'#prefix' => '',
*
'#suffix' => '
',
* ); * return $form; *} * * function ajax_example_simplest_callback($form, $form_state) { * // The form has already been submitted and updated. We can return the replaced * // item as it is. * return $form['replace_textfield'];
Page - 85
Project Report of Medical Information System *} * @endcode * * In the above example, the 'changethis' element is Ajax-enabled. The default * #ajax['event'] is 'change', so when the 'changethis' element changes, * an Ajax call is made. The form is submitted and reprocessed, and then the * callback is called. In this case, the form has been automatically * built changing $form['replace_textfield']['#description'], so the callback * just returns that part of the form. * * To implement Ajax handling in a form, add '#ajax' to the form * definition of a field. That field will trigger an Ajax event when it is * clicked (or changed, depending on the kind of field). #ajax supports * the following parameters (either 'path' or 'callback' is required at least): * - #ajax['callback']: The callback to invoke to handle the server side of the * Ajax event, which will receive a $form and $form_state as arguments, and * returns a renderable array (most often a form or form fragment), an HTML * string, or an array of Ajax commands. If returning a renderable array or * a string, the value will replace the original element named in * #ajax['wrapper'], and * theme_status_messages() * will be prepended to that * element. (If the status messages are not wanted, return an array * of Ajax commands instead.) * #ajax['wrapper']. If an array of Ajax commands is returned, it will be
Page - 86
Project Report of Medical Information System * executed by the calling code. * - #ajax['path']: The menu path to use for the request. This is often omitted * and the default is used. This path should map * to a menu page callback that returns data using ajax_render(). Defaults to * 'system/ajax', which invokes ajax_form_callback(), eventually calling * the function named in #ajax['callback']. If you use a custom * path, you must set up the menu entry and handle the entire callback in your * own code. * - #ajax['wrapper']: The CSS ID of the area to be replaced by the content * returned by the #ajax['callback'] function. The content returned from * the callback will replace the entire element named by #ajax['wrapper']. * The wrapper is usually created using #prefix and #suffix properties in the * form. Note that this is the wrapper ID, not a CSS selector. So to replace * the element referred to by the CSS selector #some-selector on the page, * use #ajax['wrapper'] = 'some-selector', not '#some-selector'. * - #ajax['effect']: The jQuery effect to use when placing the new HTML. * Defaults to no effect. Valid options are 'none', 'slide', or 'fade'. * - #ajax['speed']: The effect speed to use. Defaults to 'slow'. May be * 'slow', 'fast' or a number in milliseconds which represents the length * of time the effect should run. * - #ajax['event']: The JavaScript event to respond to. This is normally * selected automatically for the type of form widget being used, and * is only needed if you need to override the default behavior. * - #ajax['prevent']: A JavaScript event to prevent when 'event' is triggered. * Defaults to 'click' for #ajax on #type 'submit', 'button', and
Page - 87
Project Report of Medical Information System * 'image_button'. Multiple events may be specified separated by spaces. * For example, when binding #ajax behaviors to form buttons, pressing the * ENTER key within a textfield triggers the 'click' event of the form's first * submit button. Triggering Ajax in this situation leads to problems, like * breaking autocomplete textfields. Because of that, Ajax behaviors are bound * to the 'mousedown' event on form buttons by default. However, binding to * 'mousedown' rather than 'click' means that it is possible to trigger a * click by pressing the mouse, holding the mouse button down until the Ajax * request is complete and the button is re-enabled, and then releasing the * mouse button. For this case, 'prevent' can be set to 'click', so an * additional event handler is bound to prevent such a click from triggering a * non-Ajax form submission. This also prevents a textfield's ENTER press * triggering a button's non-Ajax form submission behavior. * - #ajax['method']: The jQuery method to use to place the new HTML. * Defaults to 'replaceWith'. May be: 'replaceWith', 'append', 'prepend', * 'before', 'after', or 'html'. See the * @link http://api.jquery.com/category/manipulation/ jQuery manipulators documentation @endlink * for more information on these methods. * - #ajax['progress']: Choose either a throbber or progress bar that is * displayed while awaiting a response from the callback, and add an optional * message. Possible keys: 'type', 'message', 'url', 'interval'. * More information is available in the * @link forms_api_reference.html Form API Reference @endlink * * In addition to using Form API for doing in-form modification, Ajax may be
Page - 88
Project Report of Medical Information System * enabled by adding classes to buttons and links. By adding the 'use-ajax' * class to a link, the link will be loaded via an Ajax call. When using this * method, the href of the link can contain '/nojs/' as part of the path. When * the Ajax framework makes the request, it will convert this to '/ajax/'. * The server is then able to easily tell if this request was made through an * actual Ajax request or in a degraded state, and respond appropriately. * * Similarly, submit buttons can be given the class 'use-ajax-submit'. The * form will then be submitted via Ajax to the path specified in the #action. * Like the ajax-submit class above, this path will have '/nojs/' replaced with * '/ajax/' so that the submit handler can tell if the form was submitted * in a degraded state or not. * * When responding to Ajax requests, the server should do what it needs to do * for that request, then create a commands array. This commands array will * be converted to a JSON object and returned to the client, which will then * iterate over the array and process it like a macro language. * * Each command item is an associative array which will be converted to a * command object on the JavaScript side. $command_item['command'] is the type * of command, e.g. 'alert' or 'replace', and will correspond to a method in the * Drupal.ajax[command] space. The command array may contain any other data that * the command needs to process, e.g. 'method', 'selector', 'settings', etc. * * Commands are usually created with a couple of helper functions, so they
Page - 89
Project Report of Medical Information System * look like this: * @code * $commands = array(); * // Replace the content of '#object-1' on the page with 'some html here'. * $commands[] = ajax_command_replace('#object-1', 'some html here'); * // Add a visual "changed" marker to the '#object-1' element. * $commands[] = ajax_command_changed('#object-1'); * // Menu 'page callback' and #ajax['callback'] functions are supposed to * // return render arrays. If returning an Ajax commands array, it must be * // encapsulated in a render array structure. * return array('#type' => 'ajax', '#commands' => $commands); * @endcode * * When returning an Ajax command array, it is often useful to have * status messages rendered along with other tasks in the command array. * In that case the the Ajax commands array may be constructed like this: * @code * $commands = array(); * $commands[] = ajax_command_replace(NULL, $output); * $commands[] = ajax_command_prepend(NULL, theme('status_messages')); * return array('#type' => 'ajax', '#commands' => $commands); * @endcode * * See @link ajax_commands Ajax framework commands @endlink */
Page - 90
Project Report of Medical Information System
/** * Renders a commands array into JSON. * * @param $commands * A list of macro commands generated by the use of ajax_command_*() * functions. */ function ajax_render($commands = array()) { // Ajax responses aren't rendered with html.tpl.php, so we have to call // drupal_get_css() and drupal_get_js() here, in order to have new files added // during this request to be loaded by the page. We only want to send back // files that the page hasn't already loaded, so we implement simple diffing // logic using array_diff_key(). foreach (array('css', 'js') as $type) { // It is highly suspicious if $_POST['ajax_page_state'][$type] is empty, // since the base page ought to have at least one JS file and one CSS file // loaded. It probably indicates an error, and rather than making the page // reload all of the files, instead we return no new files. if (empty($_POST['ajax_page_state'][$type])) { $items[$type] = array(); } else { $function = 'drupal_add_' . $type; $items[$type] = $function();
Page - 91
Project Report of Medical Information System drupal_alter($type, $items[$type]); // @todo Inline CSS and JS items are indexed numerically. These can't be // reliably diffed with array_diff_key(), since the number can change // due to factors unrelated to the inline content, so for now, we strip // the inline items from Ajax responses, and can add support for them // when drupal_add_css() and drupal_add_js() are changed to use a hash // of the inline content as the array key. foreach ($items[$type] as $key => $item) { if (is_numeric($key)) { unset($items[$type][$key]); } } // Ensure that the page doesn't reload what it already has. $items[$type] = array_diff_key($items[$type], $_POST['ajax_page_state'][$type]); } }
// Render the HTML to load these files, and add AJAX commands to insert this // HTML in the page. We pass TRUE as the $skip_alter argument to prevent the // data from being altered again, as we already altered it above. Settings are // handled separately, afterwards. if (isset($items['js']['settings'])) { unset($items['js']['settings']); } $styles = drupal_get_css($items['css'], TRUE);
Page - 92
Project Report of Medical Information System $scripts_footer = drupal_get_js('footer', $items['js'], TRUE); $scripts_header = drupal_get_js('header', $items['js'], TRUE);
$extra_commands = array(); if (!empty($styles)) { $extra_commands[] = ajax_command_add_css($styles); } if (!empty($scripts_header)) { $extra_commands[] = ajax_command_prepend('head', $scripts_header); } if (!empty($scripts_footer)) { $extra_commands[] = ajax_command_append('body', $scripts_footer); } if (!empty($extra_commands)) { $commands = array_merge($extra_commands, $commands); }
// Now add a command to merge changes and additions to Drupal.settings. $scripts = drupal_add_js(); if (!empty($scripts['settings'])) { $settings = $scripts['settings']; array_unshift($commands, ajax_command_settings(drupal_array_merge_deep_array($settings['data']), TRUE)); }
// Allow modules to alter any Ajax response.
Page - 93
Project Report of Medical Information System drupal_alter('ajax_render', $commands);
return drupal_json_encode($commands); }
/** * Gets a form submitted via #ajax during an Ajax callback. * * This will load a form from the form cache used during Ajax operations. It * pulls the form info from $_POST. * * @return * An array containing the $form, $form_state, $form_id, $form_build_id and an * initial list of Ajax $commands. Use the list() function to break these * apart: * @code *
list($form, $form_state, $form_id, $form_build_id, $commands) = ajax_get_form();
* @endcode */ function ajax_get_form() { $form_state = form_state_defaults();
$form_build_id = $_POST['form_build_id'];
// Get the form from the cache.
Page - 94
Project Report of Medical Information System $form = form_get_cache($form_build_id, $form_state); if (!$form) { // If $form cannot be loaded from the cache, the form_build_id in $_POST // must be invalid, which means that someone performed a POST request onto // system/ajax without actually viewing the concerned form in the browser. // This is likely a hacking attempt as it never happens under normal // circumstances, so we just do nothing. watchdog('ajax', 'Invalid form POST data.', array(), WATCHDOG_WARNING); drupal_exit(); }
// When a page level cache is enabled, the form-build id might have been // replaced from within form_get_cache. If this is the case, it is also // necessary to update it in the browser by issuing an appropriate Ajax // command. $commands = array(); if (isset($form['#build_id_old']) && $form['#build_id_old'] != $form['#build_id']) { // If the form build ID has changed, issue an Ajax command to update it. $commands[] = ajax_command_update_build_id($form); $form_build_id = $form['#build_id']; }
// Since some of the submit handlers are run, redirects need to be disabled. $form_state['no_redirect'] = TRUE;
Page - 95
Project Report of Medical Information System // When a form is rebuilt after Ajax processing, its #build_id and #action // should not change. // @see drupal_rebuild_form() $form_state['rebuild_info']['copy']['#build_id'] = TRUE; $form_state['rebuild_info']['copy']['#action'] = TRUE;
// The form needs to be processed; prepare for that by setting a few internal // variables. $form_state['input'] = $_POST; $form_id = $form['#form_id'];
return array($form, $form_state, $form_id, $form_build_id, $commands); }
/** * Menu callback; handles Ajax requests for the #ajax Form API property. * * This rebuilds the form from cache and invokes the defined #ajax['callback'] * to return an Ajax command structure for JavaScript. In case no 'callback' has * been defined, nothing will happen. * * The Form API #ajax property can be set both for buttons and other input * elements. * * This function is also the canonical example of how to implement
Page - 96
Project Report of Medical Information System * #ajax['path']. If processing is required that cannot be accomplished with * a callback, re-implement this function and set #ajax['path'] to the * enhanced function. * * @see system_menu() */ function ajax_form_callback() { list($form, $form_state, $form_id, $form_build_id, $commands) = ajax_get_form(); drupal_process_form($form['#form_id'], $form, $form_state);
// We need to return the part of the form (or some other content) that needs // to be re-rendered so the browser can update the page with changed content. // Since this is the generic menu callback used by many Ajax elements, it is // up to the #ajax['callback'] function of the element (may or may not be a // button) that triggered the Ajax request to determine what needs to be // rendered. if (!empty($form_state['triggering_element'])) { $callback = $form_state['triggering_element']['#ajax']['callback']; } if (!empty($callback) && function_exists($callback)) { $result = $callback($form, $form_state);
if (!(is_array($result) && isset($result['#type']) && $result['#type'] == 'ajax')) { // Turn the response into a #type=ajax array if it isn't one already. $result = array(
Page - 97
Project Report of Medical Information System '#type' => 'ajax', '#commands' => ajax_prepare_response($result), ); }
$result['#commands'] = array_merge($commands, $result['#commands']);
return $result; } }
/** * Theme callback for Ajax requests. * * Many different pages can invoke an Ajax request to system/ajax or another * generic Ajax path. It is almost always desired for an Ajax response to be * rendered using the same theme as the base page, because most themes are built * with the assumption that they control the entire page, so if the CSS for two * themes are both loaded for a given page, they may conflict with each other. * For example, Bartik is Drupal's default theme, and Seven is Drupal's default * administration theme. Depending on whether the "Use the administration theme * when editing or creating content" checkbox is checked, the node edit form may * be displayed in either theme, but the Ajax response to the Field module's * "Add another item" button should be rendered using the same theme as the rest * of the page. Therefore, system_menu() sets the 'theme callback' for
Page - 98
Project Report of Medical Information System * 'system/ajax' to this function, and it is recommended that modules * implementing other generic Ajax paths do the same. * * @see system_menu() * @see file_menu() */ function ajax_base_page_theme() { if (!empty($_POST['ajax_page_state']['theme']) && !empty($_POST['ajax_page_state']['theme_token'])) { $theme = $_POST['ajax_page_state']['theme']; $token = $_POST['ajax_page_state']['theme_token'];
// Prevent a request forgery from giving a person access to a theme they // shouldn't be otherwise allowed to see. However, since everyone is allowed // to see the default theme, token validation isn't required for that, and // bypassing it allows most use-cases to work even when accessed from the // page cache. if ($theme === variable_get('theme_default', 'bartik') || drupal_valid_token($token, $theme)) { return $theme; } } }
/** * Packages and sends the result of a page callback as an Ajax response. *
Page - 99
Project Report of Medical Information System * This function is the equivalent of drupal_deliver_html_page(), but for Ajax * requests. Like that function, it: * - Adds needed HTTP headers. * - Prints rendered output. * - Performs end-of-request tasks. * * @param $page_callback_result * The result of a page callback. Can be one of: * - NULL: to indicate no content. * - An integer menu status constant: to indicate an error condition. * - A string of HTML content. * - A renderable array of content. * * @see drupal_deliver_html_page() */ function ajax_deliver($page_callback_result) { // Browsers do not allow JavaScript to read the contents of a user's local // files. To work around that, the jQuery Form plugin submits forms containing // a file input element to an IFRAME, instead of using XHR. Browsers do not // normally expect JSON strings as content within an IFRAME, so the response // must be customized accordingly. // @see http://malsup.com/jquery/form/#file-upload // @see Drupal.ajax.prototype.beforeSend() $iframe_upload = !empty($_POST['ajax_iframe_upload']);
Page - 100
Project Report of Medical Information System // Emit a Content-Type HTTP header if none has been added by the page callback // or by a wrapping delivery callback. if (is_null(drupal_get_http_header('Content-Type'))) { if (!$iframe_upload) { // Standard JSON can be returned to a browser's XHR object, and to // non-browser user agents. // @see http://www.ietf.org/rfc/rfc4627.txt?number=4627 drupal_add_http_header('Content-Type', 'application/json; charset=utf-8'); } else { // Browser IFRAMEs expect HTML. With most other content types, Internet // Explorer presents the user with a download prompt. drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); } }
// Print the response. $commands = ajax_prepare_response($page_callback_result); $json = ajax_render($commands); if (!$iframe_upload) { // Standard JSON can be returned to a browser's XHR object, and to // non-browser user agents. print $json; } else {
Page - 101
Project Report of Medical Information System // Browser IFRAMEs expect HTML. Browser extensions, such as Linkification // and Skype's Browser Highlighter, convert URLs, phone numbers, etc. into // links. This corrupts the JSON response. Protect the integrity of the // JSON data by making it the value of a textarea. // @see http://malsup.com/jquery/form/#file-upload // @see http://drupal.org/node/1009382 print ''; }
// Perform end-of-request tasks. ajax_footer(); }
/** * Converts the return value of a page callback into an Ajax commands array. * * @param $page_callback_result * The result of a page callback. Can be one of: * - NULL: to indicate no content. * - An integer menu status constant: to indicate an error condition. * - A string of HTML content. * - A renderable array of content. * * @return * An Ajax commands array that can be passed to ajax_render().
Page - 102
Project Report of Medical Information System */ function ajax_prepare_response($page_callback_result) { $commands = array(); if (!isset($page_callback_result)) { // Simply delivering an empty commands array is sufficient. This results // in the Ajax request being completed, but nothing being done to the page. } elseif (is_int($page_callback_result)) { switch ($page_callback_result) { case MENU_NOT_FOUND: $commands[] = ajax_command_alert(t('The requested page could not be found.')); break;
case MENU_ACCESS_DENIED: $commands[] = ajax_command_alert(t('You are not authorized to access this page.')); break;
case MENU_SITE_OFFLINE: $commands[] = ajax_command_alert(filter_xss_admin(variable_get('maintenance_mode_message', t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')))))); break; } } elseif (is_array($page_callback_result) && isset($page_callback_result['#type']) && ($page_callback_result['#type'] == 'ajax')) {
Page - 103
Project Report of Medical Information System // Complex Ajax callbacks can return a result that contains an error message // or a specific set of commands to send to the browser. $page_callback_result += element_info('ajax'); $error = $page_callback_result['#error']; if (isset($error) && $error !== FALSE) { if ((empty($error) || $error === TRUE)) { $error = t('An error occurred while handling the request: The server received invalid input.'); } $commands[] = ajax_command_alert($error); } else { $commands = $page_callback_result['#commands']; } } else { // Like normal page callbacks, simple Ajax callbacks can return HTML // content, as a string or render array. This HTML is inserted in some // relationship to #ajax['wrapper'], as determined by which jQuery DOM // manipulation method is used. The method used is specified by // #ajax['method']. The default method is 'replaceWith', which completely // replaces the old wrapper element and its content with the new HTML. $html = is_string($page_callback_result) ? $page_callback_result : drupal_render($page_callback_result); $commands[] = ajax_command_insert(NULL, $html); // Add the status messages inside the new content's wrapper element, so that // on subsequent Ajax requests, it is treated as old content.
Page - 104
Project Report of Medical Information System $commands[] = ajax_command_prepend(NULL, theme('status_messages')); }
return $commands; }
/** * Performs end-of-Ajax-request tasks. * * This function is the equivalent of drupal_page_footer(), but for Ajax * requests. * * @see drupal_page_footer() */ function ajax_footer() { // Even for Ajax requests, invoke hook_exit() implementations. There may be // modules that need very fast Ajax responses, and therefore, run Ajax // requests with an early bootstrap. if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')) { module_invoke_all('exit'); }
// Commit the user session. See above comment about the possibility of this // function running without session.inc loaded. if (function_exists('drupal_session_commit')) {
Page - 105
Project Report of Medical Information System drupal_session_commit(); } }
/** * Form element processing handler for the #ajax form property. * * @param $element * An associative array containing the properties of the element. * * @return * The processed element. * * @see ajax_pre_render_element() */ function ajax_process_form($element, &$form_state) { $element = ajax_pre_render_element($element); if (!empty($element['#ajax_processed'])) { $form_state['cache'] = TRUE; } return $element; }
/** * Adds Ajax information about an element to communicate with JavaScript.
Page - 106
Project Report of Medical Information System * * If #ajax['path'] is set on an element, this additional JavaScript is added * to the page header to attach the Ajax behaviors. See ajax.js for more * information. * * @param $element * An associative array containing the properties of the element. * Properties used: * - #ajax['event'] * - #ajax['prevent'] * - #ajax['path'] * - #ajax['options'] * - #ajax['wrapper'] * - #ajax['parameters'] * - #ajax['effect'] * * @return * The processed element with the necessary JavaScript attached to it. */ function ajax_pre_render_element($element) { // Skip already processed elements. if (isset($element['#ajax_processed'])) { return $element; } // Initialize #ajax_processed, so we do not process this element again.
Page - 107
Project Report of Medical Information System $element['#ajax_processed'] = FALSE;
// Nothing to do if there is neither a callback nor a path. if (!(isset($element['#ajax']['callback']) || isset($element['#ajax']['path']))) { return $element; }
// Add a reasonable default event handler if none was specified. if (isset($element['#ajax']) && !isset($element['#ajax']['event'])) { switch ($element['#type']) { case 'submit': case 'button': case 'image_button': // Pressing the ENTER key within a textfield triggers the click event of // the form's first submit button. Triggering Ajax in this situation // leads to problems, like breaking autocomplete textfields, so we bind // to mousedown instead of click. // @see http://drupal.org/node/216059 $element['#ajax']['event'] = 'mousedown'; // Retain keyboard accessibility by setting 'keypress'. This causes // ajax.js to trigger 'event' when SPACE or ENTER are pressed while the // button has focus. $element['#ajax']['keypress'] = TRUE; // Binding to mousedown rather than click means that it is possible to // trigger a click by pressing the mouse, holding the mouse button down
Page - 108
Project Report of Medical Information System // until the Ajax request is complete and the button is re-enabled, and // then releasing the mouse button. Set 'prevent' so that ajax.js binds // an additional handler to prevent such a click from triggering a // non-Ajax form submission. This also prevents a textfield's ENTER // press triggering this button's non-Ajax form submission behavior. if (!isset($element['#ajax']['prevent'])) { $element['#ajax']['prevent'] = 'click'; } break;
case 'password': case 'textfield': case 'textarea': $element['#ajax']['event'] = 'blur'; break;
case 'radio': case 'checkbox': case 'select': $element['#ajax']['event'] = 'change'; break;
case 'link': $element['#ajax']['event'] = 'click'; break;
Page - 109
Project Report of Medical Information System
default: return $element; } }
// Attach JavaScript settings to the element. if (isset($element['#ajax']['event'])) { $element['#attached']['library'][] = array('system', 'jquery.form'); $element['#attached']['library'][] = array('system', 'drupal.ajax');
$settings = $element['#ajax'];
// Assign default settings. $settings += array( 'path' => 'system/ajax', 'options' => array(), );
// @todo Legacy support. Remove in Drupal 8. if (isset($settings['method']) && $settings['method'] == 'replace') { $settings['method'] = 'replaceWith'; }
// Change path to URL.
Page - 110
Project Report of Medical Information System $settings['url'] = url($settings['path'], $settings['options']); unset($settings['path'], $settings['options']);
// Add special data to $settings['submit'] so that when this element // triggers an Ajax submission, Drupal's form processing can determine which // element triggered it. // @see _form_element_triggered_scripted_submission() if (isset($settings['trigger_as'])) { // An element can add a 'trigger_as' key within #ajax to make the element // submit as though another one (for example, a non-button can use this // to submit the form as though a button were clicked). When using this, // the 'name' key is always required to identify the element to trigger // as. The 'value' key is optional, and only needed when multiple elements // share the same name, which is commonly the case for buttons. $settings['submit']['_triggering_element_name'] = $settings['trigger_as']['name']; if (isset($settings['trigger_as']['value'])) { $settings['submit']['_triggering_element_value'] = $settings['trigger_as']['value']; } unset($settings['trigger_as']); } elseif (isset($element['#name'])) { // Most of the time, elements can submit as themselves, in which case the // 'trigger_as' key isn't needed, and the element's name is used. $settings['submit']['_triggering_element_name'] = $element['#name']; // If the element is a (non-image) button, its name may not identify it
Page - 111
Project Report of Medical Information System // uniquely, in which case a match on value is also needed. // @see _form_button_was_clicked() if (isset($element['#button_type']) && empty($element['#has_garbage_value'])) { $settings['submit']['_triggering_element_value'] = $element['#value']; } }
// Convert a simple #ajax['progress'] string into an array. if (isset($settings['progress']) && is_string($settings['progress'])) { $settings['progress'] = array('type' => $settings['progress']); } // Change progress path to a full URL. if (isset($settings['progress']['path'])) { $settings['progress']['url'] = url($settings['progress']['path']); unset($settings['progress']['path']); }
$element['#attached']['js'][] = array( 'type' => 'setting', 'data' => array('ajax' => array($element['#id'] => $settings)), );
// Indicate that Ajax processing was successful. $element['#ajax_processed'] = TRUE; }
Page - 112
Project Report of Medical Information System return $element; }
/** * @} End of "defgroup ajax". */
/** * @defgroup ajax_commands Ajax framework commands * @{ * Functions to create various Ajax commands. * * These functions can be used to create arrays for use with the * ajax_render() function. */
/** * Creates a Drupal Ajax 'alert' command. * * The 'alert' command instructs the client to display a JavaScript alert * dialog box. * * This command is implemented by Drupal.ajax.prototype.commands.alert() * defined in misc/ajax.js. *
Page - 113
Project Report of Medical Information System * @param $text * The message string to display to the user. * * @return * An array suitable for use with the ajax_render() function. */ function ajax_command_alert($text) { return array( 'command' => 'alert', 'text' => $text, ); }
/** * Creates a Drupal Ajax 'insert' command using the method in #ajax['method']. * * This command instructs the client to insert the given HTML using whichever * jQuery DOM manipulation method has been specified in the #ajax['method'] * variable of the element that triggered the request. * * This command is implemented by Drupal.ajax.prototype.commands.insert() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from
Page - 114
Project Report of Medical Information System * an #ajax form element then this value can be NULL. * @param $html * The data to use with the jQuery method. * @param $settings * An optional array of settings that will be used for this command only. * * @return * An array suitable for use with the ajax_render() function. */ function ajax_command_insert($selector, $html, $settings = NULL) { return array( 'command' => 'insert', 'method' => NULL, 'selector' => $selector, 'data' => $html, 'settings' => $settings, ); }
/** * Creates a Drupal Ajax 'insert/replaceWith' command. * * The 'insert/replaceWith' command instructs the client to use jQuery's * replaceWith() method to replace each element matched matched by the given * selector with the given HTML.
Page - 115
Project Report of Medical Information System * * This command is implemented by Drupal.ajax.prototype.commands.insert() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $html * The data to use with the jQuery replaceWith() method. * @param $settings * An optional array of settings that will be used for this command only. * * @return * An array suitable for use with the ajax_render() function. * * See * @link http://docs.jquery.com/Manipulation/replaceWith#content jQuery replaceWith command @endlink */ function ajax_command_replace($selector, $html, $settings = NULL) { return array( 'command' => 'insert', 'method' => 'replaceWith', 'selector' => $selector, 'data' => $html, 'settings' => $settings,
Page - 116
Project Report of Medical Information System ); }
/** * Creates a Drupal Ajax 'insert/html' command. * * The 'insert/html' command instructs the client to use jQuery's html() * method to set the HTML content of each element matched by the given * selector while leaving the outer tags intact. * * This command is implemented by Drupal.ajax.prototype.commands.insert() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $html * The data to use with the jQuery html() method. * @param $settings * An optional array of settings that will be used for this command only. * * @return * An array suitable for use with the ajax_render() function. * * @see http://docs.jquery.com/Attributes/html#val
Page - 117
Project Report of Medical Information System */ function ajax_command_html($selector, $html, $settings = NULL) { return array( 'command' => 'insert', 'method' => 'html', 'selector' => $selector, 'data' => $html, 'settings' => $settings, ); }
/** * Creates a Drupal Ajax 'insert/prepend' command. * * The 'insert/prepend' command instructs the client to use jQuery's prepend() * method to prepend the given HTML content to the inside each element matched * by the given selector. * * This command is implemented by Drupal.ajax.prototype.commands.insert() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $html
Page - 118
Project Report of Medical Information System * The data to use with the jQuery prepend() method. * @param $settings * An optional array of settings that will be used for this command only. * * @return * An array suitable for use with the ajax_render() function. * * @see http://docs.jquery.com/Manipulation/prepend#content */ function ajax_command_prepend($selector, $html, $settings = NULL) { return array( 'command' => 'insert', 'method' => 'prepend', 'selector' => $selector, 'data' => $html, 'settings' => $settings, ); }
/** * Creates a Drupal Ajax 'insert/append' command. * * The 'insert/append' command instructs the client to use jQuery's append() * method to append the given HTML content to the inside of each element matched * by the given selector.
Page - 119
Project Report of Medical Information System * * This command is implemented by Drupal.ajax.prototype.commands.insert() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $html * The data to use with the jQuery append() method. * @param $settings * An optional array of settings that will be used for this command only. * * @return * An array suitable for use with the ajax_render() function. * * @see http://docs.jquery.com/Manipulation/append#content */ function ajax_command_append($selector, $html, $settings = NULL) { return array( 'command' => 'insert', 'method' => 'append', 'selector' => $selector, 'data' => $html, 'settings' => $settings, );
Page - 120
Project Report of Medical Information System }
/** * Creates a Drupal Ajax 'insert/after' command. * * The 'insert/after' command instructs the client to use jQuery's after() * method to insert the given HTML content after each element matched by * the given selector. * * This command is implemented by Drupal.ajax.prototype.commands.insert() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $html * The data to use with the jQuery after() method. * @param $settings * An optional array of settings that will be used for this command only. * * @return * An array suitable for use with the ajax_render() function. * * @see http://docs.jquery.com/Manipulation/after#content */
Page - 121
Project Report of Medical Information System function ajax_command_after($selector, $html, $settings = NULL) { return array( 'command' => 'insert', 'method' => 'after', 'selector' => $selector, 'data' => $html, 'settings' => $settings, ); }
/** * Creates a Drupal Ajax 'insert/before' command. * * The 'insert/before' command instructs the client to use jQuery's before() * method to insert the given HTML content before each of elements matched by * the given selector. * * This command is implemented by Drupal.ajax.prototype.commands.insert() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $html * The data to use with the jQuery before() method.
Page - 122
Project Report of Medical Information System * @param $settings * An optional array of settings that will be used for this command only. * * @return * An array suitable for use with the ajax_render() function. * * @see http://docs.jquery.com/Manipulation/before#content */ function ajax_command_before($selector, $html, $settings = NULL) { return array( 'command' => 'insert', 'method' => 'before', 'selector' => $selector, 'data' => $html, 'settings' => $settings, ); }
/** * Creates a Drupal Ajax 'remove' command. * * The 'remove' command instructs the client to use jQuery's remove() method * to remove each of elements matched by the given selector, and everything * within them. *
Page - 123
Project Report of Medical Information System * This command is implemented by Drupal.ajax.prototype.commands.remove() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * * @return * An array suitable for use with the ajax_render() function. * * @see http://docs.jquery.com/Manipulation/remove#expr */ function ajax_command_remove($selector) { return array( 'command' => 'remove', 'selector' => $selector, ); }
/** * Creates a Drupal Ajax 'changed' command. * * This command instructs the client to mark each of the elements matched by the * given selector as 'ajax-changed'. *
Page - 124
Project Report of Medical Information System * This command is implemented by Drupal.ajax.prototype.commands.changed() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $asterisk * An optional CSS selector which must be inside $selector. If specified, * an asterisk will be appended to the HTML inside the $asterisk selector. * * @return * An array suitable for use with the ajax_render() function. */ function ajax_command_changed($selector, $asterisk = '') { return array( 'command' => 'changed', 'selector' => $selector, 'asterisk' => $asterisk, ); }
/** * Creates a Drupal Ajax 'css' command. * * The 'css' command will instruct the client to use the jQuery css() method
Page - 125
Project Report of Medical Information System * to apply the CSS arguments to elements matched by the given selector. * * This command is implemented by Drupal.ajax.prototype.commands.css() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $argument * An array of key/value pairs to set in the CSS for the selector. * * @return * An array suitable for use with the ajax_render() function. * * @see http://docs.jquery.com/CSS/css#properties */ function ajax_command_css($selector, $argument) { return array( 'command' => 'css', 'selector' => $selector, 'argument' => $argument, ); }
/**
Page - 126
Project Report of Medical Information System * Creates a Drupal Ajax 'settings' command. * * The 'settings' command instructs the client either to use the given array as * the settings for ajax-loaded content or to extend Drupal.settings with the * given array, depending on the value of the $merge parameter. * * This command is implemented by Drupal.ajax.prototype.commands.settings() * defined in misc/ajax.js. * * @param $argument * An array of key/value pairs to add to the settings. This will be utilized * for all commands after this if they do not include their own settings * array. * @param $merge * Whether or not the passed settings in $argument should be merged into the * global Drupal.settings on the page. By default (FALSE), the settings that * are passed to Drupal.attachBehaviors will not include the global * Drupal.settings. * * @return * An array suitable for use with the ajax_render() function. */ function ajax_command_settings($argument, $merge = FALSE) { return array( 'command' => 'settings',
Page - 127
Project Report of Medical Information System 'settings' => $argument, 'merge' => $merge, ); }
/** * Creates a Drupal Ajax 'data' command. * * The 'data' command instructs the client to attach the name=value pair of * data to the selector via jQuery's data cache. * * This command is implemented by Drupal.ajax.prototype.commands.data() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from * an #ajax form element then this value can be NULL. * @param $name * The name or key (in the key value pair) of the data attached to this * selector. * @param $value * The value of the data. Not just limited to strings can be any format. * * @return * An array suitable for use with the ajax_render() function.
Page - 128
Project Report of Medical Information System * * @see http://docs.jquery.com/Core/data#namevalue */ function ajax_command_data($selector, $name, $value) { return array( 'command' => 'data', 'selector' => $selector, 'name' => $name, 'value' => $value, ); }
/** * Creates a Drupal Ajax 'invoke' command. * * The 'invoke' command will instruct the client to invoke the given jQuery * method with the supplied arguments on the elements matched by the given * selector. Intended for simple jQuery commands, such as attr(), addClass(), * removeClass(), toggleClass(), etc. * * This command is implemented by Drupal.ajax.prototype.commands.invoke() * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. If the command is a response to a request from
Page - 129
Project Report of Medical Information System * an #ajax form element then this value can be NULL. * @param $method * The jQuery method to invoke. * @param $arguments * (optional) A list of arguments to the jQuery $method, if any. * * @return * An array suitable for use with the ajax_render() function. */ function ajax_command_invoke($selector, $method, array $arguments = array()) { return array( 'command' => 'invoke', 'selector' => $selector, 'method' => $method, 'arguments' => $arguments, ); }
/** * Creates a Drupal Ajax 'restripe' command. * * The 'restripe' command instructs the client to restripe a table. This is * usually used after a table has been modified by a replace or append command. * * This command is implemented by Drupal.ajax.prototype.commands.restripe()
Page - 130
Project Report of Medical Information System * defined in misc/ajax.js. * * @param $selector * A jQuery selector string. * * @return * An array suitable for use with the ajax_render() function. */ function ajax_command_restripe($selector) { return array( 'command' => 'restripe', 'selector' => $selector, ); }
/** * Creates a Drupal Ajax 'update_build_id' command. * * This command updates the value of a hidden form_build_id input element on a * form. It requires the form passed in to have keys for both the old build ID * in #build_id_old and the new build ID in #build_id. * * The primary use case for this Ajax command is to serve a new build ID to a * form served from the cache to an anonymous user, preventing one anonymous * user from accessing the form state of another anonymous users on Ajax enabled
Page - 131
Project Report of Medical Information System * forms. * * @param $form * The form array representing the form whose build ID should be updated. */ function ajax_command_update_build_id($form) { return array( 'command' => 'updateBuildId', 'old' => $form['#build_id_old'], 'new' => $form['#build_id'], ); }
/** * Creates a Drupal Ajax 'add_css' command. * * This method will add css via ajax in a cross-browser compatible way. * * This command is implemented by Drupal.ajax.prototype.commands.add_css() * defined in misc/ajax.js. * * @param $styles * A string that contains the styles to be added. * * @return
Page - 132
Project Report of Medical Information System * An array suitable for use with the ajax_render() function. * * @see misc/ajax.js */ function ajax_command_add_css($styles) { return array( 'command' => 'add_css', 'data' => $styles, ); }
Page - 133
Project Report of Medical Information System Coding for Archiver.php
/** * @file * Shared classes and interfaces for the archiver system. */
/** * Defines the common interface for all Archiver classes. */ interface ArchiverInterface {
/** * Constructs a new archiver instance. * * @param $file_path * The full system path of the archive to manipulate. Only local files * are supported. If the file does not yet exist, it will be created if * appropriate. */ public function __construct($file_path);
/**
Page - 134
Project Report of Medical Information System * Adds the specified file or directory to the archive. * * @param $file_path * The full system path of the file or directory to add. Only local files * and directories are supported. * * @return ArchiverInterface * The called object. */ public function add($file_path);
/** * Removes the specified file from the archive. * * @param $path * The file name relative to the root of the archive to remove. * * @return ArchiverInterface * The called object. */ public function remove($path);
/** * Extracts multiple files in the archive to the specified path. *
Page - 135
Project Report of Medical Information System * @param $path * A full system path of the directory to which to extract files. * @param $files * Optionally specify a list of files to be extracted. Files are * relative to the root of the archive. If not specified, all files * in the archive will be extracted. * * @return ArchiverInterface * The called object. */ public function extract($path, array $files = array());
/** * Lists all files in the archive. * * @return * An array of file names relative to the root of the archive. */ public function listContents(); }
Page - 136
Project Report of Medical Information System Coding for Authorize.php
/** * @file * Helper functions and form handlers used for the authorize.php script. */
/** * Form constructor for the file transfer authorization form. * * Allows the user to choose a FileTransfer type and supply credentials. * * @see authorize_filetransfer_form_validate() * @see authorize_filetransfer_form_submit() * @ingroup forms */ function authorize_filetransfer_form($form, &$form_state) { global $base_url, $is_https; $form = array();
// If possible, we want to post this form securely via HTTPS. $form['#https'] = TRUE;
Page - 137
Project Report of Medical Information System // CSS we depend on lives in modules/system/maintenance.css, which is loaded // via the default maintenance theme. $form['#attached']['js'][] = $base_url . '/misc/authorize.js';
// Get all the available ways to transfer files. if (empty($_SESSION['authorize_filetransfer_info'])) { drupal_set_message(t('Unable to continue, no available methods of file transfer'), 'error'); return array(); } $available_backends = $_SESSION['authorize_filetransfer_info'];
if (!$is_https) { $form['information']['https_warning'] = array( '#prefix' => '', '#markup' => t('WARNING: You are not using an encrypted connection, so your password will be sent in plain text.
Learn more.', array('@https-link' => 'http://drupal.org/httpsinformation')), '#suffix' => '
', ); }
// Decide on a default backend. if (isset($form_state['values']['connection_settings']['authorize_filetransfer_default'])) { $authorize_filetransfer_default = $form_state['values']['connection_settings']['authorize_filetransfer_default']; } elseif ($authorize_filetransfer_default = variable_get('authorize_filetransfer_default', NULL));
Page - 138
Project Report of Medical Information System else { $authorize_filetransfer_default = key($available_backends); }
$form['information']['main_header'] = array( '#prefix' => '', '#markup' => t('To continue, provide your server connection details'), '#suffix' => '
', );
$form['connection_settings']['#tree'] = TRUE; $form['connection_settings']['authorize_filetransfer_default'] = array( '#type' => 'select', '#title' => t('Connection method'), '#default_value' => $authorize_filetransfer_default, '#weight' => -10, );
/* * Here we create two submit buttons. For a JS enabled client, they will * only ever see submit_process. However, if a client doesn't have JS * enabled, they will see submit_connection on the first form (when picking * what filetransfer type to use, and submit_process on the second one (which * leads to the actual operation). */
Page - 139
Project Report of Medical Information System $form['submit_connection'] = array( '#prefix' => "
", '#name' => 'enter_connection_settings', '#type' => 'submit', '#value' => t('Enter connection settings'), '#weight' => 100, );
$form['submit_process'] = array( '#name' => 'process_updates', '#type' => 'submit', '#value' => t('Continue'), '#weight' => 100, '#attributes' => array('style' => 'display:none'), );
// Build a container for each connection type. foreach ($available_backends as $name => $backend) { $form['connection_settings']['authorize_filetransfer_default']['#options'][$name] = $backend['title']; $form['connection_settings'][$name] = array( '#type' => 'container', '#attributes' => array('class' => array("filetransfer-$name", 'filetransfer')), ); // We can't use #prefix on the container itself since then the header won't // be hidden and shown when the containers are being manipulated via JS.
Page - 140
Project Report of Medical Information System $form['connection_settings'][$name]['header'] = array( '#markup' => '' . t('@backend connection settings', array('@backend' => $backend['title'])) . '
', );
$form['connection_settings'][$name] += _authorize_filetransfer_connection_settings($name);
// Start non-JS code. if (isset($form_state['values']['connection_settings']['authorize_filetransfer_default']) && $form_state['values']['connection_settings']['authorize_filetransfer_default'] == $name) {
// If the user switches from JS to non-JS, Drupal (and Batch API) will // barf. This is a known bug: http://drupal.org/node/229825. setcookie('has_js', '', time() - 3600, '/'); unset($_COOKIE['has_js']);
// Change the submit button to the submit_process one. $form['submit_process']['#attributes'] = array(); unset($form['submit_connection']);
// Activate the proper filetransfer settings form. $form['connection_settings'][$name]['#attributes']['style'] = 'display:block'; // Disable the select box. $form['connection_settings']['authorize_filetransfer_default']['#disabled'] = TRUE;
// Create a button for changing the type of connection.
Page - 141
Project Report of Medical Information System $form['connection_settings']['change_connection_type'] = array( '#name' => 'change_connection_type', '#type' => 'submit', '#value' => t('Change connection type'), '#weight' => -5, '#attributes' => array('class' => array('filetransfer-change-connection-type')), ); } // End non-JS code. } return $form; }
/** * Generates the Form API array for a given connection backend's settings. * * @param $backend * The name of the backend (e.g. 'ftp', 'ssh', etc). * * @return * Form API array of connection settings for the given backend. * * @see hook_filetransfer_backends() */ function _authorize_filetransfer_connection_settings($backend) {
Page - 142
Project Report of Medical Information System $defaults = variable_get('authorize_filetransfer_connection_settings_' . $backend, array()); $form = array();
// Create an instance of the file transfer class to get its settings form. $filetransfer = authorize_get_filetransfer($backend); if ($filetransfer) { $form = $filetransfer->getSettingsForm(); } // Fill in the defaults based on the saved settings, if any. _authorize_filetransfer_connection_settings_set_defaults($form, NULL, $defaults); return $form; }
/** * Sets the default settings on a file transfer connection form recursively. * * The default settings for the file transfer connection forms are saved in * the database. The settings are stored as a nested array in the case of a * settings form that has fieldsets or otherwise uses a nested structure. * Therefore, to properly add defaults, we need to walk through all the * children form elements and process those defaults recursively. * * @param $element * Reference to the Form API form element we're operating on. * @param $key
Page - 143
Project Report of Medical Information System * The key for our current form element, if any. * @param array $defaults * The default settings for the file transfer backend we're operating on. */ function _authorize_filetransfer_connection_settings_set_defaults(&$element, $key, array $defaults) { // If we're operating on a form element which isn't a fieldset, and we have // a default setting saved, stash it in #default_value. if (!empty($key) && isset($defaults[$key]) && isset($element['#type']) && $element['#type'] != 'fieldset') { $element['#default_value'] = $defaults[$key]; } // Now, we walk through all the child elements, and recursively invoke // ourself on each one. Since the $defaults settings array can be nested // (because of #tree, any values inside fieldsets will be nested), if // there's a subarray of settings for the form key we're currently // processing, pass in that subarray to the recursive call. Otherwise, just // pass on the whole $defaults array. foreach (element_children($element) as $child_key) { _authorize_filetransfer_connection_settings_set_defaults($element[$child_key], $child_key, ((isset($defaults[$key]) && is_array($defaults[$key])) ? $defaults[$key] : $defaults)); } }
/** * Form validation handler for authorize_filetransfer_form(). *
Page - 144
Project Report of Medical Information System * @see authorize_filetransfer_form() * @see authorize_filetransfer_submit() */ function authorize_filetransfer_form_validate($form, &$form_state) { // Only validate the form if we have collected all of the user input and are // ready to proceed with updating or installing. if ($form_state['triggering_element']['#name'] != 'process_updates') { return; }
if (isset($form_state['values']['connection_settings'])) { $backend = $form_state['values']['connection_settings']['authorize_filetransfer_default']; $filetransfer = authorize_get_filetransfer($backend, $form_state['values']['connection_settings'][$backend]); try { if (!$filetransfer) { throw new Exception(t('Error, this type of connection protocol (%backend) does not exist.', array('%backend' => $backend))); } $filetransfer->connect(); } catch (Exception $e) { // The format of this error message is similar to that used on the // database connection form in the installer. form_set_error('connection_settings', t('Failed to connect to the server. The server reports the following message: !message For more help installing or updating code on your server, see the handbook.', array(
Page - 145
Project Report of Medical Information System '!message' => '' . $e->getMessage() . '
', '@handbook_url' => 'http://drupal.org/documentation/install/modules-themes', ))); } } }
/** * Form submission handler for authorize_filetransfer_form(). * * @see authorize_filetransfer_form() * @see authorize_filetransfer_validate() */ function authorize_filetransfer_form_submit($form, &$form_state) { global $base_url; switch ($form_state['triggering_element']['#name']) { case 'process_updates':
// Save the connection settings to the DB. $filetransfer_backend = $form_state['values']['connection_settings']['authorize_filetransfer_default'];
// If the database is available then try to save our settings. We have // to make sure it is available since this code could potentially (will // likely) be called during the installation process, before the // database is set up.
Page - 146
Project Report of Medical Information System try { $connection_settings = array(); foreach ($form_state['values']['connection_settings'][$filetransfer_backend] as $key => $value) { // We do *not* want to store passwords in the database, unless the // backend explicitly says so via the magic #filetransfer_save form // property. Otherwise, we store everything that's not explicitly // marked with #filetransfer_save set to FALSE. if (!isset($form['connection_settings'][$filetransfer_backend][$key]['#filetransfer_save'])) { if ($form['connection_settings'][$filetransfer_backend][$key]['#type'] != 'password') { $connection_settings[$key] = $value; } } // The attribute is defined, so only save if set to TRUE. elseif ($form['connection_settings'][$filetransfer_backend][$key]['#filetransfer_save']) { $connection_settings[$key] = $value; } } // Set this one as the default authorize method. variable_set('authorize_filetransfer_default', $filetransfer_backend); // Save the connection settings minus the password. variable_set('authorize_filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings);
$filetransfer = authorize_get_filetransfer($filetransfer_backend, $form_state['values']['connection_settings'][$filetransfer_backend]);
Page - 147
Project Report of Medical Information System // Now run the operation. authorize_run_operation($filetransfer); } catch (Exception $e) { // If there is no database available, we don't care and just skip // this part entirely. }
break;
case 'enter_connection_settings': $form_state['rebuild'] = TRUE; break;
case 'change_connection_type': $form_state['rebuild'] = TRUE; unset($form_state['values']['connection_settings']['authorize_filetransfer_default']); break; }
Page - 148
Project Report of Medical Information System
Conclusion of the Project Medical Information System: Our project is only a humble venture to satisfy the needs to manage their project work. Several user friendly coding have also adopted. This package shall prove to be a powerful package in satisfying all the requirements of the school. The objective of software planning is to provide a frame work that enables the manger to make reasonable estimates made within a limited time frame at the beginning of the software project and should be updated regularly as the project progresses. At the end it is concluded that we have made effort on following points…
A description of the background and context of the project and its relation to work already done in the area.
Made statement of the aims and objectives of the project.
The description of Purpose, Scope, and applicability.
We define the problem on which we are working in the project.
We describe the requirement Specifications of the system and the actions that can be done on these things.
We understand the problem domain and produce a model of the system, which describes operations that can be performed on the system.
We included features and operations in detail, including screen layouts.
We designed user interface and security issues related to system.
Finally the system is implemented and tested according to test cases.
Page - 149
Project Report of Medical Information System Future Scope of the Project: In a nutshell, it can be summarized that the future scope of the project circles around maintaining information regarding:
We can add printer in future.
We can give more advance software for Medical Information System including more facilities
We will host the platform on online servers to make it accessible worldwide
Integrate multiple load balancers to distribute the loads of the system
Create the master and slave database structure to reduce the overload of the database queries
Implement the backup mechanism for taking backup of codebase and database on regular basis on different servers
The above mentioned points are the enhancements which can be done to increase the applicability and usage of this project. Here we can maintain the records of Doctor and Patient. Also, as it can be seen that now-a-days the players are versatile, i.e. so there is a scope for introducing a method to maintain the Medical Information System. Enhancements can be done to maintain all the Doctor, Patient, Patient Medicine, Patient Test, Patient Test.
We have left all the options open so that if there is any other future requirement in the system by the user for the enhancement of the system then it is possible to implement them.In the last we would like to thanks all the persons involved in the development of the system directly or indirectly. We hope that the project will serve its purpose for which it is develop there by underlining success of process.
Page - 150
Project Report of Medical Information System Limitation of Project on Medical Information System Although I have put my best efforts to make the software flexible, easy to operate but limitations cannot be ruled out even by me. Though the software presents a broad range of options to its users some intricate options could not be covered into it; partly because of logistic and partly due to lack of sophistication. Paucity of time was also major constraint, thus it was not possible to make the software foolproof and dynamic. Lack of time also compelled me to ignore some part such as storing old result of the candidate etc. Considerable efforts have made the software easy to operate even for the people not related to the field of computers but it is acknowledged that a layman may find it a bit problematic at the first instance. The user is provided help at each step for his convenience in working with the software. List of limitations which is available in the Medical Information System:
Excel export has not been developed for Doctor, Patient due to some criticality.
The transactions are executed in off-line mode, hence on-line data for Patient Medicine, Patient Test capture and modification is not possible.
Off-line reports of Doctor, Patient Test, Patient Medicine cannot be generated due to batch mode execution.
Page - 151
Project Report of Medical Information System References and Bibliography:
Google for problem solving
http://www.javaworld.com/javaworld/jw-01-1998/jw-01-Credentialreview.html
Database Programming with JDBC and Java by O'Reilly
Head First Java 2nd Edition
http://www.jdbc-tutorial.com/
Java and Software Design Concepts by Apress
https://www.tutorialspoint.com/java/
http://www.javatpoint.com/java-tutorial
https://docs.oracle.com/javase/tutorial/
http://www.wampserver.com/en/
http://www.JSP.net/
http://www.tutorialspoint.com/mysql/
httpd.apache.org/docs/2.0/misc/tutorials.html
Page - 152