Java Code Examples for ims.core.vo.PatientMedicationLiteVo

The following are top voted examples for showing how to use ims.core.vo.PatientMedicationLiteVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPrescriptionDrug(PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord)// WDEV-13584
{
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if (row == null)
		{
			row = form.dyngrdPrescription().getSelectedRow();
		}

		//	WDEV-14054
		if (row != null)
		{
			if (row.getIdentifier() != null && (row.getIdentifier().equals(NewPrescriptionRecord) || row.getIdentifier().equals(PrescriptionRecord)))
			{
				addPrescriptionDrugRow(row.getRows().newRow(), patientMedication, readOnly, newRecord);// WDEV-13584
			}
			else if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(newRecord ? row.getParent().getRows().newRow() : row, patientMedication, readOnly, newRecord);// WDEV-13584
			}
			
			row.setExpanded(true);
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addRowToMedication(PatientMedicationLiteVo patientMedic)
{
	if (patientMedic == null)
		return;
	DynamicGridColumnCollection columns = form.lyrMain().tabDetails().dyngrdMedication().getColumns();
	DynamicGridRow nRow = form.lyrMain().tabDetails().dyngrdMedication().getRows().newRow();
	DynamicGridCell cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_MEDICATION), DynamicCellType.ENUMERATION);
	if (patientMedic != null && patientMedic.getMedicationIsNotNull())
		nRow.setValue(patientMedic);

	DynamicGridCellItem item = cell.getItems().newItem(patientMedic.getMedication().getMedicationName());
	item.setValue(patientMedic.getMedication());

	cell.setValue(patientMedic.getMedication());
	cell.setAutoPostBack(true);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_BATCHNO), DynamicCellType.STRING);

	cell.setValue(patientMedic.getBatchNo());
	cell.setStringMaxLength(20);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_EXPIRYDATE), DynamicCellType.DATE);
	cell.setValue(patientMedic.getExpiryDate());
}
 
Example 4
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addMedication(PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord)// WDEV-13584
{
	if (row == null)
	{
		row = form.dynGridPrescriptions().getSelectedRow();
	}
	if (row.getIdentifier() != null)  
	{		

		if (row.getIdentifier().equals(NewPrescriptionRecord) || row.getIdentifier().equals(PrescriptionRecord))
		{
			addMedicationRow(patientMedication,row.getRows().newRow(), readOnly, newRecord);// WDEV-13584
		}
		else if (row.getIdentifier().equals(PrescriptionMeds))
		{
			addMedicationRow(patientMedication, newRecord ? row.getParent().getRows().newRow() : row,readOnly, newRecord);// WDEV-13584
		}
	}

	row.setExpanded(true);
}
 
Example 5
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPrescriptionDrug(PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord)// WDEV-13584
{
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if (row == null)
		{
			row = form.dyngrdPrescription().getSelectedRow();
		}

		//	WDEV-14054
		if (row != null)
		{
			if (row.getIdentifier() != null && (row.getIdentifier().equals(NewPrescriptionRecord) || row.getIdentifier().equals(PrescriptionRecord)))
			{
				addPrescriptionDrugRow(row.getRows().newRow(), patientMedication, readOnly, newRecord);// WDEV-13584
			}
			else if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(newRecord ? row.getParent().getRows().newRow() : row, patientMedication, readOnly, newRecord);// WDEV-13584
			}
			
			row.setExpanded(true);
		}
	}
}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromData(PatientMedicationLiteVo medication)
{
	clearScreen();
	
	if(medication == null)
		return;
	if (medication.getMedication() != null)
	{	
		form.qmbMedication().newRow(medication.getMedication(),medication.getMedication().getMedicationName());
		form.qmbMedication().setValue(medication.getMedication());
	}
	else
	{	
		addGenericMedicationRow(true);
	}	
	form.txtOtherMed().setValue(medication.getMedication() != null ? null: medication.getOtherMedicationText());
	form.cmbFrequency().setValue(medication.getFrequency());
	form.intNoOfDaysSupply().setValue(medication.getNoDaysSupply());
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean save()
{
	PatientMedicationLiteVo medicationData = populateInstanceData();
	
	String[] errors = medicationData.validate();
	
	if(errors != null && errors.length > 0)
	{
		engine.showErrors(errors);	
		return false;
	}
	form.getGlobalContext().Emergency.setPrescriptionDrug(medicationData);
	
	form.getGlobalContext().RefMan.setPrescriptionMedication(medicationData);
			
	return true;
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addRowToMedication(PatientMedicationLiteVo patientMedic)
{
	if (patientMedic == null)
		return;
	DynamicGridColumnCollection columns = form.lyrMain().tabDetails().dyngrdMedication().getColumns();
	DynamicGridRow nRow = form.lyrMain().tabDetails().dyngrdMedication().getRows().newRow();
	DynamicGridCell cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_MEDICATION), DynamicCellType.ENUMERATION);
	if (patientMedic != null && patientMedic.getMedicationIsNotNull())
		nRow.setValue(patientMedic);

	DynamicGridCellItem item = cell.getItems().newItem(patientMedic.getMedication().getMedicationName());
	item.setValue(patientMedic.getMedication());

	cell.setValue(patientMedic.getMedication());
	cell.setAutoPostBack(true);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_BATCHNO), DynamicCellType.STRING);

	cell.setValue(patientMedic.getBatchNo());
	cell.setStringMaxLength(20);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_EXPIRYDATE), DynamicCellType.DATE);
	cell.setValue(patientMedic.getExpiryDate());
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPrescriptionDrug(PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord)// WDEV-13584
{
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if (row == null)
		{
			row = form.dyngrdPrescription().getSelectedRow();
		}

		//	WDEV-14054
		if (row != null)
		{
			if (row.getIdentifier() != null && (row.getIdentifier().equals(NewPrescriptionRecord) || row.getIdentifier().equals(PrescriptionRecord)))
			{
				addPrescriptionDrugRow(row.getRows().newRow(), patientMedication, readOnly, newRecord);// WDEV-13584
			}
			else if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(newRecord ? row.getParent().getRows().newRow() : row, patientMedication, readOnly, newRecord);// WDEV-13584
			}
			
			row.setExpanded(true);
		}
	}
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addRowToMedication(PatientMedicationLiteVo patientMedic)
{
	if (patientMedic == null)
		return;
	DynamicGridColumnCollection columns = form.lyrMain().tabDetails().dyngrdMedication().getColumns();
	DynamicGridRow nRow = form.lyrMain().tabDetails().dyngrdMedication().getRows().newRow();
	DynamicGridCell cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_MEDICATION), DynamicCellType.ENUMERATION);
	if (patientMedic != null && patientMedic.getMedicationIsNotNull())
		nRow.setValue(patientMedic);

	DynamicGridCellItem item = cell.getItems().newItem(patientMedic.getMedication().getMedicationName());
	item.setValue(patientMedic.getMedication());

	cell.setValue(patientMedic.getMedication());
	cell.setAutoPostBack(true);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_BATCHNO), DynamicCellType.STRING);

	cell.setValue(patientMedic.getBatchNo());
	cell.setStringMaxLength(20);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_EXPIRYDATE), DynamicCellType.DATE);
	cell.setValue(patientMedic.getExpiryDate());
}
 
