2. Use the following model Identify all entities and corresponding attributes be
ID: 3595916 • Letter: 2
Question
2. Use the following model Identify all entities and corresponding attributes before drawing. You may use your imagination to add additional attributes Draw the ER diagram (you may draw on a sheet of paper, take a picture and send as an attachment) a) b) create an ERD that can be implemented for a medical clinic, using the following business rules: A patient can make many appointments with one or more doctors in the clinic, and a doctor can accept appointments with many patients. However, each appointment is made with only one doctor and one patient. .Emergency cases do not require an appointment. However, for appointment management purposes, an emergency is entered in the appointment book as "unscheduled. .If kept, an appointment yields a visit with the doctor specified in the appointment. The visit yields a diagnosis and, when appropriate, treatment. With each visit, the patient's records are updated to provide a medical history Each patient visit creates a bill. Each patient visit is billed by one doctor, and each doctor can bill many Each bill must be paid. However, a bill may be paid in many installments, and a payment may cover more than one bill. A patient may pay the bill directly, or the bill may be the basis for a claim submitted to an insurance company. .If the bill is paid by an insurance company, the deductible is submitted to the patient for payment.Explanation / Answer
CODE:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import java.io.*;
class Grep {
public static void main(String args[]) {
// pass two command line arguments first string to find and second name
// of the file
// use Pattern class to compile the pattern to match
Pattern pattern = null;
// read first command line argument which is pattern to match into
// string stringToMatch
String stringToMatch = args[0];
try {
// compile pattern
pattern = Pattern.compile(stringToMatch);
} catch (PatternSyntaxException e) {
//print if any error and exit the program
System.err.println("Invalid Regular Expression syntax: ");
System.exit(1);
}
// create buffered reader to read file
BufferedReader input = null;
try {
// read file
input = new BufferedReader(new InputStreamReader(
new FileInputStream(args[1])));
} catch (FileNotFoundException e) {
//print if any error and exit the program
System.err.println("Unable to open file " + e.getMessage());
System.exit(1);
}
try {
String lineOfFile;
//counter variable to count line no
int line = 0;
//read
while ((lineOfFile = input.readLine()) != null) {
line++;
Matcher matcher = pattern.matcher(lineOfFile);
//check if given string is in the line
if (matcher.find())
System.out.println(line + ":" + lineOfFile);
}
} catch (Exception e) {
//print error message and exit the program
System.err.println(e.getMessage());
System.exit(1);
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.