private static Patient createPatient(final String name) { final Patient patient = new Patient(); patient.getName().add(new HumanName().setFamily(name)); patient.setId(createId(counter, 1L)); counter++; return patient; }
pat.getTelecom().add(convert.makeContactFromTEL(e)); for (Element e : cda.getChildren(p, "name")) pat.getName().add(convert.makeNameFromEN(e)); pat.setGender(convert.makeGenderFromCD(cda.getChild(p, "administrativeGenderCode"))); pat.setBirthDateElement(convert.makeDateFromTS(cda.getChild(p, "birthTime")));
/** * Sort by patient full name, ignoring case. * * @param patient1 First patient to compare. * @param patient2 Second patient to compare. * @return Result of comparison. */ @Override public int compare(Patient patient1, Patient patient2) { HumanName name1 = FhirUtil.getName(patient1.getName(), NameUse.USUAL, null); HumanName name2 = FhirUtil.getName(patient2.getName(), NameUse.USUAL, null); String cmp1 = name1 == null ? "" : name1.toString(); String cmp2 = name2 == null ? "" : name2.toString(); return cmp1.compareToIgnoreCase(cmp2.toString()); }
this.active = castToBoolean(value); // BooleanType } else if (name.equals("name")) { this.getName().add(castToHumanName(value)); } else if (name.equals("telecom")) { this.getTelecom().add(castToContactPoint(value));
tgt.addIdentifier(convertIdentifier(t)); tgt.setActive(src.getActive()); for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())
/** * Creates a CCOW context from the specified patient object. */ @Override public ContextItems toCCOWContext(Patient patient) { Identifier mrn = FhirUtil.getMRN(patient); contextItems.setItem(CCOW_MRN, mrn == null ? null : mrn.getValue(), "MRN"); contextItems.setItem(CCOW_NAM, patient.getName()); contextItems.setItem(CCOW_SEX, patient.getGender()); contextItems.setItem(CCOW_DOB, patient.getBirthDate()); return contextItems; }
return value; case 3373707: // name this.getName().add(castToHumanName(value)); // HumanName return value; case -1429363305: // telecom
private void setPatient(Patient patient) { this.patient = patient; hideLabels(); needsDetail = true; pnlDetail.destroyChildren(); if (log.isDebugEnabled()) { log.debug("patient: " + patient); } if (patient == null) { lblName.setLabel(noSelection); btnDetail.setDisabled(true); return; } btnDetail.setDisabled(false); patientName = FhirUtil.formatName(patient.getName()); String mrn = FhirUtil.getMRNString(patient); lblName.setLabel(patientName + (mrn.isEmpty() ? "" : " (" + mrn + ")")); setLabel(lblDOB, formatDateAndAge(patient.getBirthDate()), lblDOBLabel); setLabel(lblDOD, formatDOD(patient.getDeceased()), lblDODLabel); setLabel(lblGender, patient.hasGender() ? patient.getGender().getDisplay() : null, null); }
private void setPatient(Patient patient) { this.patient = patient; hideLabels(); needsDetail = true; ZKUtil.detachChildren(pnlDetail); if (log.isDebugEnabled()) { log.debug("patient: " + patient); } if (patient == null) { lblName.setValue(noSelection); lblName.setSclass("z-bandbox-disabled"); btnDetail.setDisabled(true); return; } btnDetail.setDisabled(false); patientName = FhirUtil.formatName(patient.getName()); String mrn = FhirUtil.getMRNString(patient); lblName.setValue(patientName + (mrn.isEmpty() ? "" : " (" + mrn + ")")); lblName.setSclass(null); setLabel(lblDOB, formatDateAndAge(patient.getBirthDate()), lblDOBLabel); setLabel(lblDOD, formatDOD(patient.getDeceased()), lblDODLabel); setLabel(lblGender, patient.hasGender() ? patient.getGender().getDisplay() : null, null); Clients.resize(root); }
HumanName name = FhirUtil.getName(patient.getName(), NameUse.USUAL, null);
/** * Retrieves a formatted header for the current patient. * * @return Formatted header. */ public String getPatientInfo() { Patient patient = PatientContext.getActivePatient(); String text; if (patient == null) { text = "No Patient Selected"; } else { Identifier mrn = FhirUtil.getMRN(patient); // May be null! text = FhirUtil.formatName(patient.getName()); if (mrn != null) { text += " #" + mrn.getValue(); } String gender = patient.hasGender() ? patient.getGender().getDisplay() : ""; if (!StringUtils.isEmpty(gender)) { text += " (" + gender + ")"; } Date deceased = patient.getDeceased() instanceof DateType ? ((DateType) patient.getDeceased()).getValue() : null; String age = DateUtil.formatAge(patient.getBirthDate(), true, deceased); text += " Age: " + age; if (deceased != null) { text += " Died: " + DateUtil.formatDate(deceased); } } return text; }
for (HumanName name : patient.getName()) {
pat.getTelecom().add(convert.makeContactFromTEL(e)); for (Element e : cda.getChildren(p, "name")) pat.getName().add(convert.makeNameFromEN(e)); pat.setGender(convert.makeGenderFromCD(cda.getChild(p, "administrativeGenderCode"))); pat.setBirthDateElement(convert.makeDateFromTS(cda.getChild(p, "birthTime")));
@Test @Ignore public void marshalling() throws Exception { changePatientContext(); ContextMarshaller marshaller = contextManager.getContextMarshaller("keystore-test"); String ctx = marshaller.marshal(contextManager.getMarshaledContext()); String sig = marshaller.sign(ctx); PatientContext.changePatient((Patient) null); assertNull(PatientContext.getActivePatient()); marshaller.unmarshal(ctx, sig); Patient patient = PatientContext.getActivePatient(); assertTrue("Doe, Jane".equalsIgnoreCase(new HumanNameParser().toString(patient.getName().get(0)))); }
photo.setSrc(Util.getImage(patient.getPhoto(), Util.SILHOUETTE_IMAGE).getSrc()); root.addChild(photo); addDemographic(root, null, FhirUtil.formatName(patient.getName()), "font-weight: bold"); addDemographic(root, "mrn", FhirUtil.getMRNString(patient)); addDemographic(root, "gender", patient.getGender());
@Override public void committed() { Patient patient = PatientContext.getActivePatient(); AImage image = patient == null ? null : Util.getImage(patient.getPhoto()); if (patient == null) { imgPhoto.setSrc(Util.NOPATIENT_IMAGE); imgPhoto.setTooltip((Popup) null); imgPhoto.setTooltiptext(Labels.getLabel("patientphoto.no.patient")); } else if (image == null) { imgPhoto.setSrc(Util.SILHOUETTE_IMAGE); imgPhoto.setTooltip((Popup) null); imgPhoto.setTooltiptext(Labels.getLabel("patientphoto.no.photo")); } else { imgPhoto.setContent(image); imgPhoto.setTooltiptext(null); imgPhoto.setTooltip(popup); imgFullPhoto.setContent(image); lblCaption.setValue( patient == null ? "" : FhirUtil.formatName(patient.getName(), NameUse.USUAL, NameUse.OFFICIAL, null)); } }
Patient patient1 = new Patient(); patient1.setId("321"); patient1.getName().add(hnp.fromString(null, "Smith, Joe")); Identifier ssn = new Identifier(); ssn.setType(FhirTerminology.IDENT_SSN); Patient patient2 = new Patient(); patient2.setId("123"); patient2.getName().add(hnp.fromString(null, "Doe, Jane")); Identifier ssn2 = new Identifier(); ssn2.setType(FhirTerminology.IDENT_SSN);
tgt.addIdentifier(convertIdentifier(t)); tgt.setActive(src.getActive()); for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.addName(convertHumanName(t)); for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())