Example 13
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addRowToMedication(PatientMedicationLiteVo patientMedic)
{
	if (patientMedic == null)
		return;
	DynamicGridColumnCollection columns = form.lyrMain().tabDetails().dyngrdMedication().getColumns();
	DynamicGridRow nRow = form.lyrMain().tabDetails().dyngrdMedication().getRows().newRow();
	DynamicGridCell cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_MEDICATION), DynamicCellType.ENUMERATION);
	if (patientMedic != null && patientMedic.getMedicationIsNotNull())
		nRow.setValue(patientMedic);

	DynamicGridCellItem item = cell.getItems().newItem(patientMedic.getMedication().getMedicationName());
	item.setValue(patientMedic.getMedication());

	cell.setValue(patientMedic.getMedication());
	cell.setAutoPostBack(true);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_BATCHNO), DynamicCellType.STRING);

	cell.setValue(patientMedic.getBatchNo());
	cell.setStringMaxLength(20);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_EXPIRYDATE), DynamicCellType.DATE);
	cell.setValue(patientMedic.getExpiryDate());
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getDrugsFromPrescription()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PrescriptionsVo))
		return null;
	
	StringBuilder sb = new StringBuilder();
	String comma = "";
	
	for(int i=0; i<form.dyngrdPrescription().getSelectedRow().getRows().size(); i++)
	{
		if(!(form.dyngrdPrescription().getSelectedRow().getRows().get(i).getValue() instanceof PatientMedicationLiteVo))
			continue;
		
		PatientMedicationLiteVo drug = (PatientMedicationLiteVo) form.dyngrdPrescription().getSelectedRow().getRows().get(i).getValue();
		
		sb.append(comma);
		comma=", ";
		sb.append(drug.getMedication().getID_Medication().intValue());
	}
	
	String result = sb.toString();
	
	if (result == null || result.trim().length() == 0)
			return null;
	
	return result;
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void markDrugAsRIE()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo))
		return;
	
	form.getLocalContext().setMedicationToBeRIE((PatientMedicationLiteVo) form.dyngrdPrescription().getValue());
	engine.open(form.getForms().Core.RieConfirmationDialog);
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void editNewPrescriptionDrug()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo))
		return;
	
	form.getGlobalContext().RefMan.setPrescriptionMedication((PatientMedicationLiteVo) form.dyngrdPrescription().getValue());
	engine.open(form.getForms().Clinical.PrescriptionDialog);
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removePrescriptionDrug()
{
	if (form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo && form.getMode().equals(FormMode.EDIT))
	{
		form.dyngrdPrescription().getRows().remove(form.dyngrdPrescription().getSelectedRow());
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrugRow(DynamicGridRow row, PatientMedicationLiteVo patientMedication, boolean readOnly, boolean newRecord)
{
	DynamicGridColumn coll;
	DynamicGridCell cell;

	if (patientMedication == null)
		return;

	row.setIdentifier(PrescriptionDrug);
	row.setReadOnly(readOnly);
	
	if(newRecord)
		row.setBackColor(Color.Beige);

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_USER);
	cell = row.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	cell.setReadOnly(true);
	cell.setWidth(200);
	
	cell.setValue("<b><i>" + patientMedication.getMedication().getMedicationName() + "</i></b>");

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_DRUG);
	coll.setCaption("Frequency");
	cell = row.getCells().newCell(coll, DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setWidth(100);

	cell.setValue(patientMedication != null ? (patientMedication.getFrequencyIsNotNull() ? patientMedication.getFrequency().getIItemText() : null) : null);
	
	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_FREQUENCY);
	coll.setCaption("NoDaysSupply");
	cell = row.getCells().newCell(coll, DynamicCellType.INT);
	cell.setReadOnly(true);
	cell.setWidth(60);

	cell.setValue(patientMedication != null ? (patientMedication.getNoDaysSupplyIsNotNull() ? patientMedication.getNoDaysSupply() : null) : null);

	row.setValue(patientMedication);
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrug(MedicationLiteVo medicationLiteVo, PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord) 
{			
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if(row == null)
			row = form.dyngrdPrescription().getSelectedRow();
		
		if (row != null)
		{
			if (newRecord)
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(NewPrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}	
			}
			else
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}
			}

			
			if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(row.getParent().getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
			}
			row.setExpanded(true);
		}
					
	}
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addMedication(MedicationVo selectedMedication) 
{
	if(selectedMedication == null)
		return;

	Date date = new Date();
	GenForm.grdMedicationRow row = form.grdMedication().getRows().newRow();
	row.setcolDrug(selectedMedication.getMedicationName());
	row.setcolDate(date);
	
	PatientMedicationLiteVo value = new PatientMedicationLiteVo();		
	value.setMedication(selectedMedication);
	row.setValue(value);
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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);
		}
		
	}
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean save()
{
	PatientMedicationLiteVo medicationData = populateInstanceData();
	
	String[] errors = medicationData.validate();
	
	if(errors != null && errors.length > 0)
	{
		engine.showErrors(errors);	
		return false;
	}
	
	form.getGlobalContext().RefMan.setPrescriptionMedication(medicationData);
	return true;
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	form.getLocalContext().setSelectedEvent(EdAssessment_CustomControlsEvents.SAVE);
	form.fireCustomControlValueChanged();
	
	boolean isRecordEdited = form.dynGridPrescriptions().getValue() instanceof EDPrescriptionVo ? ((EDPrescriptionVo)form.dynGridPrescriptions().getValue()).getID_EDPrescription() != null : form.dynGridPrescriptions().getValue() instanceof PatientMedicationLiteVo ?  ((EDPrescriptionVo)form.dynGridPrescriptions().getSelectedRow().getParent().getValue()).getID_EDPrescription() != null : false;
	if (save(isRecordEdited, false))
		open(false);
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onContextMenuItemClick(int menuItemID, ims.framework.Control sender) throws ims.framework.exceptions.PresentationLogicException
{
	switch (menuItemID)
	{
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.NEW_PRES:
		addNewPrescriptionRecord();
		addNewMedication();
		break;
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.EDIT_PRES:
		editPrescription();
		break;	
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.NEW_MEDICATION:
		addNewMedication();
		break;
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.EDIT_MED:
		editMedication();
		break;
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.REMOVE_MED:
		removeMedication();
		break;
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.RIE_MED:
		markMedicationAsRIE((PatientMedicationLiteVo)form.dynGridPrescriptions().getSelectedRow().getValue());
		break;
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.RIE_PRESC:
		markPrescriptionAsRie((EDPrescriptionVo)form.dynGridPrescriptions().getSelectedRow().getValue());
		break;	
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.PRINT:
		form.getLocalContext().setbReprintActionSelected(false);
		printPrescription((EDPrescriptionVo)form.dynGridPrescriptions().getSelectedRow().getValue());
		break;
	case GenForm.ContextMenus.EmergencyNamespace.PrescriptionMenu.REPRINT:
		form.getLocalContext().setbReprintActionSelected(true);
		rePrintPrescription((EDPrescriptionVo)form.dynGridPrescriptions().getSelectedRow().getValue());
		break;	
	}	
	updateControlsState();
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void markMedicationAsRIE(PatientMedicationLiteVo value)
{
	if (value == null)
		return;

	form.getLocalContext().setMedicationToBeRIEd(value);
	form.getLocalContext().setPrescriptionToBeRIEd(null);
	engine.open(form.getForms().Core.RieConfirmationDialog);
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeMedication()
{
	if (form.dynGridPrescriptions().getValue() instanceof PatientMedicationLiteVo && form.getMode().equals(FormMode.EDIT))
	{			
		DynamicGridRow row = form.dynGridPrescriptions().getSelectedRow();
		form.dynGridPrescriptions().getRows().remove(row);
		form.dynGridPrescriptions().setSelectedRow(row.getParent());
	}
	
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateControlsState()
{
	boolean isHCPUser = domain.getHcpLiteUser() != null;
	boolean canPrescribe = engine.hasRight(AppRight.ED_CAN_PRESCRIBE);
	
	Object selectedGridRecord = form.dynGridPrescriptions().getValue();
	DynamicGridRow selectedGridRowParent = form.dynGridPrescriptions().getSelectedRow() != null ? form.dynGridPrescriptions().getSelectedRow().getParent() : null;
	
	boolean isSavedPrescription =  selectedGridRecord instanceof EDPrescriptionVo &&  ((EDPrescriptionVo) selectedGridRecord).getID_EDPrescriptionIsNotNull();
	boolean isSavedMedication =  selectedGridRecord instanceof PatientMedicationLiteVo &&  ((PatientMedicationLiteVo) selectedGridRecord).getID_PatientMedicationIsNotNull();
	boolean isUnsavedMedication =  selectedGridRecord instanceof PatientMedicationLiteVo &&  ((PatientMedicationLiteVo) selectedGridRecord).getID_PatientMedication() == null;
	boolean isCompletePrescription = isSavedPrescription && Boolean.TRUE.equals(((EDPrescriptionVo) selectedGridRecord).getIsCompleted());
	boolean isPrintedPrescription = isCompletePrescription && Boolean.TRUE.equals(((EDPrescriptionVo) selectedGridRecord).getIsPrinted());
	boolean isParentPrescriptionComplete = selectedGridRecord instanceof PatientMedicationLiteVo && selectedGridRowParent != null && Boolean.TRUE.equals(((EDPrescriptionVo) selectedGridRowParent.getValue()).getIsCompleted());
	boolean isParentPrescriptionPrinted = selectedGridRecord instanceof PatientMedicationLiteVo && selectedGridRowParent != null && Boolean.TRUE.equals(((EDPrescriptionVo) selectedGridRowParent.getValue()).getIsPrinted());
				
	if (!isHCPUser || Boolean.TRUE.equals(form.getLocalContext().getReadOnly()))
	{
		form.getContextMenus().Emergency.hideAllPrescriptionMenuMenuItems();
		return;
	}
	form.getContextMenus().Emergency.getPrescriptionMenuNEW_PRESItem().setVisible(FormMode.VIEW.equals(form.getMode()) && isHCPUser && (selectedGridRecord == null || selectedGridRecord instanceof EDPrescriptionVo));
	form.getContextMenus().Emergency.getPrescriptionMenuEDIT_PRESItem().setVisible(FormMode.VIEW.equals(form.getMode()) && isHCPUser &&  selectedGridRecord instanceof EDPrescriptionVo && !isCompletePrescription);
	form.getContextMenus().Emergency.getPrescriptionMenuNEW_MEDICATIONItem().setVisible(isHCPUser && (selectedGridRecord instanceof EDPrescriptionVo && !isCompletePrescription) || (FormMode.VIEW.equals(form.getMode()) && selectedGridRecord instanceof PatientMedicationLiteVo && selectedGridRowParent.getIdentifier().equals(PrescriptionRecord) && !isParentPrescriptionComplete));
	form.getContextMenus().Emergency.getPrescriptionMenuEDIT_MEDItem().setVisible(isHCPUser && isSavedMedication && !isParentPrescriptionComplete);
	form.getContextMenus().Emergency.getPrescriptionMenuREMOVE_MEDItem().setVisible(FormMode.EDIT.equals(form.getMode())&& isHCPUser && isUnsavedMedication);
	form.getContextMenus().Emergency.getPrescriptionMenuRIE_MEDItem().setVisible(FormMode.VIEW.equals(form.getMode())&& isHCPUser && isSavedMedication && !isParentPrescriptionPrinted);
	form.getContextMenus().Emergency.getPrescriptionMenuRIE_PRESCItem().setVisible(FormMode.VIEW.equals(form.getMode())&& isHCPUser && isSavedPrescription);
	form.getContextMenus().Emergency.getPrescriptionMenuPRINTItem().setVisible(FormMode.VIEW.equals(form.getMode()) && isHCPUser && canPrescribe && isCompletePrescription && !isPrintedPrescription);
	form.getContextMenus().Emergency.getPrescriptionMenuREPRINTItem().setVisible(FormMode.VIEW.equals(form.getMode()) && isHCPUser && canPrescribe && isPrintedPrescription);
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void editMedication()
{
	if(!(form.dynGridPrescriptions().getValue() instanceof PatientMedicationLiteVo))
		return;
	form.dynGridPrescriptions().getSelectedRow().getParent().getCells().get(getColumn(COL_AUTH_DATE)).setReadOnly(false);
	engine.open(form.getForms().Clinical.PrescriptionDialog, new Object[]{(PatientMedicationLiteVo) form.dynGridPrescriptions().getValue()});


}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private ArrayList<Integer> getDrugsFromPrescription()
{
	DynamicGridRow prescRow = null; 
	if (form.dynGridPrescriptions().getSelectedRow().getIdentifier().equals(PrescriptionRecord) || form.dynGridPrescriptions().getSelectedRow().getIdentifier().equals(NewPrescriptionRecord))
		prescRow = form.dynGridPrescriptions().getSelectedRow();
	if (form.dynGridPrescriptions().getSelectedRow().getIdentifier().equals(PrescriptionMeds))
		prescRow = form.dynGridPrescriptions().getSelectedRow().getParent();

	if (prescRow == null)
		return null;
	
	ArrayList<Integer> existingValues = new ArrayList<Integer>();		
	
	for(int i=0; i<prescRow.getRows().size(); i++)
	{
		if(!(prescRow.getRows().get(i).getValue() instanceof PatientMedicationLiteVo))
			continue;

		PatientMedicationLiteVo drug = (PatientMedicationLiteVo) prescRow.getRows().get(i).getValue();
		if(drug.getMedication() != null)
			existingValues.add(drug.getMedication().getID_Medication());
	}

	if (existingValues == null || existingValues.size() == 0)
		return null;

	return existingValues;
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getDrugsFromPrescription()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PrescriptionsVo))
		return null;
	
	StringBuilder sb = new StringBuilder();
	String comma = "";
	
	for(int i=0; i<form.dyngrdPrescription().getSelectedRow().getRows().size(); i++)
	{
		if(!(form.dyngrdPrescription().getSelectedRow().getRows().get(i).getValue() instanceof PatientMedicationLiteVo))
			continue;
		
		PatientMedicationLiteVo drug = (PatientMedicationLiteVo) form.dyngrdPrescription().getSelectedRow().getRows().get(i).getValue();
		
		sb.append(comma);
		comma=", ";
		sb.append(drug.getMedication().getID_Medication().intValue());
	}
	
	String result = sb.toString();
	
	if (result == null || result.trim().length() == 0)
			return null;
	
	return result;
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void markDrugAsRIE()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo))
		return;
	
	form.getLocalContext().setMedicationToBeRIE((PatientMedicationLiteVo) form.dyngrdPrescription().getValue());
	engine.open(form.getForms().Core.RieConfirmationDialog);
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void editNewPrescriptionDrug()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo))
		return;
	
	form.getGlobalContext().RefMan.setPrescriptionMedication((PatientMedicationLiteVo) form.dyngrdPrescription().getValue());
	engine.open(form.getForms().Clinical.PrescriptionDialog);
}
 
