if (!oldId.equals(newRes.getIdElement()) && newRes instanceof IResource) { ((IResource) newRes).getResourceMetadata().put(ResourceMetadataKeyEnum.PREVIOUS_ID, oldId);
private static void handleTransactionCreateOrUpdateOutcome(Map<IdDt, IdDt> idSubstitutions, Map<IdDt, DaoMethodOutcome> idToPersistedOutcome, IdDt nextResourceId, DaoMethodOutcome outcome, Entry newEntry, String theResourceType, IResource theRes) { IdDt newId = (IdDt) outcome.getId().toUnqualifiedVersionless(); IdDt resourceId = isPlaceholder(nextResourceId) ? nextResourceId : nextResourceId.toUnqualifiedVersionless(); if (newId.equals(resourceId) == false) { idSubstitutions.put(resourceId, newId); if (isPlaceholder(resourceId)) { /* * The correct way for substitution IDs to be is to be with no resource type, but we'll accept the qualified kind too just to be lenient. */ idSubstitutions.put(new IdDt(theResourceType + '/' + resourceId.getValue()), newId); } } idToPersistedOutcome.put(newId, outcome); if (outcome.getCreated().booleanValue()) { newEntry.getResponse().setStatus(toStatusString(Constants.STATUS_HTTP_201_CREATED)); } else { newEntry.getResponse().setStatus(toStatusString(Constants.STATUS_HTTP_200_OK)); } newEntry.getResponse().setLastModified(ResourceMetadataKeyEnum.UPDATED.get(theRes)); }
continue; if (replacement.equals(next)) { continue;
/** * Performs an equality check on two resources using their id's. * * @param res1 The first resource. * @param res2 The second resource. * @return True if the two resources have equal id's. */ public static <T extends IResource> boolean areEqual(T res1, T res2) { if (res1 == null || res2 == null) { return false; } return res1 == res2 || res1.getId().equals(res2.getId()); }
@Override public int compare(Participant p1, Participant p2) { if (p1.getIndividual().getReference().equals(p2.getIndividual().getReference())) { return 0; } String n1 = FhirUtil.formatName(EncounterUtil.getName(p1)); String n2 = FhirUtil.formatName(EncounterUtil.getName(p2)); int i = n1.compareToIgnoreCase(n2); return i == 0 ? 1 : i; }
if (!oldId.equals(newRes.getIdElement()) && newRes instanceof IResource) { ((IResource) newRes).getResourceMetadata().put(ResourceMetadataKeyEnum.PREVIOUS_ID, oldId);
private static void handleTransactionCreateOrUpdateOutcome(Map<IdDt, IdDt> idSubstitutions, Map<IdDt, DaoMethodOutcome> idToPersistedOutcome, IdDt nextResourceId, DaoMethodOutcome outcome, Entry newEntry, String theResourceType, IResource theRes) { IdDt newId = (IdDt) outcome.getId().toUnqualifiedVersionless(); IdDt resourceId = isPlaceholder(nextResourceId) ? nextResourceId : nextResourceId.toUnqualifiedVersionless(); if (newId.equals(resourceId) == false) { idSubstitutions.put(resourceId, newId); if (isPlaceholder(resourceId)) { /* * The correct way for substitution IDs to be is to be with no resource type, but we'll accept the qualified kind too just to be lenient. */ idSubstitutions.put(new IdDt(theResourceType + '/' + resourceId.getValue()), newId); } } idToPersistedOutcome.put(newId, outcome); if (outcome.getCreated().booleanValue()) { newEntry.getResponse().setStatus(toStatusString(Constants.STATUS_HTTP_201_CREATED)); } else { newEntry.getResponse().setStatus(toStatusString(Constants.STATUS_HTTP_200_OK)); } newEntry.getResponse().setLastModified(ResourceMetadataKeyEnum.UPDATED.get(theRes)); }
continue; if (replacement.equals(next)) { continue;