當您從藥房獲得處方時,會有與藥物相關的開始日期。藥物也有預定的頻率,告訴你什麼時候服用這些劑量。頻率有相當常見的模式。你可以每4小時服用一次。你可以每天服用一次。你可以在飯前或在睡覺前服用。你也可以帶他們PRN或「根據需要」。許多藥物也有停止。您可能需要服藥7天。您可能需要服用一定數量的劑量。你也可以在你的餘生中服用藥物。假設您必須實施一個系統,告訴護士何時患者應該接受藥物治療。您將如何建立一個處理開始日期,結束日期和頻率的藥物時間表?通知護士患者必須服用的藥物頻率
我已經做了基本的設計..但我堅持與實施時間表的功能(即通知護士回合藥頻率通知功能)
的解決方案,我已經是
頻率類
package patientmedicine;
公共類頻率{
public PartoftheDay part;
public enum PartoftheDay
{
Morning,
Afternoon,
Evening,
Night
}
public Frequency(PartoftheDay part) {
this.part = part;
}
public PartoftheDay getPart() {
return part;
}
public void setPart(PartoftheDay part) {
this.part = part;
}
}
醫藥類
package patientmedicine;
進口的java.util.List;
公共類醫藥{
private String name;
private String disease;
private String composition;
private String details;
private List<Frequency> frequencyList;
public List<Frequency> getFrequencyList() {
return frequencyList;
}
public void setFrequencyList(List<Frequency> frequencyList) {
this.frequencyList = frequencyList;
}
public String getName() {
return name;
}
public Medicine(String name, String composition, String details) {
this.name = name;
this.setComposition(composition);
this.setDetails(details);
}
public void setName(String name) {
this.name = name;
}
public String getDisease() {
return disease;
}
public void setDisease(String disease) {
this.disease = disease;
}
/**
* @return the composition
*/
public String getComposition() {
return composition;
}
/**
* @param composition the composition to set
*/
public void setComposition(String composition) {
this.composition = composition;
}
/**
* @return the details
*/
public String getDetails() {
return details;
}
/**
* @param details the details to set
*/
public void setDetails(String details) {
this.details = details;
}
}
Patient類
package patientmedicine;
進口的java.util.List;
公共類病人{
private String name;
private String disease;
private List<Medicine> medicineList;
public Patient(String name, String disease) {
this.setName(name);
this.setDisease(disease);
}
public List<Medicine> getMedicineList() {
return medicineList;
}
public void setMedicineList(List<Medicine> medicineList) {
this.medicineList = medicineList;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the disease
*/
public String getDisease() {
return disease;
}
/**
* @param disease the disease to set
*/
public void setDisease(String disease) {
this.disease = disease;
}
}
程序類
package patientmedicine;
進口的java.util.ArrayList; import java.util.List;
進口patientmedicine.Frequency.PartoftheDay;
公開課程程序{0}私人列表patientList;
public static void main(String[] args) {
List<Frequency> freque1 = new ArrayList<Frequency>();
freque1.add(new Frequency(PartoftheDay.Morning));
freque1.add(new Frequency(PartoftheDay.Evening));
// List<Medicine> medicine = new ArrayList<Medicine>();
Medicine med1 = new Medicine("Paracetemol", "38g", "For fever");
med1.setFrequencyList(freque1);
List<Frequency> freque2 = new ArrayList<Frequency>();
freque2.add(new Frequency(PartoftheDay.Morning));
freque2.add(new Frequency(PartoftheDay.Evening));
Medicine med2 = new Medicine("Ibuprofen", "38g", "For body pains");
med2.setFrequencyList(freque2);
List<Medicine> medicineList = new ArrayList<Medicine>();
medicineList.add(med1);
medicineList.add(med2);
Patient patient1 = new Patient("Deepthi", "For body pains");
patient1.setMedicineList(medicineList);
List<Patient> patientList = new ArrayList<Patient>();
patientList.add(patient1);
for (Patient patientt : patientList) {
System.out.println(patientt.getDisease());
System.out.println(patientt.getName());
for (Medicine medi : patientt.getMedicineList()) {
System.out.println(medi.getDetails() + medi.getComposition()
+ medi.getName());
for (Frequency freq : medi.getFrequencyList()) {
System.out.println(freq.getPart());
}
}
}
}
}
我的錯誤道歉。刪除JS –
您是否介意編輯您的問題,並提供一些更清晰的問題,以解決您遇到的問題?你想達到什麼目的?你是如何試圖完成這個的?你堅持什麼部分? –
我已經實施了採取耐心藥物和頻率的類..但我堅持實施時間表功能(通知功能,通知護士關於患者必須採取的藥頻率每天) –