Example 33
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removePrescriptionDrug()
{
	if (form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo && form.getMode().equals(FormMode.EDIT))
	{
		form.dyngrdPrescription().getRows().remove(form.dyngrdPrescription().getSelectedRow());
	}
}
 
Example 34
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrugRow(DynamicGridRow row, PatientMedicationLiteVo patientMedication, boolean readOnly, boolean newRecord)
{
	DynamicGridColumn coll;
	DynamicGridCell cell;

	if (patientMedication == null)
		return;

	row.setIdentifier(PrescriptionDrug);
	row.setReadOnly(readOnly);
	
	if(newRecord)
		row.setBackColor(Color.Beige);

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_USER);
	cell = row.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	cell.setReadOnly(true);
	cell.setWidth(200);
	
	cell.setValue("<b><i>" + patientMedication.getMedication().getMedicationName() + "</i></b>");

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_DRUG);
	coll.setCaption("Frequency");
	cell = row.getCells().newCell(coll, DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setWidth(100);

	cell.setValue(patientMedication != null ? (patientMedication.getFrequencyIsNotNull() ? patientMedication.getFrequency().getIItemText() : null) : null);
	
	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_FREQUENCY);
	coll.setCaption("NoDaysSupply");
	cell = row.getCells().newCell(coll, DynamicCellType.INT);
	cell.setReadOnly(true);
	cell.setWidth(60);

	cell.setValue(patientMedication != null ? (patientMedication.getNoDaysSupplyIsNotNull() ? patientMedication.getNoDaysSupply() : null) : null);

	row.setValue(patientMedication);
}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrug(MedicationLiteVo medicationLiteVo, PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord) 
{			
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if(row == null)
			row = form.dyngrdPrescription().getSelectedRow();
		
		if (row != null)
		{
			if (newRecord)
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(NewPrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}	
			}
			else
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}
			}

			
			if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(row.getParent().getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
			}
			row.setExpanded(true);
		}
					
	}
}
 
