Examples of Patient


Examples of application.database.Patient

  @Before
  public void prepare() throws Exception {
    db.dropTables();
    db.createTables();
    for (int i = 0; i < 10; i++) {
      Patient patient = new Patient(new HashMap<String, Object>(){{
        Random rand = new Random();
        put("name", String.valueOf(rand.nextInt()));
        put("surname", String.valueOf(rand.nextInt()));
      }}
      );
      patient.save();
    }
  }
View Full Code Here

Examples of ch.elexis.data.Patient

    Object[] patients = (Object[]) loader.getData();

    this.initList(patients);

    for (int i = 0; i < patients.length; i++) {
      Patient patient = (Patient) patients[i];

      int year = QueryUtil.extractYear(patient.getGeburtsdatum());
      if (year != 0) {
        this.handleCases(patient, year);
      }

    }
View Full Code Here

Examples of com.nayidisha.pointy.domain.Patient

  @Transactional(readOnly=false)
  @Override
  public void deletePatient(Long patientId) {
    if (patientId != null){
      Patient patient = patientDAO.load(patientId);
      patientDAO.delete(patient);
    }
   
  }
View Full Code Here

Examples of edu.umbc.ultra.logic.Patient

          (String) userEntity.getProperty("FirstName"),
          (String) userEntity.getProperty("LastName"));

      // Populate patient object with patient entity properties from
      // database
      Patient patient = new Patient(
          (String) patientEntity.getProperty("FirstName"),
          (String) patientEntity.getProperty("LastName"),
          (Date) patientEntity.getProperty("DOB"),
          Patient.getGenderFromString((String) patientEntity.getProperty("Gender")),
          (String) patientEntity.getProperty("ID"));
View Full Code Here

Examples of edu.umbc.ultra.logic.Patient

    if (blobKey == null) {
      redirect(res, blobKey);
      return;
    }

    Patient patient = null;
    Date DoB = null;
    String first = req.getParameter("first");

    // Makes sure there is a valid value in patient first name.
    if ((first == null) || (first.length() == 0)) {
      redirect(res, blobKey);
      return;
    }
    String last = req.getParameter("last");

    // Makes sure there is a valid value in patient last name.
    if ((last == null) || (last.length() == 0)) {
      redirect(res, blobKey);
      return;
    }
    try {
      DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
      String dob = req.getParameter("DoB");
      // Make sure there is a value in the DoB field before trying to
      // parse it.
      if (dob == null || dob.length() == 0) {
        redirect(res, blobKey);
        return;
      }
      else {
        DoB = df.parse(dob);
      }
    }
    catch (ParseException e) {
      DoB = new Date();
    }
   
    Gender gender = Patient.getGenderFromString(req.getParameter("gender"));
    patient = new Patient(first, last, DoB, gender);

    // Gets the active user.
   
    // Get an instance of the UserService
    UserService userService = UserServiceFactory.getUserService();
View Full Code Here

Examples of edu.umbc.ultra.logic.Patient

 
    DatastoreService datastore = DatastoreServiceFactory
        .getDatastoreService();
   
    User author = entry.getAuthor();
    Patient patient = entry.getPatient();
    ArrayList<Comment> comments = entry.getComments();

    // Create and add Patient entity using as a key the unique id assigned
    // upon creation
    Entity patientEntity = new Entity("Patient", patient.getId(),KeyFactory.createKey("User", author.getGoogleUser()));
    patientEntity.setProperty("FirstName", patient.getFirstName());
    patientEntity.setProperty("LastName", patient.getLastName());
    patientEntity.setProperty("DOB", patient.getDob());
    patientEntity.setProperty("Gender", patient.getGender().toString());
    patientEntity.setProperty("ID", patient.getId());
    datastore.put(patientEntity);
   
    // Create and add DataEntry entity with a generated unique key,
    // specifying the parent key as the user
    Entity dataEntity = new Entity("DataEntry", patientEntity.getKey());
View Full Code Here

Examples of org.drools.examples.cdss.data.Patient

            RecommendationService recommendationService = new RecommendationService();
            ksession.setGlobal( "recommendationService",
                                     recommendationService );
       
            // create patient
            Patient patient = new Patient();
            patient.setName( "John Doe" );
            patient.setAge( 20 );
            ksession.insert( patient );

            // Go!
            Diagnose diagnose = new Diagnose( Terminology.DIAGNOSE_X );
            ksession.insert( diagnose );
View Full Code Here

