You are on page 1of 15

EEE 2401: STRUCTURED PROGAMMING

LANGUAGE
SECTION (A)
FALL 2023
Presentation on
‘Emergency Hospital Finder’

Presented to
Kaled Masukur Rahman, Ph.D.
Professor, Department of EEE, UIU

Presented by
Shoheb Ahammed (021 221 098)
MD Sakif Islam Khan (021 222 015)
Tajrin Nahar Tripty (021 222 023)
Emergency Hospital Finder
Introduction
The "Emergency Hospital Finder" is a comprehensive software solution engineered to address the urgent
need for swift and efficient access to critical medical services during emergency situations. This
innovative system is designed to streamline the process of locating and accessing hospitals based on
specific services required and geographical proximity.

In times of crisis, whether prompted by medical emergencies, accidents, or unforeseen disasters,


immediate access to appropriate medical care is pivotal. This software platform aims to serve as a reliable
bridge between individuals in distress and the crucial medical assistance they urgently need.

The primary objective of the "Emergency Hospital Finder” is to provide a user-friendly interface that
facilitates quick and precise identification of hospitals offering essential medical services. By enabling
users to swiftly access contact information and service details of nearby hospitals, this system strives to
significantly reduce response times during emergencies.

In today's fast-paced world, where every minute counts in emergency situations, the importance of rapid
and efficient access to medical care cannot be overstated. The system's architecture and functionalities are
tailored to alleviate the challenges associated with locating hospitals, thereby playing a pivotal role in
potentially saving lives and mitigating adverse health outcomes.

Motivation

Need for Swift Access to Hospitals in Emergencies: Emergencies, whether medical, accident-related, or
due to natural disasters, necessitate immediate access to appropriate medical care. According to the World
Health Organization (WHO), an estimated 100 million emergency room visits occur globally every year
due to accidents. Additionally, road traffic injuries alone account for approximately 1.35 million deaths
annually (WHO - Emergency and Trauma Care).

Challenges in Hospital Locating Processes: Traditionally, individuals faced challenges in locating nearby
hospitals providing specific medical services during emergencies. Lack of real-time information,
difficulty in identifying specialized services offered by different hospitals, and unfamiliarity with the
geographical layout often led to delays in accessing medical care.

Purpose of the System: The primary motivation behind developing the Emergency Hospital Finder and
Management System is to:

Reduce Time Delays: Minimize the time taken to locate nearby hospitals offering required medical
services during emergencies.

Provide Intuitive Platform: Offer an intuitive platform that allows users to swiftly search for hospitals
based on location and required medical services.

Enable Easy Updates: Facilitate easy addition of hospitals to the system, ensuring up-to-date and
comprehensive information for users.

Significance of Immediate Access: Studies indicate that the "golden hour," referring to the critical first
hour after an emergency, significantly impacts patient outcomes. Timely access to appropriate medical
care during this window directly correlates with increased chances of survival and reduced long-term
complications.

The availability of a system that expedites the hospital locating process is crucial. This system aims to
streamline the process, potentially saving numerous lives annually by facilitating quick and efficient
access to emergency medical services.

The motivation to develop this system is deeply rooted in the critical necessity to enhance the efficiency
of accessing emergency medical services. By providing a tool that simplifies and accelerates the hospital
locating process, the system aims to contribute significantly to improved emergency healthcare delivery
and patient outcomes.

Algorithm & Flow Chart:


The system operates using a straightforward algorithm:

1. It begins by reading existing hospital information from pre-defined files based on location and
service.

2. Users can either add new hospitals or search for hospitals by specifying location and service.

3. When adding hospitals, the system prompts users to input the hospital's name and contact
information. The information is then stored in corresponding files.
4. Searching for hospitals involves users inputting the location and service they require. The system
then retrieves and displays the hospital information from the relevant file.

The flowchart for the system involves branching decisions based on user input, either for administration
or user panels, and further options for adding hospitals or searching based on location and service.

The provided flowchart illustrates a basic control flow for a hospital management system. It outlines the
sequence of actions and decisions within the system:

The flowchart begins with a START node, initiating the process flow. It proceeds to open files for data
processing, checking for any potential errors during the file opening process.

If no errors occur while opening the files, the flow moves on to read data from the files and then displays
a menu with options for the user, including an Admin Panel or User Panel choice, or the option to exit the
system.

Depending on the selection made in the menu:

 If Admin Panel is chosen, it leads to actions related to administrative functionalities, such as


adding hospitals or appending information to files.

 If User Panel is chosen, the system handles user-related functionalities, such as displaying
hospital details based on user queries.

After executing the respective functionalities in the Admin or User panels, the flow returns to the menu,
allowing for continuous user interaction.

Upon choosing the exit option in the menu, the system proceeds to close all files and ends the process,
represented by the END node. The flowchart is shown below
Code:
The code is written in C programming language and utilizes file handling for storing and retrieving
hospital information. It incorporates user input validation and file manipulation functions to manage
hospital data efficiently.

1. #include <stdio.h>

2.

3. struct address {

4. int number;

5. char name[150]; // Adjust the size based on the maximum length of the hospital name

6. };

7.