Example 36
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addMedication(MedicationVo selectedMedication) 
{
	if(selectedMedication == null)
		return;

	Date date = new Date();
	GenForm.grdMedicationRow row = form.grdMedication().getRows().newRow();
	row.setcolDrug(selectedMedication.getMedicationName());
	row.setcolDate(date);
	
	PatientMedicationLiteVo value = new PatientMedicationLiteVo();		
	value.setMedication(selectedMedication);
	row.setValue(value);
}
 
Example 37
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
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);
		}
		
	}
}
 
Example 38
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialize(Object[] args)
{
	form.getLocalContext().setPrescribedMedication(null);
	if (args != null && args.length > 0)//WDEV-18980
	{
		if (args.length >= 1 && args[0] != null && args[0] instanceof PatientMedicationLiteVo)
			form.getLocalContext().setPrescribedMedication((PatientMedicationLiteVo) args[0]);
		form.getGlobalContext().RefMan.setPrescriptionMedication(null);
	}
	form.qmbMedication().setFocus();
	form.getLocalContext().setbAllowFreeTextMedication(ConfigFlag.GEN.PRESCRIPTION_ALLOW_FREETEXT_MEDICATION.getValue()); //WDEV-18980		
}
 
Example 39
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getDrugsFromPrescription()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PrescriptionsVo))
		return null;
	
	StringBuilder sb = new StringBuilder();
	String comma = "";
	
	for(int i=0; i<form.dyngrdPrescription().getSelectedRow().getRows().size(); i++)
	{
		if(!(form.dyngrdPrescription().getSelectedRow().getRows().get(i).getValue() instanceof PatientMedicationLiteVo))
			continue;
		
		PatientMedicationLiteVo drug = (PatientMedicationLiteVo) form.dyngrdPrescription().getSelectedRow().getRows().get(i).getValue();
		
		sb.append(comma);
		comma=", ";
		sb.append(drug.getMedication().getID_Medication().intValue());
	}
	
	String result = sb.toString();
	
	if (result == null || result.trim().length() == 0)
			return null;
	
	return result;
}
 
