public org.hl7.fhir.instance.model.Meta convertMeta(org.hl7.fhir.dstu3.model.Meta src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Meta tgt = new org.hl7.fhir.instance.model.Meta(); copyElement(src, tgt); tgt.setVersionId(src.getVersionId()); tgt.setLastUpdated(src.getLastUpdated()); for (org.hl7.fhir.dstu3.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue()); for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurity()) tgt.addSecurity(convertCoding(t)); for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(convertCoding(t)); return tgt; }
public static org.hl7.fhir.dstu2016may.model.Meta convertMeta(org.hl7.fhir.dstu3.model.Meta src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Meta tgt = new org.hl7.fhir.dstu2016may.model.Meta(); copyElement(src, tgt); if (src.hasVersionId()) tgt.setVersionId(src.getVersionId()); if (src.hasLastUpdated()) tgt.setLastUpdated(src.getLastUpdated()); for (org.hl7.fhir.dstu3.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue()); for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurity()) tgt.addSecurity(convertCoding(t)); for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(convertCoding(t)); return tgt; }
/** * @param object bundle * @return true if one of the {@link #profileUris} are present in the Bundle's meta.profile */ @Override public boolean test(Object object) { Bundle bundle = (Bundle) object; boolean result = bundle.getMeta().getProfile().stream() .map(UriType::getValueAsString) .anyMatch(profileUris::contains); return result; } }
public static ValueSet makeShareable(ValueSet vs) { if (!vs.hasMeta()) vs.setMeta(new Meta()); for (UriType t : vs.getMeta().getProfile()) if (t.getValue().equals("http://hl7.org/fhir/StructureDefinition/valueset-shareable-definition")) return vs; vs.getMeta().getProfile().add(new UriType("http://hl7.org/fhir/StructureDefinition/valueset-shareable-definition")); return vs; }
public static void checkShareable(ValueSet vs) { if (!vs.hasMeta()) throw new Error("ValueSet "+vs.getUrl()+" is not shareable"); for (UriType t : vs.getMeta().getProfile()) { if (t.getValue().equals("http://hl7.org/fhir/StructureDefinition/valueset-shareable-definition")) return; } throw new Error("ValueSet "+vs.getUrl()+" is not shareable"); }
public static CodeSystem makeShareable(CodeSystem cs) { if (!cs.hasMeta()) cs.setMeta(new Meta()); for (UriType t : cs.getMeta().getProfile()) if (t.getValue().equals("http://hl7.org/fhir/StructureDefinition/shareablecodesystem")) return cs; cs.getMeta().getProfile().add(new UriType("http://hl7.org/fhir/StructureDefinition/shareablecodesystem")); return cs; }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("versionId")) { this.versionId = castToId(value); // IdType } else if (name.equals("lastUpdated")) { this.lastUpdated = castToInstant(value); // InstantType } else if (name.equals("profile")) { this.getProfile().add(castToUri(value)); } else if (name.equals("security")) { this.getSecurity().add(castToCoding(value)); } else if (name.equals("tag")) { this.getTag().add(castToCoding(value)); } else return super.setProperty(name, value); return value; }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case -1407102957: // versionId this.versionId = castToId(value); // IdType return value; case 1649733957: // lastUpdated this.lastUpdated = castToInstant(value); // InstantType return value; case -309425751: // profile this.getProfile().add(castToUri(value)); // UriType return value; case 949122880: // security this.getSecurity().add(castToCoding(value)); // Coding return value; case 114586: // tag this.getTag().add(castToCoding(value)); // Coding return value; default: return super.setProperty(hash, name, value); } }
/** * Validates bundle type, meta data and consistency of contained resources * * @param bundle transaction bundle */ protected void validateTransactionBundle(Bundle bundle) { if (!Bundle.BundleType.TRANSACTION.equals(bundle.getType())) { throw FhirUtils.unprocessableEntity( OperationOutcome.IssueSeverity.ERROR, OperationOutcome.IssueType.INVALID, null, null, "Bundle type must be %s, but was %s", Bundle.BundleType.TRANSACTION.toCode(), bundle.getType().toCode()); } List<UriType> profiles = bundle.getMeta().getProfile(); if (profiles.isEmpty() || !Iti65Constants.ITI65_PROFILE.equals(profiles.get(0).getValue())) { throw FhirUtils.unprocessableEntity( OperationOutcome.IssueSeverity.ERROR, OperationOutcome.IssueType.INVALID, null, null, "Request bundle must have profile", Iti65Constants.ITI65_PROFILE); } }
public org.hl7.fhir.instance.model.Meta convertMeta(org.hl7.fhir.dstu3.model.Meta src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Meta tgt = new org.hl7.fhir.instance.model.Meta(); copyElement(src, tgt); tgt.setVersionId(src.getVersionId()); tgt.setLastUpdated(src.getLastUpdated()); for (org.hl7.fhir.dstu3.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue()); for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurity()) tgt.addSecurity(convertCoding(t)); for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(convertCoding(t)); return tgt; }
public static org.hl7.fhir.dstu2016may.model.Meta convertMeta(org.hl7.fhir.dstu3.model.Meta src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Meta tgt = new org.hl7.fhir.dstu2016may.model.Meta(); copyElement(src, tgt); if (src.hasVersionId()) tgt.setVersionId(src.getVersionId()); if (src.hasLastUpdated()) tgt.setLastUpdated(src.getLastUpdated()); for (org.hl7.fhir.dstu3.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue()); for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurity()) tgt.addSecurity(convertCoding(t)); for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(convertCoding(t)); return tgt; }