Examples of org.drools.planner.examples.pas.domain.Patient

                if (firstNightIndex >= nightListSize || patientNightListSize == 0) {
                    continue;
                }

                String[] patientTokens = splitBySpace(lineTokens[0], 4);
                Patient patient = new Patient();
                patient.setId(Long.parseLong(patientTokens[0]));
                patient.setName(patientTokens[1]);
                patient.setAge(Integer.parseInt(patientTokens[2]));
                patient.setGender(Gender.valueOfCode(patientTokens[3]));
                int preferredMaximumRoomCapacity = Integer.parseInt(lineTokens[3]);
                patient.setPreferredMaximumRoomCapacity(preferredMaximumRoomCapacity == 0
                        ? null : preferredMaximumRoomCapacity);
                patientList.add(patient);

                String[] admissionPartTokens = splitBySpace(lineTokens[2]);
                if (admissionPartTokens.length % 2 != 1) {
                }
                int patientAdmissionPartListSize = Integer.parseInt(admissionPartTokens[0]);
                if (admissionPartTokens.length != ((patientAdmissionPartListSize * 2) + 1)) {
                    throw new IllegalArgumentException("Read line (" + line
                            + ") is expected to contain " + ((patientAdmissionPartListSize * 2) + 1)
                            + " number of tokens after 2th pipeline (|).");
                }
                int nextFirstNightIndex = firstNightIndex;
                for (int j = 1; j < admissionPartTokens.length; j += 2) {
                    long specialismId = Long.parseLong(admissionPartTokens[j]);
                    int admissionPartNightListSize = Integer.parseInt(admissionPartTokens[j + 1]);
                    if (nextFirstNightIndex >= nightListSize || admissionPartNightListSize == 0) {
                        nextFirstNightIndex += admissionPartNightListSize;
                        continue;
                    }
                    AdmissionPart admissionPart = new AdmissionPart();
                    admissionPart.setId(admissionPartId);
                    admissionPart.setPatient(patient);
                    Specialism specialism = (specialismId == 0) ? null : idToSpecialismMap.get(specialismId);
                    if (specialism == null) {
                        throw new IllegalArgumentException("Read line (" + line
                                + ") has a non existing specialismId (" + specialismId + ").");
                    }
                    admissionPart.setSpecialism(specialism);
                    int admissionPartFirstNightIndex = nextFirstNightIndex;
                    Night admissionPartFirstNight = indexToNightMap.get(admissionPartFirstNightIndex);
                    if (admissionPartFirstNight == null) {
                        throw new IllegalStateException(
                                "The admissionPartFirstNight was not found for admissionPartFirstNightIndex("
                                        + admissionPartFirstNightIndex + ").");
                    }
                    admissionPart.setFirstNight(admissionPartFirstNight);
                    int admissionPartLastNightIndex = nextFirstNightIndex + admissionPartNightListSize - 1;
                    // TODO Instead of ensureEnoughNights(lastNightIndex);
                    // the official score function ignores any broken constraints after the planning horizon
                    if (admissionPartLastNightIndex >= nightListSize) {
                        admissionPartLastNightIndex = nightListSize - 1;
                    }
                    Night admissionPartLastNight = indexToNightMap.get(admissionPartLastNightIndex);
                    if (admissionPartLastNight == null) {
                        throw new IllegalStateException(
                                "The admissionPartLastNight was not found for admissionPartLastNightIndex("
                                        + admissionPartLastNightIndex + ").");
                    }
                    admissionPart.setLastNight(admissionPartLastNight);
                    admissionPartList.add(admissionPart);
                    admissionPartId++;
                    nextFirstNightIndex += admissionPartNightListSize;
                }
                int admissionPartNightListSizeSum = nextFirstNightIndex - firstNightIndex;
                if (patientNightListSize != admissionPartNightListSizeSum) {
                    throw new IllegalArgumentException("Read line (" + line
                            + ") has patientNightListSize (" + patientNightListSize
                            + ") different from admissionPartNightListSizeSum(" + admissionPartNightListSizeSum + ")");
                }

                String[] requiredPatientEquipmentTokens = splitBySpace(lineTokens[4]);
                if (requiredPatientEquipmentTokens.length != equipmentListSize) {
                    throw new IllegalArgumentException("Read line (" + line
                            + ") is expected to contain equal number of tokens ("
                            + requiredPatientEquipmentTokens.length
                            + ") as equipmentListSize (" + equipmentListSize + ") after 4th pipeline (|).");
                }
                List<RequiredPatientEquipment> requiredPatientEquipmentOfPatientList
                        = new ArrayList<RequiredPatientEquipment>(equipmentListSize);
                for (int j = 0; j < requiredPatientEquipmentTokens.length; j++) {
                    int hasEquipment = Integer.parseInt(requiredPatientEquipmentTokens[j]);
                    if (hasEquipment == 1) {
                        RequiredPatientEquipment requiredPatientEquipment = new RequiredPatientEquipment();
                        requiredPatientEquipment.setId(requiredPatientEquipmentId);
                        requiredPatientEquipment.setPatient(patient);
                        requiredPatientEquipment.setEquipment(indexToEquipmentMap.get(j));
                        requiredPatientEquipmentOfPatientList.add(requiredPatientEquipment);
                        requiredPatientEquipmentList.add(requiredPatientEquipment);
                        requiredPatientEquipmentId++;
                    } else if (hasEquipment != 0) {
                        throw new IllegalArgumentException("Read line (" + line
                                + ") is expected to have 0 or 1 hasEquipment (" + hasEquipment + ").");
                    }
                }
                patient.setRequiredPatientEquipmentList(requiredPatientEquipmentOfPatientList);

                String[] preferredPatientEquipmentTokens = splitBySpace(lineTokens[5]);
                if (preferredPatientEquipmentTokens.length != equipmentListSize) {
                    throw new IllegalArgumentException("Read line (" + line
                            + ") is expected to contain equal number of tokens ("
                            + preferredPatientEquipmentTokens.length
                            + ") as equipmentListSize (" + equipmentListSize + ") after 5th pipeline (|).");
                }
                List<PreferredPatientEquipment> preferredPatientEquipmentOfPatientList
                        = new ArrayList<PreferredPatientEquipment>(equipmentListSize);
                for (int j = 0; j < preferredPatientEquipmentTokens.length; j++) {
                    int hasEquipment = Integer.parseInt(preferredPatientEquipmentTokens[j]);
                    if (hasEquipment == 1) {
                        boolean alreadyRequired = (Integer.parseInt(requiredPatientEquipmentTokens[j]) == 1);
                        // Official spec: if equipment is required
                        // then a duplicate preffered constraint should be ignored
                        if (!alreadyRequired) {
                            PreferredPatientEquipment preferredPatientEquipment = new PreferredPatientEquipment();
                            preferredPatientEquipment.setId(preferredPatientEquipmentId);
                            preferredPatientEquipment.setPatient(patient);
                            preferredPatientEquipment.setEquipment(indexToEquipmentMap.get(j));
                            preferredPatientEquipmentOfPatientList.add(preferredPatientEquipment);
                            preferredPatientEquipmentList.add(preferredPatientEquipment);
                            preferredPatientEquipmentId++;
                        }
                    } else if (hasEquipment != 0) {
                        throw new IllegalArgumentException("Read line (" + line
                                + ") is expected to have 0 or 1 hasEquipment (" + hasEquipment + ").");
                    }
                }
                patient.setPreferredPatientEquipmentList(preferredPatientEquipmentOfPatientList);
            }
            patientAdmissionSchedule.setPatientList(patientList);
            patientAdmissionSchedule.setAdmissionPartList(admissionPartList);
            patientAdmissionSchedule.setRequiredPatientEquipmentList(requiredPatientEquipmentList);
            patientAdmissionSchedule.setPreferredPatientEquipmentList(preferredPatientEquipmentList);