Example 40
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void markDrugAsRIE()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo))
		return;
	
	form.getLocalContext().setMedicationToBeRIE((PatientMedicationLiteVo) form.dyngrdPrescription().getValue());
	engine.open(form.getForms().Core.RieConfirmationDialog);
}
 
Example 41
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void editNewPrescriptionDrug()
{
	if(!(form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo))
		return;
	
	form.getGlobalContext().RefMan.setPrescriptionMedication((PatientMedicationLiteVo) form.dyngrdPrescription().getValue());
	engine.open(form.getForms().Clinical.PrescriptionDialog);
}
 
Example 42
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removePrescriptionDrug()
{
	if (form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo && form.getMode().equals(FormMode.EDIT))
	{
		form.dyngrdPrescription().getRows().remove(form.dyngrdPrescription().getSelectedRow());
	}
}
 
Example 43
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrugRow(DynamicGridRow row, PatientMedicationLiteVo patientMedication, boolean readOnly, boolean newRecord)
{
	DynamicGridColumn coll;
	DynamicGridCell cell;

	if (patientMedication == null)
		return;

	row.setIdentifier(PrescriptionDrug);
	row.setReadOnly(readOnly);
	
	if(newRecord)
		row.setBackColor(Color.Beige);

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_USER);
	cell = row.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	cell.setReadOnly(true);
	cell.setWidth(200);
	
	cell.setValue("<b><i>" + patientMedication.getMedication().getMedicationName() + "</i></b>");

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_DRUG);
	coll.setCaption("Frequency");
	cell = row.getCells().newCell(coll, DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setWidth(100);

	cell.setValue(patientMedication != null ? (patientMedication.getFrequencyIsNotNull() ? patientMedication.getFrequency().getIItemText() : null) : null);
	
	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_FREQUENCY);
	coll.setCaption("NoDaysSupply");
	cell = row.getCells().newCell(coll, DynamicCellType.INT);
	cell.setReadOnly(true);
	cell.setWidth(60);

	cell.setValue(patientMedication != null ? (patientMedication.getNoDaysSupplyIsNotNull() ? patientMedication.getNoDaysSupply() : null) : null);

	row.setValue(patientMedication);
}
 
Example 44
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrug(MedicationLiteVo medicationLiteVo, PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord) 
{			
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if(row == null)
			row = form.dyngrdPrescription().getSelectedRow();
		
		if (row != null)
		{
			if (newRecord)
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(NewPrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}	
			}
			else
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}
			}

			
			if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(row.getParent().getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
			}
			row.setExpanded(true);
		}
					
	}
}
 
Example 45
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addMedication(MedicationVo selectedMedication) 
{
	if(selectedMedication == null)
		return;

	Date date = new Date();
	GenForm.grdMedicationRow row = form.grdMedication().getRows().newRow();
	row.setcolDrug(selectedMedication.getMedicationName());
	row.setcolDate(date);
	
	PatientMedicationLiteVo value = new PatientMedicationLiteVo();		
	value.setMedication(selectedMedication);
	row.setValue(value);
}
 
Example 46
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
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);
		}
		
	}
}
 
Example 47
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean save()
{
	PatientMedicationLiteVo medicationData = populateInstanceData();
	
	String[] errors = medicationData.validate();
	
	if(errors != null && errors.length > 0)
	{
		engine.showErrors(errors);	
		return false;
	}
	
	form.getGlobalContext().RefMan.setPrescriptionMedication(medicationData);
	return true;
}
 
Example 48
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean save()
{
	PatientMedicationLiteVo medicationData = populateInstanceData();
	
	String[] errors = medicationData.validate();
	
	if(errors != null && errors.length > 0)
	{
		engine.showErrors(errors);	
		return false;
	}
	
	form.getGlobalContext().CareUk.setPrescriptionMedication(medicationData);
	return true;
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void updateContextMenuState()
{
	boolean isPrescriptionDrug = form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo;//WDEV-14054
	boolean isEditMode = form.getMode().equals(FormMode.EDIT) ? true : false;
	boolean isViewMode = form.getMode().equals(FormMode.VIEW) ? true : false; //WDEV-13956

	//start WDEV-13956
	boolean isPrinted = false;
	PrescriptionsVo selectedPrescription = null;

	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if (form.dyngrdPrescription().getSelectedRow().getParent() != null)
		{
			selectedPrescription = (PrescriptionsVo) form.dyngrdPrescription().getSelectedRow().getParent().getValue();
		}
		else
		{
			selectedPrescription = (PrescriptionsVo) form.dyngrdPrescription().getSelectedRow().getValue();
		}
	}

	if (selectedPrescription != null && selectedPrescription.getIsPrintedIsNotNull())
	{
		isPrinted = selectedPrescription.getIsPrinted();
	}
	// end

	form.getContextMenus().RefMan.getPrescriptionNewPrescriptionRecordItem().setVisible(true && !isEditMode);
	form.getContextMenus().RefMan.getPrescriptionAddPrescriptionDrugItem().setVisible(form.dyngrdPrescription().getValue() instanceof PrescriptionsVo && !isPrinted);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionEDIT_PRESCRIPTION_DRUGItem().setVisible(form.dyngrdPrescription().getSelectedRow() != null && isPrescriptionDrug && !isPrinted && ((PatientMedicationLiteVo) form.dyngrdPrescription().getValue()).getID_PatientMedication() != null);//	WDEV-14054
	// WDEV-13956
	form.getContextMenus().RefMan.getPrescriptionRemovePrescriptionDrugItem().setVisible(isPrescriptionDrug && isEditMode && ((PatientMedicationLiteVo) form.dyngrdPrescription().getValue()).getID_PatientMedication() == null);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionRIE_PRESCRIPTION_DRUGItem().setVisible(isPrescriptionDrug && engine.hasRight(AppRight.CAN_REMOVE_DRUG_FROM_PRESCRIPTION)  && isViewMode && !isPrinted);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionRIEItem().setVisible(form.dyngrdPrescription().getSelectedRow() != null && isPrinted && !isPrescriptionDrug && isViewMode);

	boolean isReadOnlyMode = form.getLocalContext().getDisplayReadOnlyIsNotNull() ? form.getLocalContext().getDisplayReadOnly() : false;
	if (isReadOnlyMode)
	{
		form.getContextMenus().RefMan.hideAllPrescriptionMenuItems();
	}
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
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;
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
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();
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
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;			
}
 
