Example #1
0
        public void addMedication(String medicationNameX, String medicationDoesX, double medicationTreatmentLengthX)
        {
            if (firstMed != null)
            {
                medScanner = firstMed;
                while (medScanner.getNextMed() != null)
                {
                    medScanner = medScanner.getNextMed();
                }

                medScanner.addMedication(medicationNameX, medicationDoesX, medicationTreatmentLengthX);
            }

            else
            {
                firstMed = new medication(medicationNameX, medicationDoesX, medicationTreatmentLengthX);
            }
        }
Example #2
0
        public medication getMed(String medName)
        {
            medication returnValue = null;

            if (firstMed != null)
            {
                medScanner = firstMed;
                while (medScanner != null)
                {
                    if (medScanner.getMedicationName().Equals(medName))
                    {
                        returnValue = medScanner;
                    }
                    medScanner = medScanner.getNextMed();
                }
            }

            return(returnValue);
        }