Java Code Examples for org.hl7.fhir.r4.model.CodeSystem#setStatus()

The following examples show how to use org.hl7.fhir.r4.model.CodeSystem#setStatus() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ICD11Generator.java    From org.hl7.fhir.core with Apache License 2.0 6 votes vote down vote up
private CodeSystem makeMMSCodeSystem() {
  CodeSystem cs = new CodeSystem();
  cs.setId("icd11-mms");
  cs.setUrl("http://id.who.int/icd11/mms");
  cs.setName("ICD11MMS");
  cs.setTitle("ICD-11 MMS Linearization");
  cs.setStatus(PublicationStatus.ACTIVE);
  cs.setExperimental(false);
  cs.setDate(new Date());
  cs.setPublisher("WHO");
  cs.setCopyright("Consult WHO For terms of use");
  cs.setCaseSensitive(true);
  cs.setHierarchyMeaning(CodeSystemHierarchyMeaning.CLASSIFIEDWITH);
  cs.setCompositional(true);
  cs.setVersionNeeded(true);
  cs.setValueSet("http://id.who.int/icd11/ValueSet/all-MMS");
  cs.setContent(CodeSystemContentMode.COMPLETE);
  CodeSystemUtilities.defineCodeSystemProperty(cs, "kind", "The kind of artifact this concept represents", PropertyType.CODE).setUri("http://id.who.int/icd11/properties#kind");
  CodeSystemUtilities.defineCodeSystemProperty(cs, "terms", "Other keywords for searching", PropertyType.STRING).setUri("http://id.who.int/icd11/properties#terms");
  CodeSystemUtilities.defineCodeSystemProperty(cs, "codingNote", "Coding advice for this concept", PropertyType.STRING).setUri("http://id.who.int/icd11/properties#codingNote");
  CodeSystemUtilities.defineCodeSystemProperty(cs, "exclusion", "References to diseases that are excluded from this concept", PropertyType.CODING).setUri("http://id.who.int/icd11/properties#exclusion");
  CodeSystemUtilities.defineCodeSystemProperty(cs, "abstract", "If concept is abstract", PropertyType.BOOLEAN);
  CodeSystemUtilities.defineCodeSystemProperty(cs, "postcoordinationScale", "", PropertyType.CODE).setUri("http://id.who.int/icd11/properties#postcoordinationScale");
  return cs;
}
 
Example 2
Source File: ICD11Generator.java    From org.hl7.fhir.core with Apache License 2.0 6 votes vote down vote up
private CodeSystem makeEntityCodeSystem() {
    CodeSystem cs = new CodeSystem();
    cs.setId("icd11-foundation");
    cs.setUrl("http://id.who.int/icd11/foundation");
    cs.setName("ICD11Entity");
    cs.setTitle("ICD-11 Entities (Foundation)");
    cs.setStatus(PublicationStatus.ACTIVE);
    cs.setExperimental(false);
    cs.setDate(new Date());
    cs.setPublisher("WHO");
    cs.setCopyright("Consult WHO For terms of use");
    cs.setCaseSensitive(true);
    cs.setHierarchyMeaning(CodeSystemHierarchyMeaning.ISA); // though we aren't going to have a heirarchy
//    cs.setCompositional(true);
//    cs.setVersionNeeded(true);
    cs.setValueSet("http://id.who.int/icd11/ValueSet/all-foundation");
    cs.setContent(CodeSystemContentMode.COMPLETE);
    CodeSystemUtilities.defineCodeSystemProperty(cs, "exclusion", "References to diseases that are excluded from this concept", PropertyType.CODING).setUri("http://id.who.int/icd11/properties#exclusion");
    CodeSystemUtilities.defineCodeSystemProperty(cs, "inclusion", "References to diseases that are included from this concept", PropertyType.CODING).setUri("http://id.who.int/icd11/properties#inclusion");
    CodeSystemUtilities.defineCodeSystemProperty(cs, "narrowerTerm", "Narrower terms for this entity", PropertyType.CODE).setUri("http://id.who.int/icd11/properties#narrowerTerm");
    CodeSystemUtilities.defineCodeSystemProperty(cs, "parent", "Parent for this concept", PropertyType.CODE);
    CodeSystemUtilities.defineCodeSystemProperty(cs, "child", "Child for this concept", PropertyType.CODE);
    return cs;
  }
 
Example 3
Source File: CodeSystemUtilities.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
public static void markStatus(CodeSystem cs, String wg, StandardsStatus status, String pckage, String fmm, String normativeVersion) throws FHIRException {
  if (wg != null) {
    if (!ToolingExtensions.hasExtension(cs, ToolingExtensions.EXT_WORKGROUP) || 
        (Utilities.existsInList(ToolingExtensions.readStringExtension(cs, ToolingExtensions.EXT_WORKGROUP), "fhir", "vocab") && !Utilities.existsInList(wg, "fhir", "vocab"))) {
      ToolingExtensions.setCodeExtension(cs, ToolingExtensions.EXT_WORKGROUP, wg);
    }
  }
  if (status != null) {
    StandardsStatus ss = ToolingExtensions.getStandardsStatus(cs);
    if (ss == null || ss.isLowerThan(status)) 
      ToolingExtensions.setStandardsStatus(cs, status, normativeVersion);
    if (pckage != null) {
      if (!cs.hasUserData("ballot.package"))
        cs.setUserData("ballot.package", pckage);
      else if (!pckage.equals(cs.getUserString("ballot.package")))
        if (!"infrastructure".equals(cs.getUserString("ballot.package")))
          System.out.println("Code System "+cs.getUrl()+": ownership clash "+pckage+" vs "+cs.getUserString("ballot.package"));
    }
    if (status == StandardsStatus.NORMATIVE) {
      cs.setExperimental(false);
      cs.setStatus(PublicationStatus.ACTIVE);
    }
  }
  if (fmm != null) {
    String sfmm = ToolingExtensions.readStringExtension(cs, ToolingExtensions.EXT_FMM_LEVEL);
    if (Utilities.noString(sfmm) || Integer.parseInt(sfmm) < Integer.parseInt(fmm)) 
      ToolingExtensions.setIntegerExtension(cs, ToolingExtensions.EXT_FMM_LEVEL, Integer.parseInt(fmm));
  }
}
 
Example 4
Source File: CountryCodesConverter.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
public void setMetadata(Document src, CodeSystem cs, String id, String url, String partName, String partTitle) {
  cs.setId(id);
  cs.setUrl(url);
  cs.setName("ISOCountryCodes"+partName);
  cs.setTitle("ISO Country Codes (ISO-3166)"+partTitle);
  cs.setVersion(XMLUtil.getFirstChild(src.getDocumentElement()).getAttribute("version"));
  cs.setStatus(PublicationStatus.ACTIVE);
  cs.setExperimental(false);
  cs.addContact().setName("FHIR Project Team").addTelecom().setSystem(ContactPointSystem.URL).setValue("http://hl7.org/fhir");
  cs.setDateElement(new DateTimeType(src.getDocumentElement().getAttribute("generated")));
  cs.setCopyright("Copyright ISO. See https://www.iso.org/obp/ui/#search/code/");
  cs.setCaseSensitive(true);
  cs.setContent(CodeSystemContentMode.COMPLETE);
  cs.setLanguage("en");
}