Example 53
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void addMedicationRow(PatientMedicationLiteVo patientMedicationLiteVo,DynamicGridRow medRow, boolean readOnly, boolean newRecord)
{
	if (medRow == null)
		return;
			
	medRow.setIdentifier(PrescriptionMeds);
	medRow.setReadOnly(readOnly);

	DynamicGridColumn coll = form.dynGridPrescriptions().getColumns().getByIdentifier(COL_AUTH_USER);
	DynamicGridCell userCell = medRow.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	String cellDisplayText = medRow.getParent().getValue() instanceof EDPrescriptionVo ? ((EDPrescriptionVo) medRow.getParent().getValue()).getRecordingInformationIsNotNull() && ((EDPrescriptionVo) medRow.getParent().getValue()).getRecordingInformation().getAuthoringHcp() != null ? ((EDPrescriptionVo) medRow.getParent().getValue()).getRecordingInformation().getAuthoringHcp().getIMosName() : "" : "";
	userCell.setValue(cellDisplayText);
	userCell.setTooltip(cellDisplayText);
	userCell.setReadOnly(true);

	coll = form.dynGridPrescriptions().getColumns().getByIdentifier(COL_MEDS);
	DynamicGridCell medCell = medRow.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	coll.setCaption(COL_MED_NAME_CAPTION);
	medCell.setValue(patientMedicationLiteVo.getOtherMedicationText());
	medCell.setTooltip(patientMedicationLiteVo.getOtherMedicationText());
	medCell.setReadOnly(true);

	coll = form.dynGridPrescriptions().getColumns().getByIdentifier(COL_FREQUENCY);
	DynamicGridCell freqCell = medRow.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	coll.setCaption(COL_MED_FREQUENCY_CAPTION);
	freqCell.setReadOnly(true);

	freqCell.setValue(patientMedicationLiteVo != null ? (patientMedicationLiteVo.getFrequencyIsNotNull() ? patientMedicationLiteVo.getFrequency().getIItemText() : null) : null);
	freqCell.setTooltip(patientMedicationLiteVo != null ? (patientMedicationLiteVo.getFrequencyIsNotNull() ? patientMedicationLiteVo.getFrequency().getIItemText() : "") : "");
	
	coll = form.dynGridPrescriptions().getColumns().getByIdentifier(COL_DAYS_SUPPLY);
	coll.setCaption(COL_MED_NO_OF_DAYS_SUPPLY_CAPTION);
	
	DynamicGridCell amountCell = medRow.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	amountCell.setReadOnly(true);
	amountCell.setValue(patientMedicationLiteVo != null && patientMedicationLiteVo.getNoDaysSupplyIsNotNull() ?  "<p style=\"text-align: center;\">" +  String.valueOf(patientMedicationLiteVo.getNoDaysSupply().intValue()) + "</p>" : null);
	amountCell.setTooltip(patientMedicationLiteVo != null && patientMedicationLiteVo.getNoDaysSupplyIsNotNull() ? String.valueOf(patientMedicationLiteVo.getNoDaysSupply().intValue()) : "");
	
	medRow.setValue(patientMedicationLiteVo);

	if(newRecord)
		medRow.setBackColor(Color.Beige);		

}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void addPrescriptionRecord(DynamicGridRow row, EDPrescriptionVo prescriptionVo, boolean newRecord, boolean readOnly)
{
	AuthoringInformationVo authoringInfo = new AuthoringInformationVo();
	HcpLiteVo currentHCPUser = (HcpLiteVo) domain.getHcpLiteUser();
	if (prescriptionVo == null)
	{
		prescriptionVo = new EDPrescriptionVo();
	}

	if (row == null)
		row = newRecord ? form.dynGridPrescriptions().getRows().newRow(true) : form.dynGridPrescriptions().getRows().newRow(); //WDEV-18973

	if (newRecord)
		row.setIdentifier(NewPrescriptionRecord);
	else
		row.setIdentifier(PrescriptionRecord);
	
	DynamicGridCell prescDateCell = row.getCells().newCell(getColumn(COL_AUTH_DATE), DynamicCellType.DATETIME);
	prescDateCell.setValue(prescriptionVo != null ? (prescriptionVo.getAuthoringInformationIsNotNull() ? prescriptionVo.getAuthoringInformation().getAuthoringDateTime():new DateTime()) : new DateTime());
	prescDateCell.setReadOnly(readOnly);
	prescDateCell.setAutoPostBack(true);
	
	DynamicGridCell prescUserCell = row.getCells().newCell(getColumn(COL_AUTH_USER), DynamicCellType.HTMLVIEW);
	prescUserCell.setReadOnly(Boolean.TRUE);
	prescUserCell.setValue(prescriptionVo != null ? (prescriptionVo.getRecordingInformationIsNotNull() && prescriptionVo.getRecordingInformation().getAuthoringHcpIsNotNull() ? prescriptionVo.getRecordingInformation().getAuthoringHcp().getIMosName() : currentHCPUser != null ? currentHCPUser.getIMosName() : null) : currentHCPUser != null ? currentHCPUser.getIMosName() : null);
	prescUserCell.setTooltip(prescriptionVo != null ? (prescriptionVo.getRecordingInformationIsNotNull() && prescriptionVo.getRecordingInformation().getAuthoringHcpIsNotNull() ? prescriptionVo.getRecordingInformation().getAuthoringHcp().getIMosName() : currentHCPUser != null ? currentHCPUser.getIMosName() : "") : currentHCPUser != null ? currentHCPUser.getIMosName() : "");

	DynamicCellType cellType = getCellType(newRecord, Boolean.TRUE.equals(prescriptionVo.getIsCompleted()));
	DynamicGridCell completedCell = row.getCells().newCell(getColumn(COL_PRESC_COMPLETED), cellType);
	

	if (DynamicCellType.IMAGE.equals(completedCell.getType()))
	{		
		completedCell.setValue(Boolean.TRUE.equals(prescriptionVo.getIsCompleted()) ? form.getImages().Correspondence.DocumentCompleted16 : null);
		completedCell.setReadOnly(true);
		completedCell.setWidth(completedCell.getColumn().getWidth());
		completedCell.setTooltip(buildCompletingInfoTooltip(prescriptionVo));			
	}
	if (DynamicCellType.BUTTON.equals(completedCell.getType()))
	{		
		completedCell.setButtonText(" Complete ");
		completedCell.setReadOnly(true);
		completedCell.setAutoPostBack(true);
	}
	
	if (row.getIdentifier().equals(PrescriptionRecord) && Boolean.TRUE.equals(prescriptionVo.getIsPrinted()))
	{		
		DynamicGridCell printedCell = row.getCells().newCell(getColumn(COL_PRESC_PRINTED), DynamicCellType.IMAGE);
		printedCell.setValue(form.getImages().Correspondence.Printer);
		printedCell.setTooltip("Printed");
	}
	
	authoringInfo = populateAuthoringInfoData(prescDateCell, true);
			
	prescriptionVo.setAuthoringInformation(authoringInfo);
	row.setValue(prescriptionVo);
			
	if (prescriptionVo.getMedications() == null || prescriptionVo.getMedications().size() == 0)
		return;
	for (int i = 0; i < prescriptionVo.getMedications().size(); i++)
	{
		PatientMedicationLiteVo patientMedication = prescriptionVo.getMedications().get(i);
		if (patientMedication == null)
			continue;
		addMedication(patientMedication, row, true, newRecord);

	}
}
 
