Java Code Examples for org.hl7.fhir.r4.model.ValueSet#setUrl()

The following examples show how to use org.hl7.fhir.r4.model.ValueSet#setUrl() . 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 void makeFullVs(String dest, CodeSystem cs) throws FileNotFoundException, IOException {
  String url = "http://id.who.int/icd11/ValueSet/all-MMS";
  ValueSet vs = new ValueSet();
  vs.setId("all-MMS");
  vs.setUrl(url);
  vs.setName("ICDMMSAll");
  vs.setTitle("Value Set for all ICD MMS Codes");
  vs.setStatus(PublicationStatus.ACTIVE);
  vs.setExperimental(false);
  vs.setDate(cs.getDate());
  vs.setPublisher("WHO");
  vs.setCopyright("Consult WHO For terms of use");
  vs.setVersion(cs.getVersion());
  vs.setStatus(cs.getStatus());
  ConceptSetComponent inc = vs.getCompose().addInclude();
  inc.setSystem(cs.getUrl());
  new XmlParser(XmlVersion.V1_1).setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(dest, "vs-all-MMS.xml")), vs);
}
 
Example 2
Source File: ICD11Generator.java    From org.hl7.fhir.core with Apache License 2.0 6 votes vote down vote up
private void makeFullVs2(String dest, CodeSystem cs) throws FileNotFoundException, IOException {
  String url = "http://id.who.int/icd11/ValueSet/all-foundation";
  ValueSet vs = new ValueSet();
  vs.setId("all-foundation");
  vs.setUrl(url);
  vs.setName("ICDFoundationAll");
  vs.setTitle("Value Set for all ICD Foundation Concepts");
  vs.setStatus(PublicationStatus.ACTIVE);
  vs.setExperimental(false);
  vs.setDate(cs.getDate());
  vs.setPublisher("WHO");
  vs.setCopyright("Consult WHO For terms of use");
  vs.setVersion(cs.getVersion());
  vs.setStatus(cs.getStatus());
  ConceptSetComponent inc = vs.getCompose().addInclude();
  inc.setSystem(cs.getUrl());
  new XmlParser(XmlVersion.V1_1).setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(dest, "vs-all-foundation.xml")), vs);
}
 
Example 3
Source File: ICD11Generator.java    From org.hl7.fhir.core with Apache License 2.0 6 votes vote down vote up
private String buildValueSet(CodeSystem cs, String code, String name, JsonObject o, String dest) throws FileNotFoundException, IOException {
  String id = code+"-"+name;
  String url = "http://id.who.int/icd11/ValueSet/"+id;
  ValueSet vs = new ValueSet();
  vs.setId(id);
  vs.setUrl(url);
  vs.setName("VS"+name+"4"+code);
  vs.setTitle("Value Set for "+name+" on "+code);
  vs.setStatus(PublicationStatus.ACTIVE);
  vs.setExperimental(false);
  vs.setDate(cs.getDate());
  vs.setPublisher("WHO");
  vs.setCopyright("Consult WHO For terms of use");
  vs.setVersion(cs.getVersion());
  vs.setStatus(cs.getStatus());
  ConceptSetComponent inc = vs.getCompose().addInclude();
  inc.setSystem(cs.getUrl());
  for (JsonElement e : o.getAsJsonArray("scaleEntity")) {
    inc.addFilter().setProperty("concept").setOp(FilterOperator.ISA).setValue(tail(e.getAsString()));
  }    
  new XmlParser(XmlVersion.V1_1).setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(dest, "vs-"+id+".xml")), vs);
  return url;
}
 
Example 4
Source File: ImplicitValueSets.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private static ValueSet allUcumValueSet() {
  ValueSet vs = new ValueSet();
  vs.setUrl("http://unitsofmeasure.org/vs");
  vs.setStatus(PublicationStatus.ACTIVE);
  vs.setName("AllUcumCodes");
  vs.setTitle("All Ucum Codes");
  vs.getCompose().addInclude().setSystem("http://unitsofmeasure.org");
  return vs;
}