View Full Code Here

Examples of org.jboss.remoting.samples.transporter.complex.Patient

   private String locatorURI = "socket://localhost:5401/?serializationtype=jboss";

   public void makeClientCall() throws Exception
   {
      // First create patient and populate with data
      Patient patient = new Patient("Bill", "Gates");
      patient.setAilmentType("financial");
      patient.setAilmentDescription("Money coming out the wazoo.");

      System.out.println("*** Have a new patient that needs a doctor.  The patient is:\n" + patient);

      // now create remote provide interface to call on
      ProviderInterface providerProcessor = (ProviderInterface) TransporterClient.createTransporterClient(locatorURI, ProviderInterface.class);


      try
      {
         // find a doctor that can help our patient.  Note, if none found, will throw an exception
         System.out.println("*** Looking for doctor that can help our patient...\n");
         Doctor doctor = providerProcessor.findDoctor(patient);

         // notice that list of patients now includes our patient, Bill Gates
         System.out.println("*** Found doctor for our patient.  Doctor found is:\n" + doctor);

         // assign doctor as patient's doctor
         patient.setDoctor(doctor);
         System.out.println("*** Set doctor as patient's doctor.  Patient info is now:\n" + patient);

         // let's say our doctor made enough money to retire after helping out our patient, Bill.
         providerProcessor.retireDoctor(doctor);

         // let's create a new patient and find a doctor for him
         Patient patient2 = new Patient("Larry", "Page");
         patient2.setAilmentType("financial");
         patient2.setAilmentDescription("Money coming out the wazoo.");

         System.out.println("*** Have a new patient that we need to find a doctor for (remember, the previous one retired and there are no others)");
         providerProcessor.findDoctor(patient2);
      }
      catch(NoDoctorAvailableException e)
View Full Code Here

Examples of org.mbhcare.shared.entity.Patient

      responseDialog = new ResponseDialog();
     
      this.view = view;
      view.setPresenter(this);
     
      patient = new Patient();
      if(id != null){
        doLoad(id);
        view.getDiagnosisButton().setEnabled(true);
      }
      else {       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.