Examples of Patient


Examples of org.openmrs.Patient

      }
     
      @Override
      public Encounter getEncounterToView(){
        Encounter e = new Encounter();
        Patient p = Context.getPatientService().getPatient(2);
        e.setPatient(p);
        e.setEncounterDatetime(date);
        e.setProvider(Context.getPersonService().getPerson(502));
        e.setEncounterType(Context.getEncounterService().getEncounterType(1));
        e.setLocation(Context.getLocationService().getLocation(2));
View Full Code Here

Examples of org.openmrs.Patient

      return new ArrayList<Obs>();
        }

        cannotBePreviewed();

        Patient p = session.getPatient();
    Concept concept = HtmlFormEntryUtil.getConcept(conceptId);

        if (p == null || concept == null) {
      return new ArrayList<Obs>();
        }
View Full Code Here

Examples of org.openmrs.Patient

  private List<Encounter> getAllEncounters(EncounterType type) {
    if (session.getPatient() == null) {
      return new ArrayList<Encounter>();
    }
    cannotBePreviewed();
    Patient p = session.getPatient();
    if (p == null) {
      return new ArrayList<Encounter>();
    }
    else {
      if (type == null) {
View Full Code Here

Examples of org.openmrs.Patient

    return getLogicService().eval(session.getPatient(), lc);
  }

  @SuppressWarnings("deprecation")
    public PatientState currentProgramWorkflowStatus(Integer programWorkflowId) {
    Patient p = session.getPatient();
    if (p == null || p.getId() == null) {
      return null;
    }
    cannotBePreviewed();
    ProgramWorkflow workflow = getProgramWorkflowService().getWorkflow(programWorkflowId); // not sure if and how I want to reference the UUID
    List<PatientProgram> pps = getProgramWorkflowService().getPatientPrograms(p, workflow.getProgram(), null, null,
View Full Code Here

Examples of org.openmrs.Patient

     * @should  return the ageInMonths accurately to the nearest month
     */

    public Integer patientAgeInMonths() {

        Patient patient = session.getPatient();
        if(patient == null || patient.getBirthdate() == null){
          return null;     // if there is error in patient's data return age as null
        }
        Date birthdate = patient.getBirthdate();
        DateTime today = new DateTime();
        DateTime dob = new DateTime(birthdate.getTime());
        return Months.monthsBetween(dob.toDateMidnight(), today.toDateMidnight()).getMonths();
    }
View Full Code Here

Examples of org.openmrs.Patient

     * @return   patient's age in days
     * @should  return the ageInDays accurately to the nearest date
     */
    public Integer patientAgeInDays(){

        Patient patient = session.getPatient();
        if(patient == null  || patient.getBirthdate() == null){
          return null;   // if there is error in patient's data return age as null
        }
        Date birthdate = patient.getBirthdate();
        DateTime today = new DateTime();
        DateTime dob = new DateTime(birthdate.getTime());
        return Days.daysBetween(dob.toDateMidnight(), today.toDateMidnight()).getDays();
    }
View Full Code Here

Examples of org.optaplanner.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]);
                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.plugtree.training.model.Patient

    @Test
    public void testNurseNotification() throws Exception{
        final StatefulKnowledgeSession ksession = this.createKSession();
        WorkingMemoryEntryPoint bedEventsEP = ksession.getWorkingMemoryEntryPoint("bed-events");

        Patient patient = new Patient("John","Doe");

        Nurse nurse = new Nurse("Mary","Douglas");
        ksession.setGlobal("nurse", nurse);
        Doctor doctor = new Doctor("Gregory","House");
        ksession.setGlobal("doctor", doctor);
View Full Code Here

Examples of org.rioproject.examples.hospital.Patient

                Patient.PatientInfo pInfo =
                    new Patient.PatientInfo(name.getText(),
                                            (String) gender.getSelectedItem(),
                                            birthDay);
                Patient patient = new Patient(pInfo);
                if(listener!=null)
                    listener.patientCreated(patient);
                name.setText("");
                years.setText(null);
                days.removeAllItems();
View Full Code Here

Examples of systole.domain.persons.Patient

    }

    @Override
    protected void buildPatientInfo(Analysis analysis) throws DocumentException {

        Patient patient = analysis.getPatient();
        Chunk pat = new Chunk(EntityDescriptions.PATIENT + ": " + patient.getFullName());
        pat.setFont(new Font(Font.FontFamily.TIMES_ROMAN, 14, Font.BOLD));
        this.document.add(pat);
        this.document.add(Chunk.NEWLINE);
        this.document.add(Chunk.NEWLINE);

        Medic medic = analysis.getMedic();
        if (medic != null) {
            Chunk med = new Chunk(ReportTexts.request_by + medic.getFullName());
            med.setFont(new Font(Font.FontFamily.TIMES_ROMAN, 12, Font.BOLD));
            this.document.add(med);
            this.writeEmptyLine();
        }

        int amount = this.getAmountOfData();

        if (amount > 0) {
            PdfPTable patientTable = new PdfPTable(amount);
            patientTable.setWidthPercentage(90);

            Font title = new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadDataFont()));
            Font value = new Font(this.fontMapper.awtToPdf(this.reportSettingsProperties.loadDataValueFont()));

            // PUT HEADERS

            if (this.reportSettingsProperties.loadUseAge()) {
                Chunk a = new Chunk("Edad");
                a.setFont(title);
                PdfPCell ages = new PdfPCell(new Paragraph(a));
                ages.setHorizontalAlignment(Element.ALIGN_CENTER);
                ages.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(ages);
            }

            if (this.reportSettingsProperties.loadUseWeight()) {
                Chunk p = new Chunk("Peso" + System.getProperty("line.separator") + Units.kilograms);
                p.setFont(title);
                PdfPCell weight = new PdfPCell(new Paragraph(p));
                weight.setHorizontalAlignment(Element.ALIGN_CENTER);
                weight.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(weight);
            }

            if (this.reportSettingsProperties.loadUseHeight()) {
                Chunk h = new Chunk("Altura" + System.getProperty("line.separator") + Units.Centimetres);
                h.setFont(title);
                PdfPCell height = new PdfPCell(new Paragraph(h));
                height.setHorizontalAlignment(Element.ALIGN_CENTER);
                height.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(height);
            }

            if (this.reportSettingsProperties.loadUsePS()) {
                Chunk pss = new Chunk("PS" + System.getProperty("line.separator") + Units.pressure);
                pss.setFont(title);
                PdfPCell ps = new PdfPCell(new Paragraph(pss));
                ps.setHorizontalAlignment(Element.ALIGN_CENTER);
                ps.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(ps);
            }

            if (this.reportSettingsProperties.loadUsePD()) {
                Chunk pdd = new Chunk("PD" + System.getProperty("line.separator") + Units.pressure);
                pdd.setFont(title);
                PdfPCell pd = new PdfPCell(new Paragraph(pdd));
                pd.setHorizontalAlignment(Element.ALIGN_CENTER);
                pd.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(pd);
            }

            if (this.reportSettingsProperties.loadUseSmoke()) {
                Chunk sm = new Chunk("Fuma");
                sm.setFont(title);
                PdfPCell smooke = new PdfPCell(new Paragraph(sm));
                smooke.setHorizontalAlignment(Element.ALIGN_CENTER);
                smooke.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(smooke);
            }

            // PUT DATA

            if (this.reportSettingsProperties.loadUseAge()) {
                Chunk years = new Chunk(patient.getAge().toString());
                years.setFont(value);
                PdfPCell agesValue = new PdfPCell(new Paragraph(years));
                agesValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                agesValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(agesValue);
            }

            if (this.reportSettingsProperties.loadUseWeight()) {
                Chunk weightP = new Chunk(analysis.getClinicalInformation().getWeightAsString(false));
                weightP.setFont(value);
                PdfPCell weightValue = new PdfPCell(new Paragraph(weightP));
                weightValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                weightValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(weightValue);
            }

            if (this.reportSettingsProperties.loadUseHeight()) {
                Chunk heightP = new Chunk(analysis.getClinicalInformation().getHeightAsString(false));
                heightP.setFont(value);
                PdfPCell heightValue = new PdfPCell(new Paragraph(heightP));
                heightValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                heightValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(heightValue);
            }

            if (this.reportSettingsProperties.loadUsePS()) {
                Chunk psCk = new Chunk(analysis.getClinicalInformation().getSystolicPressureAsString(false));
                psCk.setFont(value);
                PdfPCell psValue = new PdfPCell(new Paragraph(psCk));
                psValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                psValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(psValue);
            }

            if (this.reportSettingsProperties.loadUsePD()) {
                Chunk pdCk = new Chunk(analysis.getClinicalInformation().getDiastolicPressureAsString(false));
                pdCk.setFont(value);
                PdfPCell pdValue = new PdfPCell(new Paragraph(pdCk));
                pdValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                pdValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(pdValue);
            }

            if (this.reportSettingsProperties.loadUseSmoke()) {
                Chunk smk = new Chunk(patient.getClinicalHistoryProxy().getIsSmoker());
                smk.setFont(value);
                PdfPCell smookeValue = new PdfPCell(new Paragraph(smk));
                smookeValue.setHorizontalAlignment(Element.ALIGN_CENTER);
                smookeValue.setVerticalAlignment(Element.ALIGN_MIDDLE);
                patientTable.addCell(smookeValue);
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.