Guest User

Untitled

a guest
Nov 15th, 2016
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. enum boolean {false, true};
  4. enum sex {male, female};
  5. int login();
  6. void verifyPatient(char);
  7. void searchDrug(char);
  8. char drugSearchedFor[15];
  9. int verifyNoAllergies(char,char);
  10. char patientNameSearchedFor;
  11. int allClear;
  12. typedef struct searchDatabase{
  13. /*this will be used to compare either
  14. the patient or the drug by just using
  15. parts of the structure in different orders*/
  16. char name[15];
  17. char last[15];
  18. int gender;
  19. int idOne;
  20. int idTwo;
  21. int idThree;
  22. int idFour;
  23. int idFive;
  24. int idSix;
  25. int idSeven;
  26. int idEight;
  27. char allergies[15];
  28. } ID;
  29. void main() {
  30. login();
  31. printf("Enter First and/or Last name of patient);
  32. scanf("%s", &patientNameSearchedFor);
  33. verifyPatient(patientNameSearchedFor);
  34. printf("What drug is being administered?\n");
  35. scanf("%s", &drugSearchedFor);
  36. searchDrug(drugSearchedFor);
  37. allClear = verifyNoAllergies(drugSearchedFor, patientNameSearchedFor);
  38. if(allClear = false) {
  39. printf("\nThis patient has allergies to this specific drug.\n\nPlease double-check your charts and try again\n\npress any key and enter to exit");
  40. getchar();
  41. end(0);
  42. } //Personally I would rather have the Nurse or doctor doublecheck all of their information and try again and set this exit as somewhat of a punishment to make an incentive to not make a mistake. It wouldn't take to long to start again anyways.
  43.  
  44. }
  45. int login() {
  46. int success = false;
  47. int compare;
  48. while(success != true) {
  49. char input[30] = {"0"};
  50. char userlist[30] = {"0"};
  51. char password[30] = {"0"};
  52. char passwordlist[30] = {"0"};
  53. int numberOfUsers;
  54. printf("Username:\n\n");
  55. scanf("%s", &input);
  56. printf("\nPassword:\n\n");
  57. scanf("%s", &password);
  58. FILE *fptr;
  59. fptr = fopen("users.txt", "r");
  60. for(i = 0; i<numberOfUsers; i++) {
  61. //input code from the login lab to compare
  62. }
  63. fclose(fptr);
  64. if(compare = true) {
  65. return 0;
  66. }
  67. }
  68. return 0;
  69. }
  70. void verifyPatient(a) {
  71. FILE *fp;
  72. fp = fopen("patient.txt", "r");
  73. fclose(fp);
  74. }
  75. void searchDrug(d) {
  76. File *fptr;
  77. fptr = fopen("medicine.txt", "r");
Add Comment
Please, Sign In to add comment