} else if (nextObject instanceof PeriodDt) { PeriodDt nextValue = (PeriodDt) nextObject; if (nextValue.isEmpty()) { continue; nextEntity = new ResourceIndexedSearchParamDate(nextSpDef.getName(), nextValue.getStart(), nextValue.getEnd(), nextValue.getStartElement().getValueAsString()); } else { if (!multiType) {
/** * Gets the value(s) for <b>period</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * Time period when address was/is in use * </p> */ public PeriodDt getPeriod() { if (myPeriod == null) { myPeriod = new PeriodDt(); } return myPeriod; }
&& DateUtil.stripTime(encounter.getPeriod().getStart()).after(DateUtil.today())) { return Constants.TX_NO_FUT;
@Override public void buildQuery(EncounterSearchCriteria criteria, IQuery<Bundle> query) { super.buildQuery(criteria, query); if (criteria.getPatient() != null) { query.where(Encounter.PATIENT.hasId(criteria.getPatient().getId())); } if (criteria.getPeriod() != null) { Date start = criteria.getPeriod().getStart(); Date end = criteria.getPeriod().getEnd(); if (start != null) { if (end == null) { query.where(Encounter.LOCATION_PERIOD.exactly().day(start)); } else { query.where(Encounter.LOCATION_PERIOD.afterOrEquals().day(start)); query.where(Encounter.LOCATION_PERIOD.beforeOrEquals().day(end)); } } else if (end != null) { query.where(Encounter.LOCATION_PERIOD.exactly().day(end)); } } if (criteria.getType() != null) { query.where(Encounter.TYPE.exactly().code(criteria.getType())); } }
/** * Creates a period object from a start and end date. * * @param startDate The starting date. * @param endDate The ending date. * @return A period object, or null if both dates are null. */ public static PeriodDt createPeriod(Date startDate, Date endDate) { PeriodDt period = null; if (startDate != null) { period = new PeriodDt(); period.setStart(new DateTimeDt(startDate)); } if (endDate != null) { (period == null ? period = new PeriodDt() : period).setEnd(new DateTimeDt(endDate)); } return period; }
public static Encounter create(Patient patient, Date date, Location location, String sc) { Encounter encounter = new Encounter(); ResourceReferenceDt pat = new ResourceReferenceDt(patient); encounter.setPatient(pat); PeriodDt period = new PeriodDt(); period.setStart(new DateTimeDt(date)); encounter.setPeriod(period); ResourceReferenceDt loc = new ResourceReferenceDt(location); Encounter.Location encloc = encounter.addLocation(); encloc.setPeriod(period); encloc.setLocation(loc); CodeableConceptDt type = encounter.addType(); CodeableConceptDt cat = getServiceCategory(sc); type.setText(cat.getText()); type.setCoding(cat.getCoding()); return encounter; }
@SuppressWarnings("unused") public void nonNull() { // START SNIPPET: nonNull Observation observation = new Observation(); // None of these calls will not return null, but instead create their // respective // child elements. List<IdentifierDt> identifierList = observation.getIdentifier(); CodeableConceptDt code = observation.getCode(); StringDt textElement = observation.getCode().getTextElement(); // DateTimeDt is a FHIR primitive however, so the following will return // null // unless a value has been placed there. Date active = observation.addIdentifier().getPeriod().getStartElement().getValue(); // END SNIPPET: nonNull }
/** * Encode an encounter to a visit string. * * @param encounter The encounter. * @return The encoded encounter (visit string). */ public static String encode(Encounter encounter) { Location location = ClientUtil.getResource(encounter.getLocationFirstRep().getLocation(), Location.class); String locIEN = location.isEmpty() ? "" : location.getId().getIdPart(); Date date = encounter.getPeriod().getStart(); String sc = getServiceCategory(encounter); String ien = encounter.getId().isEmpty() ? "" : encounter.getId().getIdPart(); return locIEN + VSTR_DELIM + new FMDate(date).getFMDate() + VSTR_DELIM + sc + VSTR_DELIM + ien; }
/** * Gets the value(s) for <b>start</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The start of the period. The boundary is inclusive. * </p> */ public Date getStart() { return getStartElement().getValue(); }
/** * Gets the value(s) for <b>period</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * The period during which this contact person or organization is valid to be contacted relating to this patient * </p> */ public PeriodDt getPeriod() { if (myPeriod == null) { myPeriod = new PeriodDt(); } return myPeriod; }
public void onClick$btnSave() { if (validateInputs()) { if (record.getVisitIEN() == null) { Encounter encounter = EncounterContext.getActiveEncounter(); EncounterUtil.forceCreate(encounter); record.setVisitCategory(EncounterUtil.getServiceCategory(encounter)); record.setVisitDate(encounter.getPeriod().getStart()); record.setVisitIEN(encounter.getId().getIdPart()); record.setVisitLocked(EncounterUtil.isLocked(encounter)); } try { service.update(record); } catch (Exception e) { PromptDialog.showError(e.getMessage()); return; } root.setAttribute(ATTR_RESULT, record); root.detach(); } }
/** * Gets the value(s) for <b>period</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * The period of time for which payments have been gathered into this bulk payment for settlement. * </p> */ public PeriodDt getPeriod() { if (myPeriod == null) { myPeriod = new PeriodDt(); } return myPeriod; }
/** * Loads form data from the current problem. */ private void loadForm() { if (test != null) { setEventType(test.getEventType()); radRefusal.setDisabled(!radRefusal.isChecked()); radHistorical.setDisabled(!radHistorical.isChecked()); radCurrent.setDisabled(!radCurrent.isChecked()); datEvent.setValue(test.getDate()); ZKUtil.disableChildren(fraHistorical, true); datEvent.setDisabled(true); int reading = NumberUtils.toInt(test.getReading(), -1); spnReading.setValue(reading < 0 ? null : reading); } else { onClick$btnSkinTest(); if (txtSkinTest.getValue().isEmpty()) { close(true); return; } setEventType(EventType.CURRENT); Encounter visit = EncounterContext.getActiveEncounter(); Date date = visit == null ? null : visit.getPeriod().getStart(); datEvent.setValue(DateUtil.stripTime(date == null ? new Date() : date)); } }
/** * Gets the value(s) for <b>period</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * Time period when the contact point was/is in use * </p> */ public PeriodDt getPeriod() { if (myPeriod == null) { myPeriod = new PeriodDt(); } return myPeriod; }
private void refreshForm() { modified = false; noValidate = true; tbar.setVisible(encounter != null); panelchildren.setVisible(encounter != null); if (encounter == null) { return; } imgLocked.setVisible(encounter != null && encounter.getStatusElement().getValueAsEnum() == EncounterStateEnum.FINISHED); btnNew.setDisabled(!imgLocked.isVisible()); btnCancel.setDisabled(btnNew.isDisabled()); btnOK.setDisabled(false); lastDateTime = lastDateTime != null ? lastDateTime : useEncounterDate ? encounter.getPeriod().getStart() : new FMDate(); loadGrid(); val = getValue(colIndex, rowIndex); moveTo(rangeCol - 1, 1); }
/** * Gets the value(s) for <b>period</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * The period that the member was in the group, if known * </p> */ public PeriodDt getPeriod() { if (myPeriod == null) { myPeriod = new PeriodDt(); } return myPeriod; }
@Override public void renderItem(Listitem item, Object data) { Encounter encounter = data instanceof Encounter ? (Encounter) data : parse((String) data); item.setValue(encounter); item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), null); Span span = new Span(); span.setSclass(EncounterUtil.isLocked(encounter) ? Constants.SCLASS_LOCKED : null); createCell(item, span); Location location = ClientUtil.getResource(encounter.getLocationFirstRep().getLocation(), Location.class); createCell(item, location == null ? null : location.getName()); createCell(item, encounter.getPeriod().getStart()); createCell(item, encounter.getTypeFirstRep().getCodingFirstRep().getDisplay()); }
/** * Gets the value(s) for <b>period</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * The period of time this practitioner is performing some role within the episode of care * </p> */ public PeriodDt getPeriod() { if (myPeriod == null) { myPeriod = new PeriodDt(); } return myPeriod; }
/** * Gets the value(s) for <b>during</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * Service is not available (seasonally or for a public holiday) from this date * </p> */ public PeriodDt getDuring() { if (myDuring == null) { myDuring = new PeriodDt(); } return myDuring; }