@Override public String getStatusAsString() { return getStatus().getValueAsString(); }
if (!needContactPointSystem.equals(nextValue.getSystemElement().getValueAsString())) { continue; systems.add(nextValue.getSystemElement().getValueAsString()); codes.add(nextValue.getValueElement().getValue()); } else if (nextObject instanceof BoundCodeDt) {
systemValue = param.getSystemElement().getValueAsString(); unitsValue = param.getUnitsElement().getValueAsString(); cmpValue = ParamPrefixEnum.forValue(param.getComparatorElement().getValueAsString()); valueValue = param.getValueElement().getValue(); } else if (theParam instanceof QuantityParam) {
private void verifyStatusOk(RestOperationTypeEnum theOperation, IBaseResource theOldResourceOrNull, IBaseResource theResource) { Subscription subscription = (Subscription) theResource; SubscriptionStatusEnum newStatus = subscription.getStatusElement().getValueAsEnum(); if (newStatus == SubscriptionStatusEnum.REQUESTED || newStatus == SubscriptionStatusEnum.OFF) { return; } if (newStatus == null) { String actualCode = subscription.getStatusElement().getValueAsString(); throw new UnprocessableEntityException("Can not " + theOperation.getCode() + " resource: Subscription.status must be populated on this server" + ((isNotBlank(actualCode)) ? " (invalid value " + actualCode + ")" : "")); } if (theOldResourceOrNull != null) { try { Subscription existing = (Subscription) theOldResourceOrNull; SubscriptionStatusEnum existingStatus = existing.getStatusElement().getValueAsEnum(); if (existingStatus != newStatus) { verifyActiveStatus(theOperation, subscription, newStatus, existingStatus); } } catch (ResourceNotFoundException e) { verifyActiveStatus(theOperation, subscription, newStatus, null); } } else { verifyActiveStatus(theOperation, subscription, newStatus, null); } }
@SuppressWarnings("unused") public static void codes() { // START SNIPPET: codes Patient patient = new Patient(); // You can set this code using a String if you want. Note that // for "closed" valuesets (such as the one used for Patient.gender) // you must use one of the strings defined by the FHIR specification. // You must not define your own. patient.getGenderElement().setValue("male"); // HAPI also provides Java enumerated types which make it easier to // deal with coded values. This code achieves the exact same result // as the code above. patient.setGender(AdministrativeGenderEnum.MALE); // You can also retrieve coded values the same way String genderString = patient.getGenderElement().getValueAsString(); AdministrativeGenderEnum genderEnum = patient.getGenderElement().getValueAsEnum(); // The following is a shortcut to create patient.setMaritalStatus(MaritalStatusCodesEnum.M); // END SNIPPET: codes }
Long count = counts.get(nextResource.getTypeElement().getValueAsString()); if (count != null) { nextResource.addUndeclaredExtension(false, ExtensionConstants.CONF_RESOURCE_COUNT, new DecimalDt(count));
@Override public String getStatusAsString() { return getStatus().getValueAsString(); }
@Override public Map<String, String> getDetail() { Map<String, String> details = new HashMap<String, String>(); details.put("startDate", myEncounter.getPeriod().getStart().getValueAsString()); details.put("endDate", myEncounter.getPeriod().getEnd().getValueAsString()); details.put("service", myEncounter.getServiceProvider().getDisplay().getValue()); details.put("type", myEncounter.getTypeFirstRep().getText().getValue()); details.put("status", myEncounter.getStatus().getValueAsString()); details.put("subject", myEncounter.getSubject().getReference().getValue()); return details; }
systemValue = param.getSystemElement().getValueAsString(); unitsValue = param.getUnitsElement().getValueAsString(); cmpValue = ParamPrefixEnum.forValue(param.getComparatorElement().getValueAsString()); valueValue = param.getValueElement().getValue(); } else if (theParam instanceof QuantityParam) {
private void verifyStatusOk(RestOperationTypeEnum theOperation, IBaseResource theOldResourceOrNull, IBaseResource theResource) { Subscription subscription = (Subscription) theResource; SubscriptionStatusEnum newStatus = subscription.getStatusElement().getValueAsEnum(); if (newStatus == SubscriptionStatusEnum.REQUESTED || newStatus == SubscriptionStatusEnum.OFF) { return; } if (newStatus == null) { String actualCode = subscription.getStatusElement().getValueAsString(); throw new UnprocessableEntityException("Can not " + theOperation.getCode() + " resource: Subscription.status must be populated on this server" + ((isNotBlank(actualCode)) ? " (invalid value " + actualCode + ")" : "")); } if (theOldResourceOrNull != null) { try { Subscription existing = (Subscription) theOldResourceOrNull; SubscriptionStatusEnum existingStatus = existing.getStatusElement().getValueAsEnum(); if (existingStatus != newStatus) { verifyActiveStatus(theOperation, subscription, newStatus, existingStatus); } } catch (ResourceNotFoundException e) { verifyActiveStatus(theOperation, subscription, newStatus, null); } } else { verifyActiveStatus(theOperation, subscription, newStatus, null); } }
@Override public String getDescription() { if(myEncounter != null){ String type = myEncounter.getTypeFirstRep().getText().getValue(); String status = myEncounter.getStatus().getValueAsString(); String startDate = myEncounter.getPeriod().getStart().getValueAsString(); String endDate = myEncounter.getPeriod().getEnd().getValueAsString(); return "Encounter: " + type + ": " + status +", "+ startDate + " - " + endDate; } return null; }
Long count = counts.get(nextResource.getTypeElement().getValueAsString()); if (count != null) { nextResource.addUndeclaredExtension(false, ExtensionConstants.CONF_RESOURCE_COUNT, new DecimalDt(count));