private PatientMedicationLiteVoCollection getMedications() { PatientMedicationLiteVoCollection medications = new PatientMedicationLiteVoCollection(); for(int x = 0; x < form.grdMedication().getRows().size(); x++) { PatientMedicationLiteVo medication = form.grdMedication().getRows().get(x).getValue(); medication.setCommencedDate(form.grdMedication().getRows().get(x).getcolDate()); medication.setFrequency(form.grdMedication().getRows().get(x).getcolFrequency()); medication.setOtherMedicationText(medication.getMedication() == null ? "" : medication.getMedication().getMedicationName()); medication.setSourceofInformation(SourceofInformation.CORRESPONDENCE); medication.setPatient(form.getGlobalContext().Core.getPatientShort()); medications.add(medication); } return medications; }
@SuppressWarnings("unchecked") public PatientMedicationLiteVoCollection getPresentationReferralSummaryMedication(CatsReferralRefVo catsRefVo) { if(catsRefVo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("select presRS.medicationOnReferral from PresentationReferralSummary presRS where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " presRS.catsReferral.id = :cats"); markers.add("cats"); values.add(catsRefVo.getID_CatsReferral()); List listAdditional = factory.find(hql.toString(), markers,values); if(listAdditional != null && listAdditional.size() > 0) { return PatientMedicationLiteVoAssembler.createPatientMedicationLiteVoCollectionFromPatientMedication(listAdditional); } } return null; }
private void populateMedsGridFromData(PatientMedicationLiteVoCollection medicationOnReferral) { if(medicationOnReferral == null) return; for(int x = 0; x < medicationOnReferral.size(); x++) { PatientMedicationLiteVo medication = medicationOnReferral.get(x); if(medication != null) { GenForm.grdMedicationRow row = form.grdMedication().getRows().newRow(); if(medication.getMedication() != null) { row.setcolDrug(medication.getMedication().getMedicationName()); row.setTooltip(medication.getMedication().getMedicationName()); } row.setcolDate(medication.getCommencedDate()); row.setcolFrequency(medication.getFrequency()); row.setValue(medication); } } }
private void setPreviousMedicationsStatus() { form.getLocalContext().setHasPreviousMedication(Boolean.FALSE); PatientMedicationLiteVoCollection voCollMedication = domain.listPatientLastMedication(form.getGlobalContext().Core.getPatientShort(), form.getGlobalContext().Core.getCurrentCareContext().getStartDateTime()); if(voCollMedication != null && voCollMedication.size() > 0) { form.getLocalContext().setHasPreviousMedication(Boolean.TRUE); } }
private ReferralOutcomeVo populateDataFromScreen() throws StaleObjectException { ReferralOutcomeVo outcome = domain.getReferralOutcome(form.getGlobalContext().RefMan.getCatsReferral()); if (outcome == null) { outcome = new ReferralOutcomeVo(); outcome.setCatsReferral(form.getGlobalContext().RefMan.getCatsReferral()); } if (outcome.getAuthoringInformation() == null) { outcome.setAuthoringInformation(populateAuthoringInfo()); } PrescriptionsVoCollection prescriptionsColl = new PrescriptionsVoCollection(); if (outcome != null) { int prescriptions = form.dyngrdPrescription().getRows().size(); for (int i = 0; i < prescriptions; i++) { if (form.dyngrdPrescription().getRows().get(i).getValue() != null && form.dyngrdPrescription().getRows().get(i).getValue() instanceof PrescriptionsVo) { PrescriptionsVo prescription = (PrescriptionsVo) form.dyngrdPrescription().getRows().get(i).getValue(); PatientMedicationLiteVoCollection medicationColl = new PatientMedicationLiteVoCollection(); int medications = form.dyngrdPrescription().getRows().get(i).getRows().size(); for (int j = 0; j < medications; j++) { if (form.dyngrdPrescription().getRows().get(i).getRows().get(j).getValue() != null && form.dyngrdPrescription().getRows().get(i).getRows().get(j).getValue() instanceof PatientMedicationLiteVo) { PatientMedicationLiteVo medication = (PatientMedicationLiteVo) form.dyngrdPrescription().getRows().get(i).getRows().get(j).getValue(); medicationColl.add(medication); } } prescription.setMedications(medicationColl); AuthoringInformationVo authoring = populateAuthoringInfo(); prescription.setRecordingInformation(authoring); prescriptionsColl.add(prescription); } } outcome.setPrescriptions(prescriptionsColl); form.getLocalContext().setCurrentOutcome(outcome); } return outcome; }
private void populateCataractIntraOperativeDetails(CataractIntraOperativeDetailVo details) { clearCataractIntraOperativeDetails(); if (details == null) return; if (details.getMedicationsIsNotNull()) { PatientMedicationLiteVoCollection medications = details.getMedications(); for (int i = 0; i < medications.size(); i++) { PatientMedicationLiteVo pMedi = medications.get(i); if (pMedi != null) { addRowToMedication(pMedi); } } } if (details.getSkinPreperationUsedIsNotNull()) { SkinPreperationVoCollection skinps = details.getSkinPreperationUsed(); for (int i = 0; i < skinps.size(); i++) { SkinPreperationVo skin = skinps.get(i); if (skin != null) { newRowToSkinPreparation(skin); } } } if (details.getLocalAnaestheticUsedIsNotNull()) { LocalAnaestheticAdministeredVoCollection anests = details.getLocalAnaestheticUsed(); for (int i = 0; i < anests.size(); i++) { LocalAnaestheticAdministeredVo anest = anests.get(i); if (anest != null) { newRowToAnaesthetic(anest); } } } // GridDressings if (details.getDressingsIsNotNull()) { CataractDressingsCollection dresings = details.getDressings(); for (int i = 0; i < dresings.size(); i++) { form.lyrMain().tabDetails().grdDressings().getRowByValue(dresings.get(i)).setColSelect(true); } } // End GridDressings form.lyrMain().tabDetails().intSwapCount().setValue(details.getSwabNeedleCount()); if (details.getWasSwabNeedleCountCorrectIsNotNull()) { form.lyrMain().tabDetails().grpYesNo().setValue(details.getWasSwabNeedleCountCorrect().equals(YesNo.YES) ? grpYesNoEnumeration.rdoYes : grpYesNoEnumeration.rdoNo); } rebindAllAnaesthetic(); rebindAllMedications(); rebindAllSkinPreparation(); }
public PatientMedicationLiteVoCollection listPatientLastMedication(PatientShort patient, DateTime startDateTime) { if (patient == null || !patient.getID_PatientIsNotNull()) return null; // Get last care context (of type INPATIET) StringBuilder ccQuery = new StringBuilder(); ccQuery.append("select cc from PatientMedication as pmed join pmed.careContext as cc where pmed.patient.id = :PAT_ID and cc.context.id = :CC_TYPE and (pmed.isRIE is null or pmed.isRIE = 0) and (pmed.isDiscontinued is null or pmed.isDiscontinued = 0)"); ArrayList<String> paramCCNames = new ArrayList<String>(); ArrayList<Object> paramCCValues = new ArrayList<Object>(); paramCCNames.add("PAT_ID"); paramCCNames.add("CC_TYPE"); paramCCValues.add(patient.getID_Patient()); paramCCValues.add(ContextType.INPATIENT.getID()); if (startDateTime != null) { ccQuery.append(" and cc.startDateTime <= :DATE"); paramCCNames.add("DATE"); paramCCValues.add(startDateTime.getJavaDate()); } ccQuery.append(" order by cc.startDateTime desc"); CareContextLiteVo careContext = CareContextLiteVoAssembler.create((CareContext) getDomainFactory().findFirst(ccQuery.toString(), paramCCNames, paramCCValues)); if (careContext == null || !careContext.getID_CareContextIsNotNull()) return null; String hqlQuery = "select pmed from PatientMedication as pmed where pmed.patient.id = :PAT_ID and pmed.careContext.id = :CC_ID"; ArrayList<String> paramPMedNames = new ArrayList<String>(); ArrayList<Object> paramPMedValues = new ArrayList<Object>(); paramPMedNames.add("PAT_ID"); paramPMedNames.add("CC_ID"); paramPMedValues.add(patient.getID_Patient()); paramPMedValues.add(careContext.getID_CareContext()); return PatientMedicationLiteVoAssembler.createPatientMedicationLiteVoCollectionFromPatientMedication(getDomainFactory().find(hqlQuery, paramPMedNames, paramPMedValues)); }
private EDPrescriptionVo populateDataFromScreen(boolean isRecordEditMode, boolean markComplete) { EDPrescriptionVo prescription = null; if ( form.dynGridPrescriptions().getSelectedRow() != null && form.dynGridPrescriptions().getSelectedRow().getValue() instanceof EDPrescriptionVo) { prescription = (EDPrescriptionVo) form.dynGridPrescriptions().getSelectedRow().getValue(); } if ( form.dynGridPrescriptions().getSelectedRow() != null && form.dynGridPrescriptions().getSelectedRow().getValue() instanceof PatientMedicationLiteVo) { prescription = (EDPrescriptionVo) form.dynGridPrescriptions().getSelectedRow().getParent().getValue(); } DynamicGridRow selectedPrescRow = null; AuthoringInformationVo auth = new AuthoringInformationVo(); PatientMedicationLiteVoCollection medicationColl = new PatientMedicationLiteVoCollection(); if (form.dynGridPrescriptions().getSelectedRow().getValue() instanceof EDPrescriptionVo) selectedPrescRow = form.dynGridPrescriptions().getSelectedRow(); else if (form.dynGridPrescriptions().getSelectedRow().getValue() instanceof PatientMedicationLiteVo) selectedPrescRow = form.dynGridPrescriptions().getSelectedRow().getParent(); if (selectedPrescRow != null && selectedPrescRow.getValue() instanceof EDPrescriptionVo) { int medications = selectedPrescRow.getRows().size(); for (int j = 0; j < medications; j++) { if (selectedPrescRow.getRows().get(j).getValue() != null && selectedPrescRow.getRows().get(j).getValue() instanceof PatientMedicationLiteVo) { PatientMedicationLiteVo medication = (PatientMedicationLiteVo) selectedPrescRow.getRows().get(j).getValue(); medicationColl.add(medication); } } auth = populateAuthoringInfoData(selectedPrescRow.getCells().get(getColumn(COL_AUTH_DATE)),true); } prescription.setMedications(medicationColl); prescription.setPatient(form.getGlobalContext().Core.getPatientShort()); prescription.setEpisode(form.getGlobalContext().Core.getEpisodeofCareShort()); prescription.setAttendance(form.getLocalContext().getCareContext()); AuthoringInformationVo recInfo = populateAuthoringInfoData(null,false); if (!isRecordEditMode) { prescription.setRecordingInformation(recInfo); } if (markComplete) { prescription.setIsCompleted(markComplete); prescription.setCompletingInformation(recInfo); } prescription.setAuthoringInformation(auth); return prescription; }