private void verifyStatusOk(RestOperationTypeEnum theOperation, IBaseResource theOldResourceOrNull, IBaseResource theResource) { Subscription subscription = (Subscription) theResource; SubscriptionStatus newStatus = subscription.getStatusElement().getValue(); if (newStatus == SubscriptionStatus.REQUESTED || newStatus == SubscriptionStatus.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; SubscriptionStatus existingStatus = existing.getStatusElement().getValue(); 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 getBundleType(Bundle theRequest) { if (theRequest.getType() == null) { return null; } return theRequest.getTypeElement().getValue().toCode(); }
@Override public String getEntryRequestVerb(Bundle.BundleEntryComponent theEntry) { String retVal = null; Bundle.HTTPVerb value = theEntry.getRequest().getMethodElement().getValue(); if (value != null) { retVal = value.toCode(); } return retVal; }
/** * @return causality1 | causality2. */ public AdverseEventCausality getCausality() { return this.causality == null ? null : this.causality.getValue(); }
/** * @return Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. */ public AddressType getType() { return this.type == null ? null : this.type.getValue(); }
/** * @return Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. */ public AllergyIntoleranceSeverity getSeverity() { return this.severity == null ? null : this.severity.getValue(); }
private void verifyActiveStatus(RestOperationTypeEnum theOperation, Subscription theSubscription, SubscriptionStatus newStatus, SubscriptionStatus theExistingStatus) { SubscriptionChannelType channelType = theSubscription.getChannel().getTypeElement().getValue(); if (channelType == null) { throw new UnprocessableEntityException("Subscription.channel.type must be populated"); } if (channelType == SubscriptionChannelType.WEBSOCKET) { return; } if (theExistingStatus != null) { throw new UnprocessableEntityException("Subscription.status can not be changed from " + describeStatus(theExistingStatus) + " to " + describeStatus(newStatus)); } if (theSubscription.getStatus() == null) { throw new UnprocessableEntityException("Can not " + theOperation.getCode().toLowerCase() + " resource: Subscription.status must be populated on this server"); } throw new UnprocessableEntityException("Subscription.status must be '" + SubscriptionStatus.OFF.toCode() + "' or '" + SubscriptionStatus.REQUESTED.toCode() + "' on a newly created subscription"); }
public org.hl7.fhir.instance.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.instance.model.Composition.CompositionAttesterComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> t : src.getMode()) tgt.addMode(convertCompositionAttestationMode(t.getValue())); tgt.setTime(src.getTime()); tgt.setParty(convertReference(src.getParty())); return tgt; }
public org.hl7.fhir.instance.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.instance.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.HealthcareService.DaysOfWeek> t : src.getDaysOfWeek()) tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue())); tgt.setAllDay(src.getAllDay()); tgt.setAvailableStartTime(src.getAvailableStartTime()); tgt.setAvailableEndTime(src.getAvailableEndTime()); return tgt; }
public org.hl7.fhir.instance.model.ElementDefinition.TypeRefComponent convertElementDefinitionTypeComponent(org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.ElementDefinition.TypeRefComponent tgt = new org.hl7.fhir.instance.model.ElementDefinition.TypeRefComponent(); copyElement(src, tgt); tgt.setCodeElement(convertUriToCode(src.getCodeElement())); if (src.hasCode() && "Reference".equals(src.getCode())) { if (src.hasTargetProfile()) tgt.addProfile(src.getTargetProfile()); } else if (src.hasProfile()) tgt.addProfile(src.getProfile()); for (org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode> t : src.getAggregation()) tgt.addAggregation(convertAggregationMode(t.getValue())); return tgt; }
public static org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent convertTypeRefComponent(org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent tgt = new org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent(); copyElement(src, tgt); tgt.setCode(src.getCode()); if (src.hasCode() && "Reference".equals(src.getCode())) tgt.addProfile(src.getTargetProfile()); else tgt.addProfile(src.getProfile()); for (org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode> t : src.getAggregation()) tgt.addAggregation(convertAggregationMode(t.getValue())); tgt.setVersioning(convertReferenceVersionRules(src.getVersioning())); return tgt; }
public static org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.dstu3.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemFilterComponent(); copyElement(src, tgt); tgt.setCode(src.getCode()); if (src.hasDescription()) tgt.setDescription(src.getDescription()); for (Enumeration<FilterOperator> t : src.getOperator()) tgt.addOperator(t.getValue().toCode()); tgt.setValue(src.getValue()); return tgt; }
boolean modeOk; for (Enumeration<AggregationMode> mode : type.getAggregation()) { if (mode.getValue().equals(AggregationMode.CONTAINED) && refType.equals("contained")) ok = true; else if (mode.getValue().equals(AggregationMode.BUNDLED) && refType.equals("bundled")) ok = true; else if (mode.getValue().equals(AggregationMode.REFERENCED) && (refType.equals("bundled")||refType.equals("remote"))) ok = true;
if (ei.definition!=null) for (Enumeration<PropertyRepresentation> r : ei.definition.getRepresentation()) { if (r.getValue() == PropertyRepresentation.XMLATTR) { isXmlAttr = true; break;
public org.hl7.fhir.instance.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.instance.model.Timing.TimingRepeatComponent(); copyElement(src, tgt); tgt.setBounds(convertType(src.getBounds())); tgt.setCount(src.getCount()); tgt.setDuration(src.getDuration()); tgt.setDurationMax(src.getDurationMax()); tgt.setDurationUnits(convertUnitsOfTime(src.getDurationUnit())); tgt.setFrequency(src.getFrequency()); tgt.setFrequencyMax(src.getFrequencyMax()); tgt.setPeriod(src.getPeriod()); tgt.setPeriodMax(src.getPeriodMax()); tgt.setPeriodUnits(convertUnitsOfTime(src.getPeriodUnit())); for (Enumeration<EventTiming> t : src.getWhen()) tgt.setWhen(convertEventTiming(t.getValue())); return tgt; }
public static org.hl7.fhir.dstu2016may.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.dstu2016may.model.Timing.TimingRepeatComponent(); copyElement(src, tgt); tgt.setBounds(convertType(src.getBounds())); if (src.hasCount()) tgt.setCount(src.getCount()); if (src.hasCountMax()) tgt.setCountMax(src.getCountMax()); if (src.hasDuration()) tgt.setDuration(src.getDuration()); if (src.hasDurationMax()) tgt.setDurationMax(src.getDurationMax()); tgt.setDurationUnit(convertUnitsOfTime(src.getDurationUnit())); if (src.hasFrequency()) tgt.setFrequency(src.getFrequency()); if (src.hasFrequencyMax()) tgt.setFrequencyMax(src.getFrequencyMax()); if (src.hasPeriod()) tgt.setPeriod(src.getPeriod()); if (src.hasPeriodMax()) tgt.setPeriodMax(src.getPeriodMax()); tgt.setPeriodUnit(convertUnitsOfTime(src.getPeriodUnit())); for (Enumeration<EventTiming> t : src.getWhen()) tgt.setWhen(convertEventTiming(t.getValue())); if (src.hasOffset()) tgt.setOffset(src.getOffset()); return tgt; }
tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> t : src.getRepresentation()) tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); if (src.hasSliceName()) tgt.setName(src.getSliceName());
tgt.setPath(src.getPath()); for (org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> t : src.getRepresentation()) tgt.addRepresentation(convertPropertyRepresentation(t.getValue())); if (src.hasSliceName()) tgt.setName(src.getSliceName());