/** * Add a new CodeSystem resource which will be available to the validator. Note that * {@link CodeSystem#getUrl() the URL field) in this resource must contain a value as this * value will be used as the logical URL. * <p> * Note that if the URL is a canonical FHIR URL (e.g. http://hl7.org/StructureDefinition/Extension), * it will be stored in three ways: * <ul> * <li>Extension</li> * <li>StructureDefinition/Extension</li> * <li>http://hl7.org/StructureDefinition/Extension</li> * </ul> * </p> */ public void addCodeSystem(CodeSystem theCodeSystem) { Validate.notBlank(theCodeSystem.getUrl(), "theCodeSystem.getUrl() must not return a value"); addToMap(theCodeSystem, myCodeSystems, theCodeSystem.getUrl()); }
@Override protected void preDelete(CodeSystem theResourceToDelete, ResourceTable theEntityToDelete) { super.preDelete(theResourceToDelete, theEntityToDelete); String codeSystemUrl = theResourceToDelete.getUrl(); if (isNotBlank(codeSystemUrl)) { TermCodeSystem persCs = myCsDao.findByCodeSystemUri(codeSystemUrl); if (persCs != null) { myTerminologySvc.deleteCodeSystem(persCs); } } }
if (theClass.isAssignableFrom(next.getValue().getClass())) { CodeSystem sd = ((CodeSystem) next.getValue()); if (sd.getUrl().equals(theUri)) { return (T) sd;
CodeSystem nextValueSet = (CodeSystem) next.getResource(); nextValueSet.getText().setDivAsString(""); String system = nextValueSet.getUrl(); if (isNotBlank(system)) { theCodeSystems.put(system, nextValueSet);
@Override protected ResourceTable updateEntity(RequestDetails theRequest, IBaseResource theResource, ResourceTable theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, boolean theUpdateVersion, Date theUpdateTime, boolean theForceUpdate, boolean theCreateNewHistoryEntry) { ResourceTable retVal = super.updateEntity(theRequest, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theUpdateTime, theForceUpdate, theCreateNewHistoryEntry); CodeSystem cs = (CodeSystem) theResource; if (cs != null && isNotBlank(cs.getUrl())) { String codeSystemUrl = cs.getUrl(); Long codeSystemResourcePid = retVal.getId(); if (retVal.getDeleted() != null) { // deleting } else if (cs.getContent() == CodeSystemContentMode.COMPLETE || cs.getContent() == null) { ourLog.info("CodeSystem {} has a status of {}, going to store concepts in terminology tables", retVal.getIdDt().getValue(), cs.getContentElement().getValueAsString()); TermCodeSystemVersion persCs = new TermCodeSystemVersion(); persCs.setResource(retVal); persCs.getConcepts().addAll(toPersistedConcepts(cs.getConcept(), persCs)); ourLog.info("Code system has {} concepts", persCs.getConcepts().size()); myTerminologySvc.storeNewCodeSystemVersion(codeSystemResourcePid, codeSystemUrl, cs.getName(), persCs); } } return retVal; }
if (theResource instanceof CodeSystem) { CodeSystem cs = (CodeSystem) theResource; useSystem = cs.getUrl();
public org.hl7.fhir.instance.model.ValueSet.ValueSetCodeSystemComponent convertCodeSystem(org.hl7.fhir.dstu3.model.CodeSystem src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.ValueSet.ValueSetCodeSystemComponent tgt = new org.hl7.fhir.instance.model.ValueSet.ValueSetCodeSystemComponent(); copyElement(src, tgt); tgt.setSystem(src.getUrl()); tgt.setVersion(src.getVersion()); tgt.setCaseSensitive(src.getCaseSensitive()); for (ConceptDefinitionComponent cc : src.getConcept()) tgt.addConcept(convertCodeSystemConcept(src, cc)); return tgt; }
/** * Add a new CodeSystem resource which will be available to the validator. Note that * {@link CodeSystem#getUrl() the URL field) in this resource must contain a value as this * value will be used as the logical URL. * <p> * Note that if the URL is a canonical FHIR URL (e.g. http://hl7.org/StructureDefinition/Extension), * it will be stored in three ways: * <ul> * <li>Extension</li> * <li>StructureDefinition/Extension</li> * <li>http://hl7.org/StructureDefinition/Extension</li> * </ul> * </p> */ public void addCodeSystem(CodeSystem theCodeSystem) { Validate.notBlank(theCodeSystem.getUrl(), "theCodeSystem.getUrl() must not return a value"); addToMap(theCodeSystem, myCodeSystems, theCodeSystem.getUrl()); }
@Override protected void preDelete(CodeSystem theResourceToDelete, ResourceTable theEntityToDelete) { super.preDelete(theResourceToDelete, theEntityToDelete); String codeSystemUrl = theResourceToDelete.getUrl(); if (isNotBlank(codeSystemUrl)) { TermCodeSystem persCs = myCsDao.findByCodeSystemUri(codeSystemUrl); if (persCs != null) { myTerminologySvc.deleteCodeSystem(persCs); } } }
private String getCodeDisplay(CodeSystem cs, String code) throws TerminologyServiceException { ConceptDefinitionComponent def = getConceptForCode(cs.getConcept(), code); if (def == null) throw new TerminologyServiceException("Unable to find code '" + code + "' in code system " + cs.getUrl()); return def.getDisplay(); }
srcCS = advisor.getCodeSystem(src); if (srcCS != null) { tgt.getCodeSystem().setSystem(srcCS.getUrl()); tgt.getCodeSystem().setVersion(srcCS.getVersion()); tgt.getCodeSystem().setCaseSensitive(srcCS.getCaseSensitive()); tgt.setCompose(convertValueSetComposeComponent(src.getCompose(), srcCS == null ? null : srcCS.getUrl())); tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); return tgt;
CodeSystem nextValueSet = (CodeSystem) next.getResource(); nextValueSet.getText().setDivAsString(""); String system = nextValueSet.getUrl(); if (isNotBlank(system)) { theCodeSystems.put(system, nextValueSet);
@Override protected ResourceTable updateEntity(RequestDetails theRequest, IBaseResource theResource, ResourceTable theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, boolean theUpdateVersion, Date theUpdateTime, boolean theForceUpdate, boolean theCreateNewHistoryEntry) { ResourceTable retVal = super.updateEntity(theRequest, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theUpdateTime, theForceUpdate, theCreateNewHistoryEntry); CodeSystem cs = (CodeSystem) theResource; if (cs != null && isNotBlank(cs.getUrl())) { String codeSystemUrl = cs.getUrl(); Long codeSystemResourcePid = retVal.getId(); if (retVal.getDeleted() != null) { // deleting } else if (cs.getContent() == CodeSystemContentMode.COMPLETE || cs.getContent() == null) { ourLog.info("CodeSystem {} has a status of {}, going to store concepts in terminology tables", retVal.getIdDt().getValue(), cs.getContentElement().getValueAsString()); TermCodeSystemVersion persCs = new TermCodeSystemVersion(); persCs.setResource(retVal); persCs.getConcepts().addAll(toPersistedConcepts(cs.getConcept(), persCs)); ourLog.info("Code system has {} concepts", persCs.getConcepts().size()); myTerminologySvc.storeNewCodeSystemVersion(codeSystemResourcePid, codeSystemUrl, cs.getName(), persCs); } } return retVal; }
copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); tgt.setIdentifier(convertIdentifier(src.getIdentifier())); if (src.hasVersion())
public org.hl7.fhir.instance.model.ValueSet.ValueSetCodeSystemComponent convertCodeSystem(org.hl7.fhir.dstu3.model.CodeSystem src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.ValueSet.ValueSetCodeSystemComponent tgt = new org.hl7.fhir.instance.model.ValueSet.ValueSetCodeSystemComponent(); copyElement(src, tgt); tgt.setSystem(src.getUrl()); tgt.setVersion(src.getVersion()); tgt.setCaseSensitive(src.getCaseSensitive()); for (ConceptDefinitionComponent cc : src.getConcept()) tgt.addConcept(convertCodeSystemConcept(src, cc)); return tgt; }
advisor.handleCodeSystem(tgtcs, tgt); tgt.setUserData("r2-cs", tgtcs); tgt.getCompose().addInclude().setSystem(tgtcs.getUrl());
srcCS = advisor.getCodeSystem(src); if (srcCS != null) { tgt.getCodeSystem().setSystem(srcCS.getUrl()); tgt.getCodeSystem().setVersion(srcCS.getVersion()); tgt.getCodeSystem().setCaseSensitive(srcCS.getCaseSensitive()); tgt.setCompose(convertValueSetComposeComponent(src.getCompose(), srcCS == null ? null : srcCS.getUrl())); tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); return tgt;
copyDomainResource(src, tgt); if (src.hasUrl()) tgt.setUrl(src.getUrl()); tgt.setIdentifier(convertIdentifier(src.getIdentifier())); if (src.hasVersion())