protected void open() { populateDemoData(); PatientShort patientShort = form.getGlobalContext().Core.getPatientShort(); form.lyrPain().tabPageACutePainRefDet().txtName().setValue(patientShort.getName().toString()); form.lyrPain() .tabPageACutePainRefDet() .txtAddress() .setValue( patientShort.getAddressIsNotNull() ? patientShort.getAddress().toDisplayString() : null); form.lyrPain() .tabPageACutePainRefDet() .txtDOB() .setValue(patientShort.getDobIsNotNull() ? patientShort.getDob().toString() : null); form.lyrPain() .tabPageACutePainRefDet() .txtWard() .setValue(patientShort.getWardIsNotNull() ? patientShort.getWard().getName() : null); PatientIdCollection identifiers = patientShort.getIdentifiers(); for (int i = 0; identifiers != null && i < identifiers.size(); i++) { if (PatIdType.NHSN.equals(identifiers.get(i).getType())) { form.lyrPain().tabPageACutePainRefDet().txtNhs().setValue(identifiers.get(i).getValue()); } else if (PatIdType.CHARTNUM.equals(identifiers.get(i).getType())) { form.lyrPain().tabPageACutePainRefDet().txtCr().setValue(identifiers.get(i).getValue()); } } form.setMode(FormMode.VIEW); }
private void populateDemographicINfo() { PatientShort pat = form.getGlobalContext().Core.getPatientShort(); if (pat == null) throw new DomainRuntimeException("No Patient Supplied"); if (pat.getNameIsNotNull()) { form.lblSurname().setValue(pat.getName().getSurname()); form.lblForename().setValue(pat.getName().getForename()); } form.lblSex().setValue(pat.getSexIsNotNull() ? pat.getSex().toString() : ""); form.lblDOB().setValue(pat.getDobIsNotNull() ? pat.getDob().toString() : ""); PatientIdCollection identifers = pat.getIdentifiers(); if (identifers != null) { for (int i = 0; i < identifers.size(); i++) { ims.core.vo.PatientId id = identifers.get(i); ims.RefMan.forms.daycaseadmissiondialog.GenForm.grdIdentifiersRow row = form.grdIdentifiers().getRows().newRow(); bindColType(row, false); row.getcolIdType().setValue(id.getType()); row.setcolIdValue(id.getValue()); row.setValue(id); if (id.getVerifiedIsNotNull() && !id.getVerified() && id.getType().equals(PatIdType.NHSN)) { row.setBackColor(Color.Orange); row.setReadOnly(true); } if (id.getTypeIsNotNull() && id.getType().equals(PatIdType.NHSN) && !ConfigFlag.GEN.ALLOW_UPDATES_TO_NHS_NO.getValue()) row.setReadOnly(true); } } }