Example 55
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void updateContextMenuState()
{
	boolean isPrescriptionDrug = form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo;//WDEV-14054
	boolean isEditMode = form.getMode().equals(FormMode.EDIT) ? true : false;
	boolean isViewMode = form.getMode().equals(FormMode.VIEW) ? true : false; //WDEV-13956

	//start WDEV-13956
	boolean isPrinted = false;
	PrescriptionsVo selectedPrescription = null;

	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if (form.dyngrdPrescription().getSelectedRow().getParent() != null)
		{
			selectedPrescription = (PrescriptionsVo) form.dyngrdPrescription().getSelectedRow().getParent().getValue();
		}
		else
		{
			selectedPrescription = (PrescriptionsVo) form.dyngrdPrescription().getSelectedRow().getValue();
		}
	}

	if (selectedPrescription != null && selectedPrescription.getIsPrintedIsNotNull())
	{
		isPrinted = selectedPrescription.getIsPrinted();
	}
	// end

	form.getContextMenus().RefMan.getPrescriptionNewPrescriptionRecordItem().setVisible(true && !isEditMode);
	form.getContextMenus().RefMan.getPrescriptionAddPrescriptionDrugItem().setVisible(form.dyngrdPrescription().getValue() instanceof PrescriptionsVo && !isPrinted);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionEDIT_PRESCRIPTION_DRUGItem().setVisible(form.dyngrdPrescription().getSelectedRow() != null && isPrescriptionDrug && !isPrinted && ((PatientMedicationLiteVo) form.dyngrdPrescription().getValue()).getID_PatientMedication() != null);//	WDEV-14054
	// WDEV-13956
	form.getContextMenus().RefMan.getPrescriptionRemovePrescriptionDrugItem().setVisible(isPrescriptionDrug && isEditMode && ((PatientMedicationLiteVo) form.dyngrdPrescription().getValue()).getID_PatientMedication() == null);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionRIE_PRESCRIPTION_DRUGItem().setVisible(isPrescriptionDrug && engine.hasRight(AppRight.CAN_REMOVE_DRUG_FROM_PRESCRIPTION)  && isViewMode && !isPrinted);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionRIEItem().setVisible(form.dyngrdPrescription().getSelectedRow() != null && isPrinted && !isPrescriptionDrug && isViewMode);

	boolean isReadOnlyMode = form.getLocalContext().getDisplayReadOnlyIsNotNull() ? form.getLocalContext().getDisplayReadOnly() : false;
	if (isReadOnlyMode)
	{
		form.getContextMenus().RefMan.hideAllPrescriptionMenuItems();
	}
}
 
Example 56
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void addNewPrescriptionRecord(DynamicGridRow row, PrescriptionsVo value, boolean newRecord)
{
	DynamicGridColumn coll;
	DynamicGridCell cell;
	AuthoringInformationVo authoring = null;

	if (value == null)
	{
		value = new PrescriptionsVo();
	}

	if (value.getAuthoringInformation() == null)
		authoring = new AuthoringInformationVo();
	else
		authoring = value.getAuthoringInformation();

	if (row == null)
		row = form.dyngrdPrescription().getRows().newRow(true);

	if (newRecord)
		row.setIdentifier(NewPrescriptionRecord);
	else
		row.setIdentifier(PrescriptionRecord);

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_DATE);
	cell = row.getCells().newCell(coll, DynamicCellType.DATETIME);
	cell.setValue(value != null ? (value.getAuthoringInformationIsNotNull() ? value.getAuthoringInformation().getAuthoringDateTime() : new DateTime()) : new DateTime());
	cell.setReadOnly(FormMode.VIEW.equals(form.getMode()));
	authoring.setAuthoringDateTime(cell.getValue() != null ? (DateTime) cell.getValue() : null);

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_USER);
	cell = row.getCells().newCell(coll, DynamicCellType.STRING);
	cell.setValue(value != null && value.getAuthoringInformationIsNotNull() ? (value.getAuthoringInformation().getAuthoringHcpIsNotNull() ? (value.getAuthoringInformation().getAuthoringHcp().getName() != null ? value.getAuthoringInformation().getAuthoringHcp().getName().toString() : null) : null) : domain.getHcpLiteUser() != null ? ((HcpLiteVo) domain.getHcpLiteUser()).getName() != null ? ((HcpLiteVo) domain.getHcpLiteUser()).getName().toString() : null : null);
	cell.setReadOnly(true);
	authoring.setAuthoringHcp(value != null && value.getAuthoringInformationIsNotNull() ? (value.getAuthoringInformation().getAuthoringHcpIsNotNull() ? value.getAuthoringInformation().getAuthoringHcp() : null) : domain.getHcpLiteUser() != null ? ((HcpLiteVo) domain.getHcpLiteUser()) : null);

	value.setAuthoringInformation(authoring);
	value.setCatsReferral(form.getGlobalContext().RefMan.getCatsReferral());
	
	row.setValue(value);

	if (value != null)
	{
		if (value.getMedicationsIsNotNull())
		{
			for (int i = 0; i < value.getMedications().size(); i++)
			{
				PatientMedicationLiteVo patientMedication = value.getMedications().get(i);
				addPrescriptionDrug(patientMedication, row, true, newRecord);//	WDEV-14054
			}
		}
	}
}
 
