Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- enum boolean {false, true};
- enum sex {male, female};
- int login();
- void verifyPatient(char);
- void searchDrug(char);
- char drugSearchedFor[15];
- int verifyNoAllergies(char,char);
- char patientNameSearchedFor;
- int allClear;
- typedef struct searchDatabase{
- /*this will be used to compare either
- the patient or the drug by just using
- parts of the structure in different orders*/
- char name[15];
- char last[15];
- int gender;
- int idOne;
- int idTwo;
- int idThree;
- int idFour;
- int idFive;
- int idSix;
- int idSeven;
- int idEight;
- char allergies[15];
- } ID;
- void main() {
- login();
- printf("Enter First and/or Last name of patient);
- scanf("%s", &patientNameSearchedFor);
- verifyPatient(patientNameSearchedFor);
- printf("What drug is being administered?\n");
- scanf("%s", &drugSearchedFor);
- searchDrug(drugSearchedFor);
- allClear = verifyNoAllergies(drugSearchedFor, patientNameSearchedFor);
- if(allClear = false) {
- 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");
- getchar();
- end(0);
- } //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.
- }
- int login() {
- int success = false;
- int compare;
- while(success != true) {
- char input[30] = {"0"};
- char userlist[30] = {"0"};
- char password[30] = {"0"};
- char passwordlist[30] = {"0"};
- int numberOfUsers;
- printf("Username:\n\n");
- scanf("%s", &input);
- printf("\nPassword:\n\n");
- scanf("%s", &password);
- FILE *fptr;
- fptr = fopen("users.txt", "r");
- for(i = 0; i<numberOfUsers; i++) {
- //input code from the login lab to compare
- }
- fclose(fptr);
- if(compare = true) {
- return 0;
- }
- }
- return 0;
- }
- void verifyPatient(a) {
- FILE *fp;
- fp = fopen("patient.txt", "r");
- fclose(fp);
- }
- void searchDrug(d) {
- File *fptr;
- fptr = fopen("medicine.txt", "r");
Add Comment
Please, Sign In to add comment