public Coding makeCodingFromCV(Element cd) throws Exception { if (cd == null || Utilities.noString(cd.getAttribute("code"))) return null; Coding c = new Coding(); c.setCode(cd.getAttribute("code")); c.setDisplay(cd.getAttribute("displayName")); String r = cd.getAttribute("codeSystem"); String uri = getUriForOID(r); if (uri != null) c.setSystem(uri); else if (isGuid(r)) c.setSystem("urn:uuid:"+r); else if (UriForOid(r) != null) c.setSystem(UriForOid(r)); else c.setSystem("urn:oid:"+r); return c; }
public org.hl7.fhir.dstu3.model.Coding convertEncounterClass(org.hl7.fhir.instance.model.Encounter.EncounterClass src) throws FHIRException { if (src == null) return null; switch (src) { case INPATIENT: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("IMP"); case OUTPATIENT: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("AMB"); case AMBULATORY: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("AMB"); case EMERGENCY: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("EMER"); case HOME: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("HH"); case FIELD: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("FLD"); case DAYTIME: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("SS"); case VIRTUAL: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("VR"); default: return null; } }
private Coding readAsCoding(Element item) { Coding c = new Coding(); c.setSystem(item.getNamedChildValue("system")); c.setVersion(item.getNamedChildValue("version")); c.setCode(item.getNamedChildValue("code")); c.setDisplay(item.getNamedChildValue("display")); return c; }
String s = getRubric(cls, "shortTitle"); if (s != null && !s.equals(concept.getDefinition())) concept.addDesignation().setUse(new Coding().setSystem("http://hl7.org/fhir/sid/icpc2/rubrics").setCode("shortTitle")).setValue(s); s = getRubric(cls, "inclusion"); if (s != null) concept.addDesignation().setUse(new Coding().setSystem("http://hl7.org/fhir/sid/icpc2/rubrics").setCode("inclusion")).setValue(s); s = getRubric(cls, "exclusion"); if (s != null) concept.addDesignation().setUse(new Coding().setSystem("http://hl7.org/fhir/sid/icpc2/rubrics").setCode("exclusion")).setValue(s); s = getRubric(cls, "criteria"); if (s != null) concept.addDesignation().setUse(new Coding().setSystem("http://hl7.org/fhir/sid/icpc2/rubrics").setCode("criteria")).setValue(s); s = getRubric(cls, "consider"); if (s != null) concept.addDesignation().setUse(new Coding().setSystem("http://hl7.org/fhir/sid/icpc2/rubrics").setCode("consider")).setValue(s); s = getRubric(cls, "note"); if (s != null) concept.addDesignation().setUse(new Coding().setSystem("http://hl7.org/fhir/sid/icpc2/rubrics").setCode("note")).setValue(s);
private Meta toMeta(Collection<TagDefinition> tagDefinitions) { Meta retVal = new Meta(); for (TagDefinition next : tagDefinitions) { switch (next.getTagType()) { case PROFILE: retVal.addProfile(next.getCode()); break; case SECURITY_LABEL: retVal.addSecurity().setSystem(next.getSystem()).setCode(next.getCode()).setDisplay(next.getDisplay()); break; case TAG: retVal.addTag().setSystem(next.getSystem()).setCode(next.getCode()).setDisplay(next.getDisplay()); break; } } return retVal; }
public org.hl7.fhir.dstu3.model.Coding convertCoding(org.hl7.fhir.instance.model.Coding src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Coding tgt = new org.hl7.fhir.dstu3.model.Coding(); copyElement(src, tgt); tgt.setSystem(src.getSystem()); tgt.setVersion(src.getVersion()); tgt.setCode(src.getCode()); tgt.setDisplay(src.getDisplay()); tgt.setUserSelected(src.getUserSelected()); return tgt; }
obs.getCode().addCoding().setSystem("http://loinc.org").setCode("12345-6"); obs.setValue(new StringType("This is a value"));
public static org.hl7.fhir.dstu3.model.Coding convertCoding(org.hl7.fhir.dstu2016may.model.Coding src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Coding tgt = new org.hl7.fhir.dstu3.model.Coding(); copyElement(src, tgt); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasCode()) tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasUserSelected()) tgt.setUserSelected(src.getUserSelected()); return tgt; }
/** * Convenience constructor * * @param theSystem The {@link #setSystem(String) code system} * @param theCode The {@link #setCode(String) code} * @param theDisplay The {@link #setDisplay(String) human readable display} */ public Coding(String theSystem, String theCode, String theDisplay) { setSystem(theSystem); setCode(theCode); setDisplay(theDisplay); } /**
public org.hl7.fhir.dstu3.model.Coding convertEncounterClass(org.hl7.fhir.instance.model.Encounter.EncounterClass src) throws FHIRException { if (src == null) return null; switch (src) { case INPATIENT: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("IMP"); case OUTPATIENT: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("AMB"); case AMBULATORY: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("AMB"); case EMERGENCY: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("EMER"); case HOME: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("HH"); case FIELD: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("FLD"); case DAYTIME: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("SS"); case VIRTUAL: return new org.hl7.fhir.dstu3.model.Coding().setSystem("http://hl7.org/fhir/v3/ActCode").setCode("VR"); default: return null; } }
public static Coding makeCoding(String code) throws FHIRException { String[] parts = code.split("\\|"); Coding c = new Coding(); if (parts.length == 2) { c.setSystem(parts[0]); c.setCode(parts[1]); } else if (parts.length == 3) { c.setSystem(parts[0]); c.setCode(parts[1]); c.setDisplay(parts[2]); } else throw new FHIRException("Unable to understand the code '"+code+"'. Use the format system|code(|display)"); return c; }
/** * Convenience method which adds a security tag * * @param theSystem The code system * @param theCode The code * @param theDisplay The display name * @return Returns a reference to <code>this</code> for easy chaining */ public Meta addSecurity(String theSystem, String theCode, String theDisplay) { addSecurity().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay); return this; } /**
/** * Convenience method which adds a tag * * @param theSystem The code system * @param theCode The code * @param theDisplay The display name * @return Returns a reference to <code>this</code> for easy chaining */ public Meta addTag(String theSystem, String theCode, String theDisplay) { addTag().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay); return this; } /**
public static CodeableConcept newCodeableConcept(String code, String system, String display) { CodeableConcept cc = new CodeableConcept(); Coding c = new Coding(); c.setCode(code); c.setSystem(system); c.setDisplay(display); cc.getCoding().add(c); return cc; }
@SuppressWarnings("rawtypes") private Coding buildCoding(Type value1, Type value2) { return new Coding().setSystem(((PrimitiveType) value1).asStringValue()).setCode(((PrimitiveType) value2).asStringValue()) ; }
tgt.setPrimarySource(!src.getReported()); if (src.hasPerformer()) tgt.addPractitioner().setActor(convertReference(src.getPerformer())).setRole(new org.hl7.fhir.dstu3.model.CodeableConcept().addCoding(new Coding().setSystem("http://hl7.org/fhir/v2/0443").setCode("AP"))); if (src.hasRequester()) tgt.addPractitioner().setActor(convertReference(src.getRequester())).setRole(new org.hl7.fhir.dstu3.model.CodeableConcept().addCoding(new Coding().setSystem("http://hl7.org/fhir/v2/0443").setCode("OP"))); tgt.setEncounter(convertReference(src.getEncounter())); tgt.setManufacturer(convertReference(src.getManufacturer()));
private Coding readAsCoding(Element item) { Coding c = new Coding(); c.setSystem(item.getNamedChildValue("system")); c.setVersion(item.getNamedChildValue("version")); c.setCode(item.getNamedChildValue("code")); c.setDisplay(item.getNamedChildValue("display")); return c; }
public static Coding readAsCoding(Element item) { Coding c = new Coding(); c.setSystem(item.getNamedChildValue("system")); c.setVersion(item.getNamedChildValue("version")); c.setCode(item.getNamedChildValue("code")); c.setDisplay(item.getNamedChildValue("display")); return c; }
public org.hl7.fhir.dstu3.model.Coding convertCoding(org.hl7.fhir.instance.model.Coding src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Coding tgt = new org.hl7.fhir.dstu3.model.Coding(); copyElement(src, tgt); tgt.setSystem(src.getSystem()); tgt.setVersion(src.getVersion()); tgt.setCode(src.getCode()); tgt.setDisplay(src.getDisplay()); tgt.setUserSelected(src.getUserSelected()); return tgt; }
public static org.hl7.fhir.dstu3.model.Coding convertCoding(org.hl7.fhir.dstu2016may.model.Coding src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Coding tgt = new org.hl7.fhir.dstu3.model.Coding(); copyElement(src, tgt); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasVersion()) tgt.setVersion(src.getVersion()); if (src.hasCode()) tgt.setCode(src.getCode()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); if (src.hasUserSelected()) tgt.setUserSelected(src.getUserSelected()); return tgt; }