Example 57
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
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;
}
 
Example 58
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void addNewPrescriptionRecord(DynamicGridRow row, PrescriptionsVo value, boolean newRecord) 
{
	DynamicGridColumn 	coll;
	DynamicGridCell 	cell;
	AuthoringInformationVo authoring = null;
	
	if (value == null) 
	{
		return;
		//value = new PrescriptionsVo();
	}
	
	if (value.getAuthoringInformation() == null)
		authoring = new AuthoringInformationVo();
	else
		authoring =value.getAuthoringInformation();
	
	if (row == null)
		row = form.dyngrdPrescription().getRows().newRow(true);
	
	row.setIdentifier(PrescriptionRecord);
	row.setReadOnly(true);
	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_DATE);
	cell = row.getCells().newCell(coll, DynamicCellType.DATETIME);						
	//cell.setValue(value != null ? (value.getAuthoringInformationIsNotNull() ? value.getAuthoringInformation().getAuthoringDateTime() : new DateTime())  : new DateTime());
	cell.setValue(value != null ? (value.getAuthoringInformationIsNotNull() ? value.getAuthoringInformation().getAuthoringDateTime() : null)  : null);
	
	cell.setReadOnly(true);
	
	authoring.setAuthoringDateTime(cell.getValue() != null ? (DateTime)cell.getValue() : null);
			
	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_USER);
	cell = row.getCells().newCell(coll, DynamicCellType.STRING);		
	cell.setValue(value != null && value.getAuthoringInformationIsNotNull() ? (value.getAuthoringInformation().getAuthoringHcpIsNotNull() ? (value.getAuthoringInformation().getAuthoringHcp().getName() != null ? value.getAuthoringInformation().getAuthoringHcp().getName().toString() : null) : null ) : domain.getHcpLiteUser() != null ? ((HcpLiteVo)domain.getHcpLiteUser()).getName() != null ? ((HcpLiteVo)domain.getHcpLiteUser()).getName().toString() :  null : null);
	cell.setReadOnly(true);	
	authoring.setAuthoringHcp(value != null && value.getAuthoringInformationIsNotNull() ? (value.getAuthoringInformation().getAuthoringHcpIsNotNull() ? value.getAuthoringInformation().getAuthoringHcp() : null)  : domain.getHcpLiteUser() != null ? ((HcpLiteVo)domain.getHcpLiteUser()) : null);		
	
	value.setAuthoringInformation(authoring);
	value.setCatsReferral(form.getGlobalContext().RefMan.getCatsReferral());

	row.setValue(value);
	
	
	if (value != null)
	{
		if (value.getMedicationsIsNotNull())
		{
			for (int i = 0; i < value.getMedications().size(); i++) 
			{
				PatientMedicationLiteVo patientMedication = value.getMedications().get(i);					
				addPrescriptionDrug((MedicationLiteVo) patientMedication.getMedication(), patientMedication, row, true, newRecord);					
			}				
		}
	}
}
 
Example 59
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
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();
}
 
Example 60
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void updateContextMenuState()
{
	boolean isPrescriptionDrug = form.dyngrdPrescription().getValue() instanceof PatientMedicationLiteVo;//WDEV-14054
	boolean isEditMode = form.getMode().equals(FormMode.EDIT) ? true : false;
	boolean isViewMode = form.getMode().equals(FormMode.VIEW) ? true : false; //WDEV-13956

	//start WDEV-13956
	boolean isPrinted = false;
	PrescriptionsVo selectedPrescription = null;

	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if (form.dyngrdPrescription().getSelectedRow().getParent() != null)
		{
			selectedPrescription = (PrescriptionsVo) form.dyngrdPrescription().getSelectedRow().getParent().getValue();
		}
		else
		{
			selectedPrescription = (PrescriptionsVo) form.dyngrdPrescription().getSelectedRow().getValue();
		}
	}

	if (selectedPrescription != null && selectedPrescription.getIsPrintedIsNotNull())
	{
		isPrinted = selectedPrescription.getIsPrinted();
	}
	// end

	form.getContextMenus().RefMan.getPrescriptionNewPrescriptionRecordItem().setVisible(true && !isEditMode);
	form.getContextMenus().RefMan.getPrescriptionAddPrescriptionDrugItem().setVisible(form.dyngrdPrescription().getValue() instanceof PrescriptionsVo && !isPrinted);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionEDIT_PRESCRIPTION_DRUGItem().setVisible(form.dyngrdPrescription().getSelectedRow() != null && isPrescriptionDrug && !isPrinted && ((PatientMedicationLiteVo) form.dyngrdPrescription().getValue()).getID_PatientMedication() != null);//	WDEV-14054
	// WDEV-13956
	form.getContextMenus().RefMan.getPrescriptionRemovePrescriptionDrugItem().setVisible(isPrescriptionDrug && isEditMode && ((PatientMedicationLiteVo) form.dyngrdPrescription().getValue()).getID_PatientMedication() == null);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionRIE_PRESCRIPTION_DRUGItem().setVisible(isPrescriptionDrug && engine.hasRight(AppRight.CAN_REMOVE_DRUG_FROM_PRESCRIPTION)  && isViewMode && !isPrinted);//	WDEV-14054
	form.getContextMenus().RefMan.getPrescriptionRIEItem().setVisible(form.dyngrdPrescription().getSelectedRow() != null && isPrinted && !isPrescriptionDrug && isViewMode);

	boolean isReadOnlyMode = form.getLocalContext().getDisplayReadOnlyIsNotNull() ? form.getLocalContext().getDisplayReadOnly() : false;
	if (isReadOnlyMode)
	{
		form.getContextMenus().RefMan.hideAllPrescriptionMenuItems();
	}
}