8. int main() {

9. FILE *ptr;

10. ptr = fopen("Mirpur_Heart.txt", "r");

11. if (ptr == NULL) {

12. printf("Unable to open file1.\n");

13. return 1;

14. }

15. FILE *ptr2;

16. ptr2 = fopen("Mirpur_Brain.txt", "r");

17. if (ptr2 == NULL) {

18. printf("Unable to open file2.\n");

19. return 1;

20. }

21. FILE *ptr3;


22. ptr3 = fopen("Badda_Heart.txt", "r");

23. if (ptr3 == NULL) {

24. printf("Unable to open file3.\n");

25. return 1;

26. }

27. FILE *ptr4;

28. ptr4 = fopen("Badda_Brain.txt", "r");

29. if (ptr4 == NULL) {

30. printf("Unable to open file4.\n");

31. return 1;

32. }

33.

34. FILE *W;

35. FILE *W2;

36. FILE *W3;

37. FILE *W4;

38.

39. struct address hospitalMA[3];

40. for (int i = 0; i < 3; i++) {

41. fscanf(ptr, "\"%[^\"]\"\n%d\n", hospitalMA[i].name, &hospitalMA[i].number);

42. }

43. fclose(ptr);

44.

45. struct address hospitalMB[3];


46. for (int i = 0; i < 3; i++) {

47. fscanf(ptr2, "\"%[^\"]\"\n%d\n", hospitalMB[i].name, &hospitalMB[i].number);

48. }

49. fclose(ptr2);

50.

51. struct address hospitalBA[3];

52. for (int i = 0; i < 3; i++) {

53. fscanf(ptr3, "\"%[^\"]\"\n%d\n", hospitalBA[i].name, &hospitalBA[i].number);

54. }

55. fclose(ptr3);

56.

57. struct address hospitalBB[3];

58. for (int i = 0; i < 3; i++) {

59. fscanf(ptr4, "\"%[^\"]\"\n%d\n", hospitalBB[i].name, &hospitalBB[i].number);

60. }

61. fclose(ptr4);

62.

63. int x;

64.

65. do {

66. printf("\\\Welcome to Hospital Finder///\n");

67. printf("===================================\n");

68. printf("Press 1 for Admin.\nPress 2 for User.\nPress 3 to Exit.\n");

69. scanf("%d", &x);


70.

71. if (x == 1) {

72. printf("Admin panel\n");

73. int adm;

74. printf("Press 1 to ADD Hospital.\n");

75. scanf("%d", &adm);

76.

77. if (adm == 1) {

78. printf("Press 1 to ADD to Mirpur (Heart).\nPress 2 to ADD to Mirpur (Brain)\n");

79. printf("Press 3 to ADD to Badda (Heart).\nPress 4 to ADD to Badda (Brain)\n");

80.

81. int choice;

82. scanf("%d", &choice);

83.

84. char input[200]; // Adjust the size based on the maximum length of the input

85. printf("Enter the name and contact of the hospital: ");

86. scanf(" %[^\n]", input);

87.

88. if (choice == 1) {

89. W = fopen("Mirpur_Heart.txt", "a");

90. fprintf(W, "\"%s\"\n", input);

91. fclose(W);

92. }

93. if (choice == 2) {
94. W2 = fopen("Mirpur_Brain.txt", "a");

95. fprintf(W2, "\"%s\"\n", input);

96. fclose(W2);

97. }

98. if (choice == 3) {

99. W3 = fopen("Badda_Heart.txt", "a");

100. fprintf(W3, "\"%s\"\n", input);

101. fclose(W3);

102. }

103. if (choice == 4) {

104. W4 = fopen("Badda_Brain.txt", "a");

105. fprintf(W4, "\"%s\"\n", input);

106. fclose(W4);

107. }

108. }

109. } else if (x == 2) {

110. printf("Welcome to User panel\n");

111. printf("Enter the location either Mirpur or Badda: \n");

112. char loc[30];

113. char serv[20];

114. scanf("%s", loc);

115. printf("Enter desired service either Heart or Brain: \n");

116. scanf("%s", serv);

117.
118. // Concatenate the location and service to match the file name

119. char fileName[50];

120. sprintf(fileName, "%s_%s.txt", loc, serv);

121.

122. // Open the file based on the user input

123. FILE *userFile = fopen(fileName, "r");

124. if (userFile == NULL) {

125. printf("Unable to open the requested file.\n");

126. } else {

127. // Read and print the content of the file within double quotes

128. struct address userHospital;

129. while (fscanf(userFile, "\"%[^\"]\"\n%d\n", userHospital.name, &userHospital.number) !=


EOF) {

130. printf("\"%s\"\n", userHospital.name);

131. }

132. fclose(userFile);

133. }

134. }

135. } while (x != 3);

136.

137. return 0;

138. }
Result and Analysis:

The system successfully allows users to add new hospitals and search for hospitals based on location and
services. Hospitals can be added and retrieved accurately, providing necessary contact information.
Future Work:

Future enhancements for this system could include:

 Implementation of a graphical user interface (GUI) for improved user experience.

 Integration of advanced search functionalities based on additional parameters such as specialties,


availability of facilities, etc.

 Implementation of data encryption and security measures for sensitive hospital information.

Conclusion:

The "Emergency Contact & Service System for Hospital" is a significant step towards providing a quick
and efficient solution for locating hospitals during critical situations. It addresses the immediate need for a
systematic approach to access hospital information promptly.

This system aims to contribute to the better management and accessibility of hospital information,
potentially assisting both administrative tasks and users seeking urgent medical services.

The code serves as a foundational platform that can be expanded and refined to meet evolving needs in
emergency hospital management.

Contributions:
Shoheb Ahammed (021 221 098):

 Brain storm
 Pseudo code discussion
 Report Writing
MD Sakif Islam Khan (021 222 015):

 Brain storm
 Pseudo code discussion
 Writing the code
 Powerpoint presentation
 Video presentation
 Report Writing
Tajrin Nahar Tripty (021 222 023):

 Brain storm
 Pseudo code discussion
 Writing the code
 Report Writing

You might also like